
import qiskit



def   __SCREAMING_SNAKE_CASE (		SCREAMING_SNAKE_CASE ,    SCREAMING_SNAKE_CASE )		-> Dict:
		SCREAMING_SNAKE_CASE_					:	Tuple		  =			qiskit.Aer.get_backend('aer_simulator' )

		SCREAMING_SNAKE_CASE_					:	Union[str, Any]		  =			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
		SCREAMING_SNAKE_CASE_					:	Dict		  =			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__":
		lowerCAmelCase__:    List[str]      = half_adder(1, 1)
		print(f'''Half Adder Output Qubit Counts: {counts}''')









from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


_UpperCAmelCase						:  Union[str, Any]									=			logging.get_logger(__name__)

_UpperCAmelCase						:  Dict									=			{
    """microsoft/resnet-50""": """https://huggingface.co/microsoft/resnet-50/blob/main/config.json""",
}







class 					lowercase							(			lowercase_      ,    lowercase_     ):
				__SCREAMING_SNAKE_CASE   :					List[str]			     =     '''resnet'''
				__SCREAMING_SNAKE_CASE   :					Dict			     =     ['''basic''', '''bottleneck''']




				def __init__(   self ,  snake_case=3 ,  snake_case=64 ,  snake_case=[256, 512, 1024, 2048] ,  snake_case=[3, 4, 6, 3] ,  snake_case="bottleneck" ,  snake_case="relu" ,  snake_case=False ,  snake_case=None ,  snake_case=None ,  **snake_case ,  ):
											super().__init__(**snake_case			)
											if layer_type not in self.layer_types:
																		raise ValueError(F'''layer_type={layer_type} is not one of {",".join(self.layer_types			)}'''			)
											snake_case_     							=       num_channels
											snake_case_     							=       embedding_size
											snake_case_     							=       hidden_sizes
											snake_case_     							=       depths
											snake_case_     							=       layer_type
											snake_case_     							=       hidden_act
											snake_case_     							=       downsample_in_first_stage
											snake_case_     							=       ['stem'] + [F'''stage{idx}''' for idx in range(1 ,  len(snake_case			) + 1			)]
											snake_case_							,       snake_case_     							=       get_aligned_output_features_output_indices(
											    out_features=snake_case ,  out_indices=snake_case ,  stage_names=self.stage_names			)







class 					lowercase							(			lowercase_     ):
				__SCREAMING_SNAKE_CASE   :					List[Any]			     =     version.parse('''1.11'''     )




				@property
				def        a				(   self			):
											return OrderedDict(
											    [
											        ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
											    ]			)




				@property
				def        a				(   self			):
											return 1e-3




