





'''simple docstring'''



import math

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



def  lowercase__(		_UpperCamelCase  : int = 1 ,   _UpperCamelCase  : int = 1				)->   qiskit.result.counts.Counts:






					"""simple docstring"""

					if isinstance(_UpperCamelCase ,   _UpperCamelCase				) or isinstance(_UpperCamelCase ,   _UpperCamelCase				):
										raise TypeError("inputs must be integers."				)
					if (bit_a < 0) or (bit_a < 0):
										raise ValueError("inputs must be positive."				)
					if (math.floor(_UpperCamelCase				) != bit_a) or (math.floor(_UpperCamelCase				) != 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											=   QuantumRegister(2 ,   "qr"				)
					_UpperCamelCase											=   ClassicalRegister(2 ,   "cr"				)

					_UpperCamelCase											=   QuantumCircuit(_UpperCamelCase ,   _UpperCamelCase				)

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

					# send the information
					_UpperCamelCase											=   str(_UpperCamelCase				) + str(_UpperCamelCase				)

					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(_UpperCamelCase ,   _UpperCamelCase				)

					_UpperCamelCase											=   Aer.get_backend("aer_simulator"				)
					_UpperCamelCase											=   execute(_UpperCamelCase ,   _UpperCamelCase ,   shots=1000				)

					return job.result().get_counts(_UpperCamelCase				)


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










'''simple docstring'''



from __future__ import annotations



def  lowercase__(		_UpperCamelCase  : list[list[int]] ,   _UpperCamelCase  : int ,   _UpperCamelCase  : int ,   _UpperCamelCase  : int | float				)->   None:






					"""simple docstring"""

					_UpperCamelCase				,	_UpperCamelCase											=   m - 1, 0
					while i >= 0 and j < n:
										if key == mat[i][j]:
															print(f"Key {key} found at row- {i + 1} column- {j + 1}"				)
															return
										if key < mat[i][j]:
															i -= 1
										else:
															j += 1
					print(f"Key {key} not found"				)



def  lowercase__(		)->   None:






					"""simple docstring"""

					_UpperCamelCase											=   [[2, 5, 7], [4, 8, 13], [9, 11, 15], [12, 17, 20]]
					_UpperCamelCase											=   int(input("Enter the element to be searched:"				)				)
					print(_UpperCamelCase				)
					search_in_a_sorted_matrix(_UpperCamelCase ,   len(_UpperCamelCase				) ,   len(mat[0]				) ,   _UpperCamelCase				)


if __name__ == "__main__":
			import doctest

			doctest.testmod()
			main()



