


import qiskit
from qiskit.providers import Backend







def 						_lowercase       (     __lowerCamelCase			:					int		,__lowerCamelCase			:					int			)  ->   tuple[qiskit.QuantumCircuit, str, str]:





     '''simple docstring'''





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

     # Ensure that both strings are of the same length
     if len(__lowerCamelCase			) > len(__lowerCamelCase			):
          UpperCamelCase__							:  Dict								=     y.zfill(len(__lowerCamelCase			)			)
     else:
          UpperCamelCase__							:  int								=     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
     UpperCamelCase__							:  Any								=     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       (     __lowerCamelCase			:					qiskit.QuantumCircuit		,__lowerCamelCase			:					int		,__lowerCamelCase			:					int		,__lowerCamelCase			:					int		,__lowerCamelCase			:					int		,)  ->   Optional[Any]:





     '''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 						_lowercase       (     __lowerCamelCase			:					int		,__lowerCamelCase			:					int		,__lowerCamelCase			:					Backend = qiskit.Aer.get_backend('''aer_simulator'''			)		,)  ->   int:





     '''simple docstring'''





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

     # Store the Integers
     UpperCamelCase__	,UpperCamelCase__	,UpperCamelCase__							:  Union[str, Any]								=     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]			)

     UpperCamelCase__							:  int								=     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()








import math







def 						_lowercase       (     __lowerCamelCase			:					int			)  ->   str:





     '''simple docstring'''





     if number == 0:
          UpperCamelCase__							:  List[str]								=     '''Zero'''
          return words
     else:
          UpperCamelCase__							:  str								=     math.logaa(__lowerCamelCase			)
          UpperCamelCase__							:  Tuple								=     digits + 1
          UpperCamelCase__							:  List[str]								=     {}
          UpperCamelCase__							:  Optional[int]								=     ''''''
          UpperCamelCase__							:  str								=     '''One'''
          UpperCamelCase__							:  int								=     '''Two'''
          UpperCamelCase__							:  str								=     '''Three'''
          UpperCamelCase__							:  Dict								=     '''Four'''
          UpperCamelCase__							:  List[str]								=     '''Five'''
          UpperCamelCase__							:  int								=     '''Six'''
          UpperCamelCase__							:  str								=     '''Seven'''
          UpperCamelCase__							:  List[str]								=     '''Eight'''
          UpperCamelCase__							:  Tuple								=     '''Nine'''

          UpperCamelCase__							:  int								=     {}
          UpperCamelCase__							:  Any								=     ''''''
          UpperCamelCase__							:  Union[str, Any]								=     '''Twenty'''
          UpperCamelCase__							:  Optional[int]								=     '''Thirty'''
          UpperCamelCase__							:  Optional[int]								=     '''Forty'''
          UpperCamelCase__							:  Any								=     '''Fifty'''
          UpperCamelCase__							:  Optional[Any]								=     '''Sixty'''
          UpperCamelCase__							:  Union[str, Any]								=     '''Seventy'''
          UpperCamelCase__							:  Tuple								=     '''Eighty'''
          UpperCamelCase__							:  Dict								=     '''Ninety'''

          UpperCamelCase__							:  Any								=     {}
          UpperCamelCase__							:  str								=     '''Ten'''
          UpperCamelCase__							:  List[Any]								=     '''Eleven'''
          UpperCamelCase__							:  List[str]								=     '''Twelve'''
          UpperCamelCase__							:  List[str]								=     '''Thirteen'''
          UpperCamelCase__							:  List[Any]								=     '''Fourteen'''
          UpperCamelCase__							:  Union[str, Any]								=     '''Fifteen'''
          UpperCamelCase__							:  str								=     '''Sixteen'''
          UpperCamelCase__							:  int								=     '''Seventeen'''
          UpperCamelCase__							:  Tuple								=     '''Eighteen'''
          UpperCamelCase__							:  int								=     '''Nineteen'''

          UpperCamelCase__							:  Union[str, Any]								=     {}
          UpperCamelCase__							:  Dict								=     '''Hundred,'''
          UpperCamelCase__							:  Union[str, Any]								=     '''Thousand,'''
          UpperCamelCase__							:  List[Any]								=     '''Lakh,'''
          UpperCamelCase__							:  str								=     '''Crore,'''

          UpperCamelCase__							:  int								=     number
          UpperCamelCase__							:  int								=     ''''''
          UpperCamelCase__							:  int								=     0
          UpperCamelCase__							:  int								=     int(__lowerCamelCase			)
          while counter < digits:
               UpperCamelCase__							:  str								=     temp_num % 10
               if counter % 2 == 0:
                    UpperCamelCase__							:  List[Any]								=     ''''''
                    if counter in placevalue and current != 0:
                         UpperCamelCase__							:  Optional[Any]								=     placevalue[counter]
                    if counter == 2:
                         UpperCamelCase__							:  Tuple								=     singles[current] + addition + words
                    elif counter == 0:
                         if ((temp_num % 100) // 10) == 1:
                              UpperCamelCase__							:  Optional[Any]								=     teens[current] + addition + words
                              UpperCamelCase__							:  int								=     temp_num // 10
                              counter += 1
                         else:
                              UpperCamelCase__							:  Optional[Any]								=     singles[current] + addition + words

                    else:
                         UpperCamelCase__							:  Tuple								=     doubles[current] + addition + words

               else:
                    if counter == 1:
                         if current == 1:
                              UpperCamelCase__							:  Optional[Any]								=     teens[number % 10] + words
                         else:
                              UpperCamelCase__							:  Union[str, Any]								=     ''''''
                              if counter in placevalue:
                                   UpperCamelCase__							:  Optional[int]								=     placevalue[counter]
                              UpperCamelCase__							:  Optional[Any]								=     doubles[current] + addition + words
                    else:
                         UpperCamelCase__							:  List[Any]								=     ''''''
                         if counter in placevalue:
                              if current == 0 and ((temp_num % 100) // 10) == 0:
                                   UpperCamelCase__							:  Dict								=     ''''''
                              else:
                                   UpperCamelCase__							:  List[Any]								=     placevalue[counter]
                         if ((temp_num % 100) // 10) == 1:
                              UpperCamelCase__							:  Optional[int]								=     teens[current] + addition + words
                              UpperCamelCase__							:  Dict								=     temp_num // 10
                              counter += 1
                         else:
                              UpperCamelCase__							:  Optional[int]								=     singles[current] + addition + words
               counter += 1
               UpperCamelCase__							:  List[str]								=     temp_num // 10
     return words


if __name__ == "__main__":
   import doctest

   doctest.testmod()




