






"""simple docstring"""



import numpy as np
import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute




def   _lowerCAmelCase		(				UpperCAmelCase__							:       float = np.pi / 2,    UpperCAmelCase__							:       float = np.pi / 2,    UpperCAmelCase__							:       float = np.pi / 2   )		->qiskit.result.counts.Counts:
						A__    :	Optional[int]			=	QuantumRegister(3,    """qr"""   )  # Define the number of quantum bits
						A__    :	Optional[int]			=	ClassicalRegister(1,    """cr"""   )  # Define the number of classical bits

						A__    :	List[Any]			=	QuantumCircuit(_UpperCAmelCase,    _UpperCAmelCase   )  # Define the quantum circuit.

						# Build the circuit
						quantum_circuit.u(_UpperCAmelCase,    _UpperCAmelCase,    _UpperCAmelCase,    0   )  # Quantum State to teleport
						quantum_circuit.h(1   )  # add hadamard gate
						quantum_circuit.cx(
						    1,    2   )  # add control gate with qubit 1 as control and 2 as target.
						quantum_circuit.cx(0,    1   )
						quantum_circuit.h(0   )
						quantum_circuit.cz(0,    2   )  # add control z gate.
						quantum_circuit.cx(1,    2   )

						quantum_circuit.measure([2],    [0]   )  # measure the qubit.

						# Simulate the circuit using qasm simulator
						A__    :	List[str]			=	Aer.get_backend("""aer_simulator"""   )
						A__    :	Optional[Any]			=	execute(_UpperCAmelCase,    _UpperCAmelCase,    shots=1_0_0_0   )

						return job.result().get_counts(_UpperCAmelCase   )


if __name__ == "__main__":
						print(
						    '''Total count for teleported state is: '''
						    F'{quantum_teleportation(np.pi/2, np.pi/2, np.pi/2)}'
						)













'''simple docstring'''


import numpy as np
import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute




def       A							(      _UpperCAmelCase   :				float = np.pi / 2						,_UpperCAmelCase   :				float = np.pi / 2						,_UpperCAmelCase   :				float = np.pi / 2					)  ->				qiskit.result.counts.Counts:


  '''simple docstring'''




  __lowerCAmelCase		:    Optional[int]			     =  QuantumRegister(3						,'qr'					)  # Define the number of quantum bits
  __lowerCAmelCase		:    Optional[int]			     =  ClassicalRegister(1						,'cr'					)  # Define the number of classical bits

  __lowerCAmelCase		:    List[Any]			     =  QuantumCircuit(_UpperCAmelCase						,_UpperCAmelCase					)  # Define the quantum circuit.

  # Build the circuit
  quantum_circuit.u(_UpperCAmelCase						,_UpperCAmelCase						,_UpperCAmelCase						,0					)  # Quantum State to teleport
  quantum_circuit.h(1					)  # add hadamard gate
  quantum_circuit.cx(
      1						,2					)  # add control gate with qubit 1 as control and 2 as target.
  quantum_circuit.cx(0						,1					)
  quantum_circuit.h(0					)
  quantum_circuit.cz(0						,2					)  # add control z gate.
  quantum_circuit.cx(1						,2					)

  quantum_circuit.measure([2]						,[0]					)  # measure the qubit.

  # Simulate the circuit using qasm simulator
  __lowerCAmelCase		:    List[str]			     =  Aer.get_backend('aer_simulator'					)
  __lowerCAmelCase		:    Optional[Any]			     =  execute(_UpperCAmelCase						,_UpperCAmelCase						,shots=1_0_0_0					)

  return job.result().get_counts(_UpperCAmelCase					)


if __name__ == "__main__":
    print(
        "Total count for teleported state is: "
        F'''{quantum_teleportation(np.pi/2, np.pi/2, np.pi/2)}'''
    )





