
'''simple docstring'''





from cva import COLOR_BGR2GRAY, cvtColor, imread, imshow, waitKey
from numpy import divide, inta, multiply, ravel, sort, zeros_like

def   A			(							A_				:       Tuple     ,				A_				:       int=3							):
						snake_case							:  Any			=     int(mask / 2							)
						# copy image size
						snake_case							:  Dict			=     zeros_like(A_							)
						for i in range(A_     ,				gray_img.shape[0] - bd							):
												for j in range(A_     ,				gray_img.shape[1] - bd							):
																		# get mask according with mask
																		snake_case							:  Optional[Any]			=     ravel(gray_img[i - bd : i + bd + 1, j - bd : j + bd + 1]							)
																		# calculate mask median
																		snake_case							:  Dict			=     sort(A_							)[inta(divide((multiply(A_     ,				A_							))     ,				2							) + 1							)]
																		snake_case							:  Union[str, Any]			=     median
						return median_img


if __name__ == "__main__":
						# read original image
						UpperCAmelCase            = imread("../image_data/lena.jpg")
						# turn image in gray scale value
						UpperCAmelCase            = cvtColor(img, COLOR_BGR2GRAY)

						# get values with two different mask size
						UpperCAmelCase            = median_filter(gray, 3)
						UpperCAmelCase            = median_filter(gray, 5)

						# show result images
						imshow("median filter with 3x3 mask", medianaxa)
						imshow("median filter with 5x5 mask", medianaxa)
						waitKey(0)



'''simple docstring'''





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

def   A			(							A_				:       float = np.pi / 2     ,				A_				:       float = np.pi / 2     ,				A_				:       float = np.pi / 2							):
						snake_case							:  List[Any]			=     QuantumRegister(3     ,				'''qr'''							)  # Define the number of quantum bits
						snake_case							:  List[Any]			=     ClassicalRegister(1     ,				'''cr'''							)  # Define the number of classical bits

						snake_case							:  Dict			=     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
						snake_case							:  str			=     Aer.get_backend('''aer_simulator'''							)
						snake_case							:  List[str]			=     execute(A_     ,				A_     ,				shots=1000							)

						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)}'''
						)

