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




def 				_snake_case     (       lowerCAmelCase							:       float = np.pi / 2       ,			lowerCAmelCase							:       float = np.pi / 2       ,			lowerCAmelCase							:       float = np.pi / 2     ):
		"""simple docstring"""







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

		SCREAMING_SNAKE_CASE_  :		Union[str, 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_  :		List[str]    				=   Aer.get_backend("aer_simulator"     )
		SCREAMING_SNAKE_CASE_  :		Any    				=   execute(lowerCAmelCase       ,			lowerCAmelCase       ,			shots=1_0_0_0     )

		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)}'''
		)

from __future__ import annotations

import sys




def 				_snake_case     (       lowerCAmelCase							:       int     ):
		"""simple docstring"""







		if n < 0:
				raise ValueError("Negative arguments are not supported"     )
		return _fib(lowerCAmelCase     )[0]




def 				_snake_case     (       lowerCAmelCase							:       int     ):
		"""simple docstring"""







		if n == 0:  # (F(0), F(1))
				return (0, 1)

		# F(2n) = F(n)[2F(n+1) − F(n)]
		# F(2n+1) = F(n+1)^2+F(n)^2
		SCREAMING_SNAKE_CASE_				,   SCREAMING_SNAKE_CASE_  :		Dict    				=   _fib(n // 2     )
		SCREAMING_SNAKE_CASE_  :		Optional[Any]    				=   a * (b * 2 - a)
		SCREAMING_SNAKE_CASE_  :		List[str]    				=   a * a + b * b
		return (d, c + d) if n % 2 else (c, d)


if __name__ == "__main__":
		__lowerCamelCase :     str          =  int(sys.argv[1])
		print(f'''fibonacci({n}) is {fibonacci(n)}''')
