


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



def       lowerCAmelCase			(		lowerCAmelCase_ = np.pi / 2			, lowerCAmelCase_ = np.pi / 2			, lowerCAmelCase_ = np.pi / 2			)->			qiskit.result.counts.Counts:
				lowerCAmelCase_			:   Dict     					=					QuantumRegister(3			, '''qr'''			)  # Define the number of quantum bits
				lowerCAmelCase_			:   int     					=					ClassicalRegister(1			, '''cr'''			)  # Define the number of classical bits

				lowerCAmelCase_			:   Tuple     					=					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
				lowerCAmelCase_			:   Tuple     					=					Aer.get_backend('''aer_simulator'''			)
				lowerCAmelCase_			:   Dict     					=					execute(lowerCAmelCase_			, lowerCAmelCase_			, shots=1_000			)

				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 doctest

import projectq
from projectq.ops import H, Measure



def       lowerCAmelCase			(		lowerCAmelCase_			)->			int:
				lowerCAmelCase_			:   List[Any]     					=					quantum_engine.allocate_qubit()
				H | qubit
				Measure | qubit
				return int(lowerCAmelCase_			)


if __name__ == "__main__":
						doctest.testmod()

						# initialises a new quantum backend
						_UpperCAmelCase      :	str  =projectq.MainEngine()

						# Generate a list of 10 random numbers
						_UpperCAmelCase      :	Optional[int]  =[get_random_number(quantum_engine) for _ in range(10)]

						# Flushes the quantum engine from memory
						quantum_engine.flush()

						print("""Random numbers""", random_numbers_list)