'''simple docstring'''


from cva import COLOR_BGR2GRAY, cvtColor, imread, imshow, waitKey
from numpy import array, dot, pad, ravel, uinta, zeros


def    _lowerCamelCase       ( lowerCamelCase_   :				List[str]      ,	lowerCamelCase_   :				List[str]  ):



     """simple docstring"""





     UpperCAmelCase_				:  Optional[Any]  = image.shape
     UpperCAmelCase_				:  Dict  = cols - block_size[1] + 1
     UpperCAmelCase_				:  Union[str, Any]  = rows - block_size[0] + 1
     UpperCAmelCase_				:  Optional[int]  = zeros((dst_height * dst_width, block_size[1] * block_size[0])  )
     UpperCAmelCase_				:  Any  = 0
     for i in range(0      ,	lowerCamelCase_  ):
          for j in range(0      ,	lowerCamelCase_  ):
               UpperCAmelCase_				:  Any  = ravel(image[i : i + block_size[0], j : j + block_size[1]]  )
               UpperCAmelCase_				:  Optional[Any]  = window
               row += 1

     return image_array


def    _lowerCamelCase       ( lowerCamelCase_   :				List[Any]      ,	lowerCamelCase_   :				Tuple  ):



     """simple docstring"""





     UpperCAmelCase_				:  Dict  = image.shape[0], image.shape[1]
     UpperCAmelCase_				:  str  = filter_kernel.shape[0]
     UpperCAmelCase_				:  List[str]  = k_size // 2
     # Pads image with the edge values of array.
     UpperCAmelCase_				:  List[str]  = pad(lowerCamelCase_      ,	lowerCamelCase_      ,	mode='edge'  )

     # im2col, turn the k_size*k_size pixels into a row and np.vstack all rows
     UpperCAmelCase_				:  List[Any]  = imacol(lowerCamelCase_      ,	(k_size, k_size)  )

     #  turn the kernel into shape(k*k, 1)
     UpperCAmelCase_				:  Optional[int]  = ravel(lowerCamelCase_  )
     # reshape and get the dst image
     UpperCAmelCase_				:  str  = dot(lowerCamelCase_      ,	lowerCamelCase_  ).reshape(lowerCamelCase_      ,	lowerCamelCase_  )
     return dst


if __name__ == "__main__":
 # read original image
 snake_case__	:     Any      =    imread(r'''../image_data/lena.jpg''')
 # turn image in gray scale value
 snake_case__	:     Optional[Any]      =    cvtColor(img, COLOR_BGR2GRAY)
 # Laplace operator
 snake_case__	:     int      =    array([[0, 1, 0], [1, -4, 1], [0, 1, 0]])
 snake_case__	:     Optional[int]      =    img_convolve(gray, Laplace_kernel).astype(uinta)
 imshow('''Laplacian''', out)
 waitKey(0)














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

def   SCREAMING_SNAKE_CASE_				(				__magic_name__   :    float = np.pi / 2      ,     __magic_name__   :    float = np.pi / 2      ,     __magic_name__   :    float = np.pi / 2   )						->     qiskit.result.counts.Counts:






	"""simple docstring"""



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

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

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

	return job.result().get_counts(__magic_name__   )


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