



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






def 						_lowerCAmelCase    (					__lowerCamelCase :  float = np.pi / 2		,						__lowerCamelCase :  float = np.pi / 2		,						__lowerCamelCase :  float = np.pi / 2  ):



 """simple docstring"""





 __SCREAMING_SNAKE_CASE							:     List[str]							=						QuantumRegister(3		,						"qr"  )  # Define the number of quantum bits
 __SCREAMING_SNAKE_CASE							:     List[Any]							=						ClassicalRegister(1		,						"cr"  )  # Define the number of classical bits

 __SCREAMING_SNAKE_CASE							:     Any							=						QuantumCircuit(__lowerCamelCase		,						__lowerCamelCase  )  # Define the quantum circuit.

 # Build the circuit
 quantum_circuit.u(__lowerCamelCase		,						__lowerCamelCase		,						__lowerCamelCase		,						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
 __SCREAMING_SNAKE_CASE							:     Optional[int]							=						Aer.get_backend("aer_simulator"  )
 __SCREAMING_SNAKE_CASE							:     Optional[Any]							=						execute(__lowerCamelCase		,						__lowerCamelCase		,						shots=1000  )

 return job.result().get_counts(__lowerCamelCase  )


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








import math

import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute





def        lowerCAmelCase       (				snake_case__   :      int = 1				,					snake_case__   :      int = 1 )->			qiskit.result.counts.Counts:
    if isinstance(snake_case__				,					snake_case__ ) or isinstance(snake_case__				,					snake_case__ ):
        raise TypeError("inputs must be integers." )
    if (bit_a < 0) or (bit_a < 0):
        raise ValueError("inputs must be positive." )
    if (math.floor(snake_case__ ) != bit_a) or (math.floor(snake_case__ ) != bit_a):
        raise ValueError("inputs must be exact integers." )
    if (bit_a > 1) or (bit_a > 1):
        raise ValueError("inputs must be less or equal to 1." )

    # build registers
    A_								=					QuantumRegister(2				,					"qr" )
    A_								=					ClassicalRegister(2				,					"cr" )

    A_								=					QuantumCircuit(snake_case__				,					snake_case__ )

    # entanglement the qubits
    quantum_circuit.h(1 )
    quantum_circuit.cx(1				,					0 )

    # send the information
    A_								=					str(snake_case__ ) + str(snake_case__ )

    if c_information == "11":
        quantum_circuit.x(1 )
        quantum_circuit.z(1 )
    elif c_information == "10":
        quantum_circuit.z(1 )
    elif c_information == "01":
        quantum_circuit.x(1 )
    else:
        quantum_circuit.i(1 )

    # unentangled the circuit
    quantum_circuit.cx(1				,					0 )
    quantum_circuit.h(1 )

    # measure the circuit
    quantum_circuit.measure(snake_case__				,					snake_case__ )

    A_								=					Aer.get_backend("aer_simulator" )
    A_								=					execute(snake_case__				,					snake_case__				,					shots=1000 )

    return job.result().get_counts(snake_case__ )


if __name__ == "__main__":
     print(f"""Counts for classical state send: {superdense_coding(1,1)}""")






