




'''simple docstring'''






_lowerCAmelCase				     = 1000

def       __lowerCAmelCase (   snake_case__						):
			return x * x

def       __lowerCAmelCase (   snake_case__ ,				snake_case__ ,				snake_case__ ,				snake_case__ = 4						):
			assert callable(
			    snake_case__						), F"the function(object) passed should be callable your input : {function}"
			assert isinstance(snake_case__ ,				(float, int)						), F"a should be float or integer your input : {a}"
			assert isinstance(function(snake_case__						) ,				(float, int)						), (
			    "the function should return integer or float return type of your function, "
			    F"{type(snake_case__						)}"
			)
			assert isinstance(snake_case__ ,				(float, int)						), F"b should be float or integer your input : {b}"
			assert (
			    isinstance(snake_case__ ,				snake_case__						) and precision > 0
			), F"precision should be positive integer your input : {precision}"

			# just applying the formula of simpson for approximate integration written in
			# mentioned article in first comment of this file and above this function

			__UpperCamelCase				:      Optional[int]									=       (b - a) / N_STEPS
			__UpperCamelCase				:      Dict									=       function(snake_case__						) + function(snake_case__						)

			for i in range(1 ,				snake_case__						):
						__UpperCamelCase				:      Any									=       a + h * i
						result += function(snake_case__						) * (4 if i % 2 else 2)

			result *= h / 3
			return round(snake_case__ ,				snake_case__						)


if __name__ == "__main__":
				import doctest

				doctest.testmod()









'''simple docstring'''






import math

import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute

def       __lowerCAmelCase (   snake_case__ = 1 ,				snake_case__ = 1						):
			if isinstance(snake_case__ ,				snake_case__						) or isinstance(snake_case__ ,				snake_case__						):
						raise TypeError("inputs must be integers."						)
			if (bit_a < 0) or (bit_a < 0):
						raise ValueError("inputs must be positive."						)
			if (math.floor(snake_case__						) != bit_a) or (math.floor(snake_case__						) != bit_a):
						raise ValueError("inputs must be exact integers."						)
			if (bit_a > 1) or (bit_a > 1):
						raise ValueError("inputs must be less or equal to 1."						)

			# build registers
			__UpperCamelCase				:      Tuple									=       QuantumRegister(2 ,				"qr"						)
			__UpperCamelCase				:      Dict									=       ClassicalRegister(2 ,				"cr"						)

			__UpperCamelCase				:      str									=       QuantumCircuit(snake_case__ ,				snake_case__						)

			# entanglement the qubits
			quantum_circuit.h(1						)
			quantum_circuit.cx(1 ,				0						)

			# send the information
			__UpperCamelCase				:      Optional[Any]									=       str(snake_case__						) + str(snake_case__						)

			if c_information == "11":
						quantum_circuit.x(1						)
						quantum_circuit.z(1						)
			elif c_information == "10":
						quantum_circuit.z(1						)
			elif c_information == "01":
						quantum_circuit.x(1						)
			else:
						quantum_circuit.i(1						)

			# unentangled the circuit
			quantum_circuit.cx(1 ,				0						)
			quantum_circuit.h(1						)

			# measure the circuit
			quantum_circuit.measure(snake_case__ ,				snake_case__						)

			__UpperCamelCase				:      Dict									=       Aer.get_backend("aer_simulator"						)
			__UpperCamelCase				:      Tuple									=       execute(snake_case__ ,				snake_case__ ,				shots=1_000						)

			return job.result().get_counts(snake_case__						)


if __name__ == "__main__":
				print(f'Counts for classical state send: {superdense_coding(1,1)}')



