


import math

import qiskit







def  __snake_case       (   UpperCamelCase__ = 1 ,			UpperCamelCase__ = 1 ,			UpperCamelCase__ = 1	)      ->		qiskit.result.counts.Counts:







		"""simple docstring"""





		if (
		    isinstance(_lowercase ,			_lowercase	)
		    or isinstance(_lowercase ,			_lowercase	)
		    or isinstance(_lowercase ,			_lowercase	)
		):
				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(_lowercase	) != input_a)
		    or (math.floor(_lowercase	) != input_a)
		    or (math.floor(_lowercase	) != 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
		A					       = qiskit.QuantumRegister(4 ,			'qr'	)
		A					       = qiskit.ClassicalRegister(2 ,			'cr'	)
		# list the entries
		A					       = [input_a, input_a, carry_in]

		A					       = qiskit.QuantumCircuit(_lowercase ,			_lowercase	)

		for i in range(0 ,			3	):
				if entry[i] == 2:
						quantum_circuit.h(_lowercase	)  # for hadamard entries
				elif entry[i] == 1:
						quantum_circuit.x(_lowercase	)  # for 1 entries
				elif entry[i] == 0:
						quantum_circuit.i(_lowercase	)  # 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] ,			_lowercase	)  # measure the last two qbits

		A					       = qiskit.Aer.get_backend('aer_simulator'	)
		A					       = qiskit.execute(_lowercase ,			_lowercase ,			shots=1000	)

		return job.result().get_counts(_lowercase	)


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









"""simple docstring"""


def  __snake_case       (   UpperCamelCase__ ,			UpperCamelCase__	)      ->		int:







		"""simple docstring"""





		while b:
				A       , A					       = b, a % b
		return a







def  __snake_case       (   UpperCamelCase__ ,			UpperCamelCase__	)      ->		int:







		"""simple docstring"""





		return a if b == 0 else euclidean_gcd_recursive(UpperCamelCase__ ,			a % b	)







def  __snake_case       (   )      ->		List[Any]:







		"""simple docstring"""





		print(f'euclidean_gcd(3, 5) = {euclidean_gcd(3 ,			5	)}'	)
		print(f'euclidean_gcd(5, 3) = {euclidean_gcd(5 ,			3	)}'	)
		print(f'euclidean_gcd(1, 3) = {euclidean_gcd(1 ,			3	)}'	)
		print(f'euclidean_gcd(3, 6) = {euclidean_gcd(3 ,			6	)}'	)
		print(f'euclidean_gcd(6, 3) = {euclidean_gcd(6 ,			3	)}'	)

		print(f'euclidean_gcd_recursive(3, 5) = {euclidean_gcd_recursive(3 ,			5	)}'	)
		print(f'euclidean_gcd_recursive(5, 3) = {euclidean_gcd_recursive(5 ,			3	)}'	)
		print(f'euclidean_gcd_recursive(1, 3) = {euclidean_gcd_recursive(1 ,			3	)}'	)
		print(f'euclidean_gcd_recursive(3, 6) = {euclidean_gcd_recursive(3 ,			6	)}'	)
		print(f'euclidean_gcd_recursive(6, 3) = {euclidean_gcd_recursive(6 ,			3	)}'	)


if __name__ == "__main__":
	main()





