






"""simple docstring"""





import numpy as np
import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute






def     A(  snake_case_ = np.pi / 2						,       snake_case_ = np.pi / 2						,       snake_case_ = np.pi / 2		):
       """simple docstring"""





       lowercase__:    Optional[Any]        =      QuantumRegister(3						,       "qr"		)  # Define the number of quantum bits
       lowercase__:    Any        =      ClassicalRegister(1						,       "cr"		)  # Define the number of classical bits

       lowercase__:    Any        =      QuantumCircuit(snake_case_						,       snake_case_		)  # Define the quantum circuit.

       # Build the circuit
       quantum_circuit.u(snake_case_						,       snake_case_						,       snake_case_						,       0		)  # Quantum State to teleport
       quantum_circuit.h(1		)  # add hadamard gate
       quantum_circuit.cx(
           1						,       2		)  # add control gate with qubit 1 as control and 2 as target.
       quantum_circuit.cx(0						,       1		)
       quantum_circuit.h(0		)
       quantum_circuit.cz(0						,       2		)  # add control z gate.
       quantum_circuit.cx(1						,       2		)

       quantum_circuit.measure([2]						,       [0]		)  # measure the qubit.

       # Simulate the circuit using qasm simulator
       lowercase__:    int        =      Aer.get_backend("aer_simulator"		)
       lowercase__:    Union[str, Any]        =      execute(snake_case_						,       snake_case_						,       shots=1000		)

       return job.result().get_counts(snake_case_		)


if __name__ == "__main__":
  print(
      """Total count for teleported state is: """
      F"{quantum_teleportation(np.pi/2, np.pi/2, np.pi/2)}"
  )














"""simple docstring"""





from __future__ import annotations






def     A(  snake_case_						,       snake_case_		):
       """simple docstring"""





       lowercase__  ,     lowercase__:    Optional[int]        =      0, len(snake_case_		) - 1
       while start_ind <= end_ind:
              if array[start_ind] == search_item:
                     return start_ind
              elif array[end_ind] == search_item:
                     return end_ind
              else:
                     start_ind += 1
                     end_ind -= 1
    # returns -1 if search_item is not found in array
       return -1


if __name__ == "__main__":
  print(double_linear_search(list(range(1_00)), 40))






