
import qiskit






def 		_UpperCAmelCase   (	UpperCamelCase:     int			,							UpperCamelCase:     int  ):






	"""simple docstring"""


	__lowerCAmelCase         =							qiskit.Aer.get_backend("aer_simulator"  )

	__lowerCAmelCase         =							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
	__lowerCAmelCase         =							qiskit.execute(UpperCamelCase			,							UpperCamelCase			,							shots=1_0_0_0  )

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


if __name__ == "__main__":
					UpperCamelCase_   	=	half_adder(1, 1)
					print(f'''Half Adder Output Qubit Counts: {counts}''')








import warnings
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


UpperCamelCase_   	=	logging.get_logger(__name__)

UpperCamelCase_   	=	{
    "nvidia/segformer-b0-finetuned-ade-512-512": (
        "https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512/resolve/main/config.json"
    ),
    # See all SegFormer models at https://huggingface.co/models?filter=segformer
}

class       a		(   __UpperCAmelCase					):
							lowercase_		:						Union[str, Any]   							=  'segformer'







							def __init__(						self  :  List[str]      ,				snake_case__  :  Any=3      ,				snake_case__  :  int=4      ,				snake_case__  :  Tuple=[2, 2, 2, 2]      ,				snake_case__  :  Optional[int]=[8, 4, 2, 1]      ,				snake_case__  :  Union[str, Any]=[32, 64, 160, 256]      ,				snake_case__  :  str=[7, 3, 3, 3]      ,				snake_case__  :  List[Any]=[4, 2, 2, 2]      ,				snake_case__  :  Tuple=[1, 2, 5, 8]      ,				snake_case__  :  List[str]=[4, 4, 4, 4]      ,				snake_case__  :  Optional[Any]="gelu"      ,				snake_case__  :  Optional[Any]=0.0      ,				snake_case__  :  Any=0.0      ,				snake_case__  :  str=0.1      ,				snake_case__  :  List[Any]=0.0_2      ,				snake_case__  :  Any=0.1      ,				snake_case__  :  List[Any]=1E-6      ,				snake_case__  :  Any=256      ,				snake_case__  :  Optional[Any]=255      ,				**snake_case__  :  Union[str, Any]      ,				):
								"""simple docstring"""







								super().__init__(**snake_case__ )

								if "reshape_last_stage" in kwargs and kwargs["reshape_last_stage"] is False:
									warnings.warn(
									    "Reshape_last_stage is set to False in this config. This argument is deprecated and will soon be"
									    " removed, as the behaviour will default to that of reshape_last_stage = True."      ,				snake_case__      ,				)

								__lowerCAmelCase         =							num_channels
								__lowerCAmelCase         =							num_encoder_blocks
								__lowerCAmelCase         =							depths
								__lowerCAmelCase         =							sr_ratios
								__lowerCAmelCase         =							hidden_sizes
								__lowerCAmelCase         =							patch_sizes
								__lowerCAmelCase         =							strides
								__lowerCAmelCase         =							mlp_ratios
								__lowerCAmelCase         =							num_attention_heads
								__lowerCAmelCase         =							hidden_act
								__lowerCAmelCase         =							hidden_dropout_prob
								__lowerCAmelCase         =							attention_probs_dropout_prob
								__lowerCAmelCase         =							classifier_dropout_prob
								__lowerCAmelCase         =							initializer_range
								__lowerCAmelCase         =							drop_path_rate
								__lowerCAmelCase         =							layer_norm_eps
								__lowerCAmelCase         =							decoder_hidden_size
								__lowerCAmelCase         =							kwargs.get("reshape_last_stage"      ,				snake_case__ )
								__lowerCAmelCase         =							semantic_loss_ignore_index

class       a		(   __UpperCAmelCase					):
							lowercase_		:						List[str]   							=  version.parse('1.11'					)







							@property
							def       UpperCAmelCase__					(						self  :  Any ):
								"""simple docstring"""







								return OrderedDict(
								    [
								        ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
								    ] )







							@property
							def       UpperCAmelCase__					(						self  :  Union[str, Any] ):
								"""simple docstring"""







								return 1E-4







							@property
							def       UpperCAmelCase__					(						self  :  Optional[Any] ):
								"""simple docstring"""







								return 12






