


'''simple docstring'''
import qiskit
from qiskit.providers import Backend




def      __snake_case       (       lowerCamelCase_ :				int	,  lowerCamelCase_ :				int						):
				'''simple docstring'''




				__magic_name__  ,      __magic_name__	  = bin(__lowerCamelCase						)[2:], bin(__lowerCamelCase						)[2:]  # Remove leading '0b'

				# Ensure that both strings are of the same length
				if len(__lowerCamelCase						) > len(__lowerCamelCase						):
								__magic_name__	  = y.zfill(len(__lowerCamelCase						)						)
				else:
								__magic_name__	  = 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
				__magic_name__	  = 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      __snake_case       (       lowerCamelCase_ :				qiskit.QuantumCircuit	,  lowerCamelCase_ :				int	,  lowerCamelCase_ :				int	,  lowerCamelCase_ :				int	,  lowerCamelCase_ :				int	,  ):
				'''simple docstring'''




				circuit.ccx(__lowerCamelCase	,  __lowerCamelCase	,  __lowerCamelCase						)
				circuit.cx(__lowerCamelCase	,  __lowerCamelCase						)
				circuit.ccx(__lowerCamelCase	,  __lowerCamelCase	,  __lowerCamelCase						)
				circuit.cx(__lowerCamelCase	,  __lowerCamelCase						)
				circuit.cx(__lowerCamelCase	,  __lowerCamelCase						)




def      __snake_case       (       lowerCamelCase_ :				int	,  lowerCamelCase_ :				int	,  lowerCamelCase_ :				Backend = qiskit.Aer.get_backend("aer_simulator"						)	,  ):
				'''simple docstring'''




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

				# Store the Integers
				__magic_name__  ,      __magic_name__  ,      __magic_name__	  = 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]						)

				__magic_name__	  = 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()







'''simple docstring'''
import numpy as np

__magic_name__   :   str  							=[
    ['a', 'b', 'c', 'd', 'e'],
    ['f', 'g', 'h', 'i', 'k'],
    ['l', 'm', 'n', 'o', 'p'],
    ['q', 'r', 's', 't', 'u'],
    ['v', 'w', 'x', 'y', 'z'],
]






class 		UpperCamelCase_		:





						"""simple docstring"""




						def __init__( self				:					Union[str, Any]  )							->					None:
										__magic_name__	  = np.array(_lowerCamelCase  )
						def 					__A					( self				:					List[str]	,				_lowerCamelCase				:					str  )							->					np.ndarray:
										__magic_name__  ,      __magic_name__	  = np.where(letter == self.SQUARE  )
										__magic_name__	  = np.concatenate([indexa + 1, indexa + 1]  )
										return indexes
						def 					__A					( self				:					Any	,				_lowerCamelCase				:					int	,				_lowerCamelCase				:					int  )							->					str:
										return self.SQUARE[indexa - 1, indexa - 1]
						def 					__A					( self				:					Union[str, Any]	,				_lowerCamelCase				:					str  )							->					str:
										__magic_name__	  = message.lower()
										__magic_name__	  = message.replace("j"	,				"i"  )

										__magic_name__	  = ""
										for letter_index in range(len(_lowerCamelCase  )  ):
														if message[letter_index] != " ":
																		__magic_name__	  = self.letter_to_numbers(message[letter_index]  )
																		__magic_name__	  = encoded_message + str(numbers[0]  ) + str(numbers[1]  )
														elif message[letter_index] == " ":
																		__magic_name__	  = encoded_message + " "

										return encoded_message

						def 					__A					( self				:					Optional[Any]	,				_lowerCamelCase				:					str  )							->					str:
										__magic_name__	  = message.replace(" "	,				"  "  )
										__magic_name__	  = ""
										for numbers_index in range(int(len(_lowerCamelCase  ) / 2  )  ):
														if message[numbers_index * 2] != " ":
																		__magic_name__	  = message[numbers_index * 2]
																		__magic_name__	  = message[numbers_index * 2 + 1]

																		__magic_name__	  = self.numbers_to_letter(int(_lowerCamelCase  )	,				int(_lowerCamelCase  )  )
																		__magic_name__	  = decoded_message + letter
														elif message[numbers_index * 2] == " ":
																		__magic_name__	  = decoded_message + " "

										return decoded_message



