



'''simple docstring'''

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:
		_a  :   int				 =							QuantumRegister(3		,    'qr'						)  # Define the number of quantum bits
		_a  :   Union[str, Any]				 =							ClassicalRegister(1		,    'cr'						)  # Define the number of classical bits

		_a  :   List[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
		_a  :   Tuple				 =							Aer.get_backend('aer_simulator'						)
		_a  :   str				 =							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)}"""
							)









'''simple docstring'''

import math



def   __lowerCamelCase  (   lowerCAmelCase_						)    ->   list:
		if n <= 0:
				raise ValueError('Only positive integers have prime factors'						)
		_a  :   Tuple				 =							[]
		while n % 2 == 0:
				pf.append(2						)
				_a  :   str				 =							int(n / 2						)
		for i in range(3		,    int(math.sqrt(lowerCAmelCase_						)						) + 1		,    2						):
				while n % i == 0:
						pf.append(lowerCAmelCase_						)
						_a  :   List[Any]				 =							int(n / i						)
		if n > 2:
				pf.append(lowerCAmelCase_						)
		return pf



def   __lowerCamelCase  (   lowerCAmelCase_						)    ->   int:
		if n <= 0:
				raise ValueError('Only positive numbers are accepted'						)
		_a  :   int				 =							1
		_a  :   Union[str, Any]				 =							1
		while n % 2 == 0:
				temp += 1
				_a  :   str				 =							int(n / 2						)
		div *= temp
		for i in range(3		,    int(math.sqrt(lowerCAmelCase_						)						) + 1		,    2						):
				_a  :   List[str]				 =							1
				while n % i == 0:
						temp += 1
						_a  :   List[str]				 =							int(n / i						)
				div *= temp
		if n > 1:
				div *= 2
		return div



def   __lowerCamelCase  (   lowerCAmelCase_						)    ->   int:
		if n <= 0:
				raise ValueError('Only positive numbers are accepted'						)
		_a  :   List[str]				 =							1
		_a  :   Union[str, Any]				 =							1
		while n % 2 == 0:
				temp += 1
				_a  :   Tuple				 =							int(n / 2						)
		if temp > 1:
				s *= (2**temp - 1) / (2 - 1)
		for i in range(3		,    int(math.sqrt(lowerCAmelCase_						)						) + 1		,    2						):
				_a  :   str				 =							1
				while n % i == 0:
						temp += 1
						_a  :   Any				 =							int(n / i						)
				if temp > 1:
						s *= (i**temp - 1) / (i - 1)
		return int(lowerCAmelCase_						)



def   __lowerCamelCase  (   lowerCAmelCase_						)    ->   int:
		_a  :   Dict				 =							n
		for x in set(prime_factors(lowerCAmelCase_						)						):
				s *= (x - 1) / x
		return int(lowerCAmelCase_						)


if __name__ == "__main__":
							import doctest

							doctest.testmod()




