



'''simple docstring'''





from __future__ import annotations



class  snake_case__						:
 def __init__(   self						:							str      ,     __a						:							str=None  )      ->   int:







       '''simple docstring'''
       __snake_case :   Union[str, Any]													=    data
       __snake_case :   List[Any]													=    None





 def __repr__(   self						:							Dict  )      ->   Tuple:







       '''simple docstring'''
       __snake_case :   List[Any]													=    []
       __snake_case :   Optional[Any]													=    self
       while temp:
             string_rep.append(f'''{temp.data}'''  )
             __snake_case :   Any													=    temp.next
       return "->".join(__a  )





def   a_   (		_UpperCAmelCase    :      list				)    ->  Optional[int]:
      if not elements_list:
            raise Exception('The Elements List is empty'				)

      __snake_case :   Dict													=    Node(elements_list[0]				)
      for i in range(1 ,len(_UpperCAmelCase				)				):
            __snake_case :   Union[str, Any]													=    Node(elements_list[i]				)
            __snake_case :   List[Any]													=    current.next
      return head





def   a_   (		_UpperCAmelCase    :      Node				)    ->  None:
      if head_node is not None and isinstance(_UpperCAmelCase ,_UpperCAmelCase				):
            print_reverse(head_node.next				)
            print(head_node.data				)





def   a_   (		)    ->  List[Any]:
      from doctest import testmod

      testmod()

      __snake_case :   Optional[int]													=    make_linked_list([14, 52, 14, 12, 43]				)
      print('Linked List:'				)
      print(_UpperCAmelCase				)
      print('Elements in Reverse:'				)
      print_reverse(_UpperCAmelCase				)


if __name__ == "__main__":
    main()








'''simple docstring'''





import qiskit





def   a_   (		_UpperCAmelCase    :      int = 2				)    ->  qiskit.result.counts.Counts:
      __snake_case :   Union[str, Any]													=    qubits

      # Using Aer's simulator
      __snake_case :   List[Any]													=    qiskit.Aer.get_backend('aer_simulator'				)

      # Creating a Quantum Circuit acting on the q register
      __snake_case :   Dict													=    qiskit.QuantumCircuit(_UpperCAmelCase ,_UpperCAmelCase				)

      # Adding a H gate on qubit 0 (now q0 in superposition)
      circuit.h(0				)

      for i in range(1 ,_UpperCAmelCase				):
            # Adding CX (CNOT) gate
            circuit.cx(i - 1 ,_UpperCAmelCase				)

      # Mapping the quantum measurement to the classical bits
      circuit.measure(list(range(_UpperCAmelCase				)				) ,list(range(_UpperCAmelCase				)				)				)

      # Now measuring any one qubit would affect other qubits to collapse
      # their super position and have same state as the measured one.

      # Executing the circuit on the simulator
      __snake_case :   Optional[Any]													=    qiskit.execute(_UpperCAmelCase ,_UpperCAmelCase ,shots=10_00				)

      return job.result().get_counts(_UpperCAmelCase				)


if __name__ == "__main__":
    print(F"""Total count for various states are: {quantum_entanglement(3)}""")



