

'''simple docstring'''

import qiskit





def    A_  ( snake_case = 2 ):
  SCREAMING_SNAKE_CASE:Optional[Any]						      =					qubits

  # Using Aer's simulator
  SCREAMING_SNAKE_CASE:Any						      =					qiskit.Aer.get_backend("aer_simulator" )

  # Creating a Quantum Circuit acting on the q register
  SCREAMING_SNAKE_CASE:Optional[Any]						      =					qiskit.QuantumCircuit(snake_case      ,       snake_case )

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

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

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

  # 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
  SCREAMING_SNAKE_CASE:Tuple						      =					qiskit.execute(snake_case      ,       snake_case      ,       shots=1000 )

  return job.result().get_counts(snake_case )


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









'''simple docstring'''

def    A_  ( snake_case ):
  SCREAMING_SNAKE_CASE:Dict						      =					(1 + 24 * n) ** 0.5
  return ((1 + root) / 6) % 1 == 0





def    A_  ( snake_case = 5000 ):
  SCREAMING_SNAKE_CASE:int						      =					[(i * (3 * i - 1)) // 2 for i in range(1      ,       snake_case )]
  for i, pentagonal_i in enumerate(snake_case ):
    for j in range(snake_case      ,       len(snake_case ) ):
      SCREAMING_SNAKE_CASE:int						      =					pentagonal_nums[j]
      SCREAMING_SNAKE_CASE:Any						      =					pentagonal_i + pentagonal_j
      SCREAMING_SNAKE_CASE:int						      =					pentagonal_j - pentagonal_i
      if is_pentagonal(snake_case ) and is_pentagonal(snake_case ):
        return b

  return -1


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






