

"""simple docstring"""


import qiskit



def   _A					(	_a	:						int = 2				):



      """simple docstring"""






      A				  =		qubits

      # Using Aer's simulator
      A				  =		qiskit.Aer.get_backend("""aer_simulator"""				)

      # Creating a Quantum Circuit acting on the q register
      A				  =		qiskit.QuantumCircuit(_a     ,   _a				)

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

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

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

      # 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
      A				  =		qiskit.execute(_a     ,   _a     ,   shots=1_0_0_0				)

      return job.result().get_counts(_a				)


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







"""simple docstring"""


import qiskit



def   _A					(	_a	:						int     ,   _a	:						int				):



      """simple docstring"""






      A				  =		qiskit.Aer.get_backend("""aer_simulator"""				)

      # Create a Quantum Circuit acting on the q register
      A				  =		qiskit.QuantumCircuit(_a     ,   _a				)

      # Apply X (NOT) Gate to Qubits 0 & 1
      circuit.x(0				)
      circuit.x(1				)

      # Map the quantum measurement to the classical bits
      circuit.measure([0, 1]     ,   [0, 1]				)

      # Execute the circuit on the qasm simulator
      A				  =		qiskit.execute(_a     ,   _a     ,   shots=1_0_0_0				)

      # Return the histogram data of the results of the experiment.
      return job.result().get_counts(_a				)


if __name__ == "__main__":
  UpperCAmelCase													=single_qubit_measure(2, 2)
  print(f"""Total count for various states are: {counts}""")




