"""simple docstring"""






import qiskit
from qiskit.providers import Backend



def SCREAMING_SNAKE_CASE__    (     __UpperCAmelCase ,					__UpperCAmelCase				):
   lowercase__:     Optional[int]      =   bin(__UpperCAmelCase				)[2:], bin(__UpperCAmelCase				)[2:]  # Remove leading '0b'

   # Ensure that both strings are of the same length
   if len(__UpperCAmelCase				) > len(__UpperCAmelCase				):
      lowercase__:     Tuple      =   y.zfill(len(__UpperCAmelCase				)				)
   else:
      lowercase__:     Optional[int]      =   x.zfill(len(__UpperCAmelCase				)				)

   # 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
   lowercase__:     Any      =   qiskit.QuantumCircuit((len(__UpperCAmelCase				) * 3) + 1 ,					len(__UpperCAmelCase				) + 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(__UpperCAmelCase				)				):
      if x[::-1][i] == "1":
         circuit.x(__UpperCAmelCase				)
   for j in range(len(__UpperCAmelCase				)				):
      if y[::-1][j] == "1":
         circuit.x(len(__UpperCAmelCase				) + j				)

   return circuit, x, y



def SCREAMING_SNAKE_CASE__    (     __UpperCAmelCase ,					__UpperCAmelCase ,					__UpperCAmelCase ,					__UpperCAmelCase ,					__UpperCAmelCase ,					):
   circuit.ccx(__UpperCAmelCase ,					__UpperCAmelCase ,					__UpperCAmelCase				)
   circuit.cx(__UpperCAmelCase ,					__UpperCAmelCase				)
   circuit.ccx(__UpperCAmelCase ,					__UpperCAmelCase ,					__UpperCAmelCase				)
   circuit.cx(__UpperCAmelCase ,					__UpperCAmelCase				)
   circuit.cx(__UpperCAmelCase ,					__UpperCAmelCase				)



def SCREAMING_SNAKE_CASE__    (     __UpperCAmelCase ,					__UpperCAmelCase ,					__UpperCAmelCase = qiskit.Aer.get_backend('''aer_simulator'''				) ,					):

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

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

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

   lowercase__:     Union[str, Any]      =   qiskit.execute(__UpperCAmelCase ,					__UpperCAmelCase ,					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"""






class 					UpperCAmelCase		:



    """simple docstring"""

    def __init__(     self					,    _UpperCAmelCase=None							):
       lowercase__:     Optional[int]      =   data
       lowercase__:     Dict      =   None






    def __repr__(     self							):
       lowercase__:     int      =   ''''''
       lowercase__:     Any      =   self
       while temp:
          string_rep += F"""<{temp.data}> ---> """
          lowercase__:     Any      =   temp.next
       string_rep += "<END>"
       return string_rep



def SCREAMING_SNAKE_CASE__    (     __UpperCAmelCase				)						->						str:

   # if elements_list is empty
   if not elements_list:
      raise Exception('''The Elements List is empty'''				)

   # Set first element as Head
   lowercase__:     Union[str, Any]      =   Node(elements_list[0]				)
   lowercase__:     List[str]      =   head
   # Loop through elements from position 1
   for data in elements_list[1:]:
      lowercase__:     Tuple      =   Node(__UpperCAmelCase				)
      lowercase__:     Tuple      =   current.next
   return head


__A         =				[1, 3, 5, 3_2, 4_4, 1_2, 4_3]
print(f'''List: {list_data}''')
print("Creating Linked List from List.")
__A         =				make_linked_list(list_data)
print("Linked List:")




print(linked_list)
