

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


def 				_UpperCAmelCase							(	a__ = np.pi / 2     ,  a__ = np.pi / 2     ,  a__ = np.pi / 2):

			'''simple docstring'''



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

			a_	:	List[Any]          =   QuantumCircuit(a__     ,  a__)  # Define the quantum circuit.

			# Build the circuit
			quantum_circuit.u(a__     ,  a__     ,  a__     ,  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_	:	List[Any]          =   Aer.get_backend("""aer_simulator""")
			a_	:	Optional[Any]          =   execute(a__     ,  a__     ,  shots=1_0_0_0)

			return job.result().get_counts(a__)


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





from cva import destroyAllWindows, imread, imshow, waitKey


def 				_UpperCAmelCase							(	a__     ,  a__):

			'''simple docstring'''



			a_       ,				a_	:	Optional[int]          =   img.shape[0], img.shape[1]

			def to_grayscale(a__     ,  a__     ,  a__):
						return 0.2126 * red + 0.587 * green + 0.114 * blue

			def normalize(a__):
						return min(a__     ,  2_5_5)

			for i in range(a__):
						for j in range(a__):
									a_	:	Optional[Any]          =   int(to_grayscale(*img[i][j]))
									a_	:	Union[str, Any]          =   [
									    normalize(a__),
									    normalize(greyscale + factor),
									    normalize(greyscale + 2 * factor),
									]

			return img


if __name__ == "__main__":
	# read original image
	__snake_case							:			Dict      		= {
	    percentage: imread("""image_data/lena.jpg""", 1) for percentage in (10, 20, 30, 40)
	}

	for percentage, img in images.items():
		make_sepia(img, percentage)

	for percentage, img in images.items():
		imshow(F"""Original image with sepia (factor: {percentage})""", img)

	waitKey(0)
	destroyAllWindows()


