





import qiskit
from qiskit.providers import Backend






def  SCREAMING_SNAKE_CASE__							(				UpperCamelCase__:							int    ,      UpperCamelCase__:							int			):
		SCREAMING_SNAKE_CASE__		,  SCREAMING_SNAKE_CASE__								=					bin(UpperCamelCase__			)[2:], bin(UpperCamelCase__			)[2:]  # Remove leading '0b'

		# Ensure that both strings are of the same length
		if len(UpperCamelCase__			) > len(UpperCamelCase__			):
				SCREAMING_SNAKE_CASE__								=					y.zfill(len(UpperCamelCase__			)			)
		else:
				SCREAMING_SNAKE_CASE__								=					x.zfill(len(UpperCamelCase__			)			)

		# We need (3 * number of bits in the larger number)+1 qBits
		# The second parameter is the number of classical registers, to measure the result
		SCREAMING_SNAKE_CASE__								=					qiskit.QuantumCircuit((len(UpperCamelCase__			) * 3) + 1    ,      len(UpperCamelCase__			) + 1			)

		# We are essentially "not-ing" the bits that are 1
		# Reversed because it's easier to perform ops on more significant bits
		for i in range(len(UpperCamelCase__			)			):
				if x[::-1][i] == "1":
						circuit.x(UpperCamelCase__			)
		for j in range(len(UpperCamelCase__			)			):
				if y[::-1][j] == "1":
						circuit.x(len(UpperCamelCase__			) + j			)

		return circuit, x, y






def  SCREAMING_SNAKE_CASE__							(				UpperCamelCase__:							qiskit.QuantumCircuit    ,      UpperCamelCase__:							int    ,      UpperCamelCase__:							int    ,      UpperCamelCase__:							int    ,      UpperCamelCase__:							int    ,      ):
		circuit.ccx(UpperCamelCase__    ,      UpperCamelCase__    ,      UpperCamelCase__			)
		circuit.cx(UpperCamelCase__    ,      UpperCamelCase__			)
		circuit.ccx(UpperCamelCase__    ,      UpperCamelCase__    ,      UpperCamelCase__			)
		circuit.cx(UpperCamelCase__    ,      UpperCamelCase__			)
		circuit.cx(UpperCamelCase__    ,      UpperCamelCase__			)






def  SCREAMING_SNAKE_CASE__							(				UpperCamelCase__:							int    ,      UpperCamelCase__:							int    ,      UpperCamelCase__:							Backend = qiskit.Aer.get_backend("""aer_simulator"""			)    ,      ):

		if vala < 0 or vala < 0:
				raise ValueError("""Both Integers must be positive!"""			)

		# Store the Integers
		SCREAMING_SNAKE_CASE__		,  SCREAMING_SNAKE_CASE__		,  SCREAMING_SNAKE_CASE__								=					store_two_classics(UpperCamelCase__    ,      UpperCamelCase__			)
		for i in range(len(UpperCamelCase__			)			):
				full_adder(UpperCamelCase__    ,      UpperCamelCase__    ,      len(UpperCamelCase__			) + i    ,      len(UpperCamelCase__			) + len(UpperCamelCase__			) + i    ,      len(UpperCamelCase__			) + len(UpperCamelCase__			) + i + 1			)
				circuit.barrier()  # Optional, just for aesthetics

		# Measure the resultant qBits
		for i in range(len(UpperCamelCase__			) + 1			):
				circuit.measure([(len(UpperCamelCase__			) * 2) + i]    ,      [i]			)

		SCREAMING_SNAKE_CASE__								=					qiskit.execute(UpperCamelCase__    ,      UpperCamelCase__    ,      shots=1			).result()

		# The result is in binary. Convert it back to int
		return int(list(res.get_counts()			)[0]    ,      2			)


if __name__ == "__main__":
	import doctest

	doctest.testmod()






# tests directory-specific settings - this file is run automatically
# by pytest before any tests are run

import sys
import warnings
from os.path import abspath, dirname, join


# allow having multiple repository checkouts and not needing to remember to rerun
# 'pip install -e .[dev]' when switching between checkouts and running tests.
_lowerCamelCase       =	abspath(join(dirname(dirname(dirname(__file__))), 'src'))
sys.path.insert(1, git_repo_path)


# silence FutureWarning warnings in tests since often we can't act on them until
# they become normal warnings - i.e. the tests still need to test the current functionality
warnings.simplefilter(action='ignore', category=FutureWarning)






def  SCREAMING_SNAKE_CASE__							(				UpperCamelCase__:							Tuple			):
		from transformers.testing_utils import pytest_addoption_shared

		pytest_addoption_shared(UpperCamelCase__			)






def  SCREAMING_SNAKE_CASE__							(				UpperCamelCase__:							Tuple			):
		from transformers.testing_utils import pytest_terminal_summary_main

		SCREAMING_SNAKE_CASE__								=					terminalreporter.config.getoption("""--make-reports"""			)
		if make_reports:
				pytest_terminal_summary_main(UpperCamelCase__    ,      id=UpperCamelCase__			)