"""simple docstring"""




import qiskit





def 							SCREAMING_SNAKE_CASE					(      _lowerCamelCase						:	int = 2     )	->				qiskit.result.counts.Counts:
  _lowerCAmelCase						:	List[str]        =					qubits

  # Using Aer's simulator
  _lowerCAmelCase						:	List[str]        =					qiskit.Aer.get_backend("""aer_simulator"""     )

  # Creating a Quantum Circuit acting on the q register
  _lowerCAmelCase						:	Optional[Any]        =					qiskit.QuantumCircuit(_lowerCamelCase      ,_lowerCamelCase     )

  # Adding a H gate on qubit 0 (now q0 in superposition)
  circuit.h(0     )

  for i in range(1      ,_lowerCamelCase     ):
    # Adding CX (CNOT) gate
    circuit.cx(i - 1      ,_lowerCamelCase     )

  # Mapping the quantum measurement to the classical bits
  circuit.measure(list(range(_lowerCamelCase     )     )      ,list(range(_lowerCamelCase     )     )     )

  # Now measuring any one qubit would affect other qubits to collapse
  # their super position and have same state as the measured one.

  # Executing the circuit on the simulator
  _lowerCAmelCase						:	List[Any]        =					qiskit.execute(_lowerCamelCase      ,_lowerCamelCase      ,shots=1000     )

  return job.result().get_counts(_lowerCamelCase     )


if __name__ == "__main__":
     print(F"""Total count for various states are: {quantum_entanglement(3)}""")





"""simple docstring"""




from __future__ import annotations





def 							SCREAMING_SNAKE_CASE					(      _lowerCamelCase						:	list     )	->				float:
  if not nums:
    raise ValueError("""List is empty"""     )
  return sum(_lowerCamelCase     ) / len(_lowerCamelCase     )


if __name__ == "__main__":
     import doctest

     doctest.testmod()




