




'''simple docstring'''


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



def    _SCREAMING_SNAKE_CASE    (			UpperCamelCase__						:				float = np.pi / 2   ,						UpperCamelCase__						:				float = np.pi / 2   ,						UpperCamelCase__						:				float = np.pi / 2							):




     """simple docstring"""


     a_    :       Dict    	=     QuantumRegister(3   ,						"""qr"""							)  # Define the number of quantum bits
     a_    :       str    	=     ClassicalRegister(1   ,						"""cr"""							)  # Define the number of classical bits

     a_    :       Optional[int]    	=     QuantumCircuit(UpperCamelCase__   ,						UpperCamelCase__							)  # Define the quantum circuit.

     # Build the circuit
     quantum_circuit.u(UpperCamelCase__   ,						UpperCamelCase__   ,						UpperCamelCase__   ,						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
     a_    :       Union[str, Any]    	=     Aer.get_backend("""aer_simulator"""							)
     a_    :       Optional[Any]    	=     execute(UpperCamelCase__   ,						UpperCamelCase__   ,						shots=1000							)

     return job.result().get_counts(UpperCamelCase__							)


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






'''simple docstring'''


import shutil

import requests



def    _SCREAMING_SNAKE_CASE    (			UpperCamelCase__						:				str   ,						UpperCamelCase__						:				bool = False   ,						UpperCamelCase__						:				str = "."							):




     """simple docstring"""


     a_    :       Any    	=     """https://api.nasa.gov/planetary/apod"""
     return requests.get(UpperCamelCase__   ,						params={"""api_key""": api_key}							).json()



def    _SCREAMING_SNAKE_CASE    (			UpperCamelCase__						:				str   ,						UpperCamelCase__						:				str = "."							):




     """simple docstring"""


     a_    :       Tuple    	=     get_apod_data(UpperCamelCase__							)
     a_    :       Tuple    	=     apod_data["""url"""]
     a_    :       Any    	=     img_url.split("""/"""							)[-1]
     a_    :       Tuple    	=     requests.get(UpperCamelCase__   ,						stream=UpperCamelCase__							)

     with open(F"{path}/{img_name}"   ,						"""wb+"""							) as img_file:
          shutil.copyfileobj(response.raw   ,						UpperCamelCase__							)
     del response
     return apod_data



def    _SCREAMING_SNAKE_CASE    (			UpperCamelCase__						:				str							):




     """simple docstring"""


     a_    :       str    	=     """https://images-api.nasa.gov/search"""
     return requests.get(UpperCamelCase__   ,						params={"""q""": query}							).json()


if __name__ == "__main__":
 print(save_apod('YOUR API KEY'))
 lowerCAmelCase_			:     int							    =     get_archive_data('apollo 2011')['collection']['items']
 print(apollo_aaaa_items[0]['data'][0]['description'])
