


import math

import qiskit





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


						'''simple docstring'''






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

						__snake_case				=		qiskit.QuantumCircuit(_lowerCAmelCase      ,	_lowerCAmelCase )

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

						__snake_case				=		qiskit.Aer.get_backend("aer_simulator" )
						__snake_case				=		qiskit.execute(_lowerCAmelCase      ,	_lowerCAmelCase      ,	shots=1000 )

						return job.result().get_counts(_lowerCAmelCase )


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









import warnings

from ...utils import logging
from .image_processing_beit import BeitImageProcessor


A							:					Any     						=     logging.get_logger(__name__)






class     UpperCamelCase(  _a   ):


					def __init__(						self	:		Optional[int]     ,    *SCREAMING_SNAKE_CASE	:		Tuple     ,    **SCREAMING_SNAKE_CASE	:		List[Any]						)			->	None:




											'''simple docstring'''

											warnings.warn(
											    "The class BeitFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please"
											    " use BeitImageProcessor instead."     ,    SCREAMING_SNAKE_CASE     ,    )
											super().__init__(*SCREAMING_SNAKE_CASE     ,    **SCREAMING_SNAKE_CASE						)





