






'''simple docstring'''

import math

import qiskit






def 	_UpperCAmelCase    (  a		:	int = 1						,			a		:	int = 1						,			a		:	int = 1							)			->			qiskit.result.counts.Counts:





						"""simple docstring"""
						if (
						    isinstance(a						,			a							)
						    or isinstance(a						,			a							)
						    or isinstance(a						,			a							)
						):
												raise TypeError('inputs must be integers.'							)

						if (input_a < 0) or (input_a < 0) or (carry_in < 0):
												raise ValueError('inputs must be positive.'							)

						if (
						    (math.floor(a							) != input_a)
						    or (math.floor(a							) != input_a)
						    or (math.floor(a							) != carry_in)
						):
												raise ValueError('inputs must be exact integers.'							)

						if (input_a > 2) or (input_a > 2) or (carry_in > 2):
												raise ValueError('inputs must be less or equal to 2.'							)

						# build registers
						lowercase_      :   Optional[Any]        =			qiskit.QuantumRegister(4						,			'qr'							)
						lowercase_      :   Dict        =			qiskit.ClassicalRegister(2						,			'cr'							)
						# list the entries
						lowercase_      :   Dict        =			[input_a, input_a, carry_in]

						lowercase_      :   Optional[Any]        =			qiskit.QuantumCircuit(a						,			a							)

						for i in range(0						,			3							):
												if entry[i] == 2:
																		quantum_circuit.h(a							)  # for hadamard entries
												elif entry[i] == 1:
																		quantum_circuit.x(a							)  # for 1 entries
												elif entry[i] == 0:
																		quantum_circuit.i(a							)  # for 0 entries

    # build the circuit
						quantum_circuit.ccx(0						,			1						,			3							)  # ccx = toffoli gate
						quantum_circuit.cx(0						,			1							)
						quantum_circuit.ccx(1						,			2						,			3							)
						quantum_circuit.cx(1						,			2							)
						quantum_circuit.cx(0						,			1							)

						quantum_circuit.measure([2, 3]						,			a							)  # measure the last two qbits

						lowercase_      :   Dict        =			qiskit.Aer.get_backend('aer_simulator'							)
						lowercase_      :   Tuple        =			qiskit.execute(a						,			a						,			shots=1_0_0_0							)

						return job.result().get_counts(a							)


if __name__ == "__main__":
						print(f"""Total sum count for state is: {quantum_full_adder(1, 1, 1)}""")








'''simple docstring'''

from ..utils import DummyObject, requires_backends






class 							__magic_name__     (	metaclass=UpperCAmelCase_				):







	"""simple docstring"""



	SCREAMING_SNAKE_CASE_					:      str        =  ['transformers', 'torch', 'note_seq']
	def __init__(							self  ,      *_lowercase  ,      **_lowercase       )						->  Dict:
							requires_backends(self  ,      ['transformers', 'torch', 'note_seq']       )
	@classmethod
	def        lowerCamelCase__		(							cls  ,      *_lowercase  ,      **_lowercase       )						->  List[str]:
							requires_backends(cls  ,      ['transformers', 'torch', 'note_seq']       )







	@classmethod
	def        lowerCamelCase__		(							cls  ,      *_lowercase  ,      **_lowercase       )						->  Dict:
							requires_backends(cls  ,      ['transformers', 'torch', 'note_seq']       )
