


'''simple docstring'''

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

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






       """simple docstring"""







       lowercase__				      =			QuantumRegister(3  ,			'''qr'''	)  # Define the number of quantum bits
       lowercase__				      =			ClassicalRegister(1  ,			'''cr'''	)  # Define the number of classical bits

       lowercase__				      =			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
       lowercase__				      =			Aer.get_backend('''aer_simulator'''	)
       lowercase__				      =			execute(A  ,			A  ,			shots=1_000	)

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








'''simple docstring'''

import math
import os

import cva
import numpy as np

lowerCamelCase							:       Optional[Any]  						=     2_5_5.0

def _SCREAMING_SNAKE_CASE				(A  ,			A	)	->	float:






       """simple docstring"""







       lowercase__				      =			np.mean((original - contrast) ** 2	)
       if mse == 0:
              return 100

       return 20 * math.logaa(PIXEL_MAX / math.sqrt(A	)	)

def _SCREAMING_SNAKE_CASE				()	->	None:






       """simple docstring"""







       lowercase__				      =			os.path.dirname(os.path.realpath(A	)	)
       # Loading images (original image and compressed image)
       lowercase__				      =			cva.imread(os.path.join(A  ,			'''image_data/original_image.png'''	)	)
       lowercase__				      =			cva.imread(os.path.join(A  ,			'''image_data/compressed_image.png'''	)  ,			1	)

       lowercase__				      =			cva.imread(os.path.join(A  ,			'''image_data/PSNR-example-base.png'''	)	)
       lowercase__				      =			cva.imread(
           os.path.join(A  ,			'''image_data/PSNR-example-comp-10.jpg'''	)  ,			1	)

       # Value expected: 29.73dB
       print('''-- First Test --'''	)
       print(f"PSNR value is {peak_signal_to_noise_ratio(A  ,			A	)} dB"	)

       # # Value expected: 31.53dB (Wikipedia Example)
       print('''\n-- Second Test --'''	)
       print(f"PSNR value is {peak_signal_to_noise_ratio(A  ,			A	)} dB"	)


if __name__ == "__main__":
 main()




