




'''simple docstring'''






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






def 		UpperCamelCase__			(		__SCREAMING_SNAKE_CASE = np.pi / 2							,			__SCREAMING_SNAKE_CASE = np.pi / 2							,			__SCREAMING_SNAKE_CASE = np.pi / 2		)						->      qiskit.result.counts.Counts:
      snake_case__					:      Union[str, Any]  			=						QuantumRegister(3							,			'qr'		)  # Define the number of quantum bits
      snake_case__					:      List[str]  			=						ClassicalRegister(1							,			'cr'		)  # Define the number of classical bits

      snake_case__					:      Tuple  			=						QuantumCircuit(__SCREAMING_SNAKE_CASE							,			__SCREAMING_SNAKE_CASE		)  # Define the quantum circuit.

      # Build the circuit
      quantum_circuit.u(__SCREAMING_SNAKE_CASE							,			__SCREAMING_SNAKE_CASE							,			__SCREAMING_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
      snake_case__					:      Any  			=						Aer.get_backend('aer_simulator'		)
      snake_case__					:      Any  			=						execute(__SCREAMING_SNAKE_CASE							,			__SCREAMING_SNAKE_CASE							,			shots=1000		)

      return job.result().get_counts(__SCREAMING_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'''






def 		UpperCamelCase__			(		__SCREAMING_SNAKE_CASE = 1000		)						->      int:
      snake_case__					:      List[str]  			=						0
      snake_case__					:      int  			=						(n - 1) // 3
      total += ((terms) * (6 + (terms - 1) * 3)) // 2  # total of an A.P.
      snake_case__					:      Optional[Any]  			=						(n - 1) // 5
      total += ((terms) * (10 + (terms - 1) * 5)) // 2
      snake_case__					:      Tuple  			=						(n - 1) // 15
      total -= ((terms) * (30 + (terms - 1) * 15)) // 2
      return total


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