
"""simple docstring"""


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



def        _lowerCamelCase(__UpperCamelCase = np.pi / 2       ,					__UpperCamelCase = np.pi / 2       ,					__UpperCamelCase = np.pi / 2			)							->					qiskit.result.counts.Counts:
	_lowerCAmelCase								=QuantumRegister(3       ,					"""qr"""			)  # Define the number of quantum bits
	_lowerCAmelCase								=ClassicalRegister(1       ,					"""cr"""			)  # Define the number of classical bits

	_lowerCAmelCase								=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								=Aer.get_backend("""aer_simulator"""			)
	_lowerCAmelCase								=execute(__UpperCamelCase       ,					__UpperCamelCase       ,					shots=1000			)

	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"""


def        _lowerCamelCase(__UpperCamelCase = 20			)							->					int:

	try:
		_lowerCAmelCase								=int(__UpperCamelCase			)
	except (TypeError, ValueError):
		raise TypeError("""Parameter n must be int or castable to int."""			)
	if n <= 0:
		raise ValueError("""Parameter n must be greater than or equal to one."""			)
	_lowerCAmelCase								=0
	while 1:
		i += n * (n - 1)
		_lowerCAmelCase								=0
		for j in range(2       ,					__UpperCamelCase			):
			if i % j != 0:
				_lowerCAmelCase								=1
				break
		if nfound == 0:
			if i == 0:
				_lowerCAmelCase								=1
			return i
	return None


if __name__ == "__main__":
			print(F"""{solution() = }""")



