





import qiskit
from qiskit.providers import Backend





def   _lowercase       (    _UpperCAmelCase      ,   _UpperCAmelCase					)    ->	int:
				lowerCamelCase			,	lowerCamelCase									=bin(lowerCAmelCase__					)[2:], bin(lowerCAmelCase__					)[2:]  # Remove leading '0b'

				# Ensure that both strings are of the same length
				if len(lowerCAmelCase__					) > len(lowerCAmelCase__					):
								lowerCamelCase									=y.zfill(len(lowerCAmelCase__					)					)
				else:
								lowerCamelCase									=x.zfill(len(lowerCAmelCase__					)					)

				# We need (3 * number of bits in the larger number)+1 qBits
				# The second parameter is the number of classical registers, to measure the result
				lowerCamelCase									=qiskit.QuantumCircuit((len(lowerCAmelCase__					) * 3) + 1      ,   len(lowerCAmelCase__					) + 1					)

				# We are essentially "not-ing" the bits that are 1
				# Reversed because it's easier to perform ops on more significant bits
				for i in range(len(lowerCAmelCase__					)					):
								if x[::-1][i] == "1":
												circuit.x(lowerCAmelCase__					)
				for j in range(len(lowerCAmelCase__					)					):
								if y[::-1][j] == "1":
												circuit.x(len(lowerCAmelCase__					) + j					)

				return circuit, x, y





def   _lowercase       (    _UpperCAmelCase      ,   _UpperCAmelCase      ,   _UpperCAmelCase      ,   _UpperCAmelCase      ,   _UpperCAmelCase      ,   )    ->	Optional[Any]:
				circuit.ccx(lowerCAmelCase__      ,   lowerCAmelCase__      ,   lowerCAmelCase__					)
				circuit.cx(lowerCAmelCase__      ,   lowerCAmelCase__					)
				circuit.ccx(lowerCAmelCase__      ,   lowerCAmelCase__      ,   lowerCAmelCase__					)
				circuit.cx(lowerCAmelCase__      ,   lowerCAmelCase__					)
				circuit.cx(lowerCAmelCase__      ,   lowerCAmelCase__					)





def   _lowercase       (    _UpperCAmelCase      ,   _UpperCAmelCase      ,   _UpperCAmelCase = qiskit.Aer.get_backend("""aer_simulator"""					)      ,   )    ->	List[Any]:

				if vala < 0 or vala < 0:
								raise ValueError("""Both Integers must be positive!"""					)

				# Store the Integers
				lowerCamelCase			,	lowerCamelCase			,	lowerCamelCase									=store_two_classics(lowerCAmelCase__      ,   lowerCAmelCase__					)
				for i in range(len(lowerCAmelCase__					)					):
								full_adder(lowerCAmelCase__      ,   lowerCAmelCase__      ,   len(lowerCAmelCase__					) + i      ,   len(lowerCAmelCase__					) + len(lowerCAmelCase__					) + i      ,   len(lowerCAmelCase__					) + len(lowerCAmelCase__					) + i + 1					)
								circuit.barrier()  # Optional, just for aesthetics

				# Measure the resultant qBits
				for i in range(len(lowerCAmelCase__					) + 1					):
								circuit.measure([(len(lowerCAmelCase__					) * 2) + i]      ,   [i]					)

				lowerCamelCase									=qiskit.execute(lowerCAmelCase__      ,   lowerCAmelCase__      ,   shots=1					).result()

				# The result is in binary. Convert it back to int
				return int(list(res.get_counts()					)[0]      ,   2					)


if __name__ == "__main__":
							import doctest

							doctest.testmod()







def 			UpperCamelCase       (				lowerCAmelCase__ = 30						):
					'''simple docstring'''
					lowercase		      =		exponent + 2
					lowercase		      =		(1 + 5**0.5) / 2
					lowercase		      =		(phi**fibonacci_index - (phi - 1) ** fibonacci_index) / 5**0.5

					return int(lowerCAmelCase__						)


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




