


import qiskit







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







		"""simple docstring"""





		A					       = qiskit.Aer.get_backend('aer_simulator'	)

		A					       = qiskit.QuantumCircuit(4 ,			2	)
		# encode inputs in qubits 0 and 1
		if bita == 1:
				qc_ha.x(0	)
		if bita == 1:
				qc_ha.x(1	)
		qc_ha.barrier()

		# use cnots to write XOR of the inputs on qubit2
		qc_ha.cx(0 ,			2	)
		qc_ha.cx(1 ,			2	)

		# use ccx / toffoli gate to write AND of the inputs on qubit3
		qc_ha.ccx(0 ,			1 ,			3	)
		qc_ha.barrier()

		# extract outputs
		qc_ha.measure(2 ,			0	)  # extract XOR value
		qc_ha.measure(3 ,			1	)  # extract AND value

		# Execute the circuit on the qasm simulator
		A					       = qiskit.execute(UpperCamelCase__ ,			UpperCamelCase__ ,			shots=1000	)

		# Return the histogram data of the results of the experiment
		return job.result().get_counts(UpperCamelCase__	)


if __name__ == "__main__":
	UpperCamelCase						:				Optional[Any]             =      half_adder(1, 1)
	print(F"""Half Adder Output Qubit Counts: {counts}""")









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





