import math

import qiskit



def lowerCamelCase  (   SCREAMING_SNAKE_CASE = 1  ,			SCREAMING_SNAKE_CASE = 1  ,			SCREAMING_SNAKE_CASE = 1	):
    '''simple docstring'''







    if (
        isinstance(SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE	)
        or isinstance(SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE	)
        or isinstance(SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE	)
    ):
        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(SCREAMING_SNAKE_CASE	) != input_a)
        or (math.floor(SCREAMING_SNAKE_CASE	) != input_a)
        or (math.floor(SCREAMING_SNAKE_CASE	) != 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
    __UpperCamelCase     :List[str]			  =		qiskit.QuantumRegister(4  ,			'''qr'''	)
    __UpperCamelCase     :str			  =		qiskit.ClassicalRegister(2  ,			'''cr'''	)
    # list the entries
    __UpperCamelCase     :Tuple			  =		[input_a, input_a, carry_in]

    __UpperCamelCase     :Optional[int]			  =		qiskit.QuantumCircuit(SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE	)

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

    __UpperCamelCase     :Optional[Any]			  =		qiskit.Aer.get_backend('''aer_simulator'''	)
    __UpperCamelCase     :Tuple			  =		qiskit.execute(SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE  ,			shots=1_000	)

    return job.result().get_counts(SCREAMING_SNAKE_CASE	)


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













import warnings

from ...configuration_utils import PretrainedConfig
from ...utils import logging


a		:       Tuple			     = logging.get_logger(__name__)

a		:       Optional[Any]			     = {
    "RUCAIBox/mvp": "https://huggingface.co/RUCAIBox/mvp/resolve/main/config.json",
}
class     a    ( lowercase__   ):



      """simple docstring"""


      a  : str							       =	'mvp'
      a  : Optional[Any]							       =	['past_key_values']
      a  : int							       =	{'num_attention_heads': 'encoder_attention_heads', 'hidden_size': 'd_model'}
      def __init__(      self					:			Dict		,      __lowercase					:			Tuple=50267		,      __lowercase					:			Optional[int]=1024		,      __lowercase					:			Any=12		,      __lowercase					:			List[Any]=4096		,      __lowercase					:			Optional[Any]=16		,      __lowercase					:			List[str]=12		,      __lowercase					:			Optional[Any]=4096		,      __lowercase					:			Tuple=16		,      __lowercase					:			Union[str, Any]=0.0		,      __lowercase					:			str=0.0		,      __lowercase					:			Any="gelu"		,      __lowercase					:			Any=1024		,      __lowercase					:			List[str]=0.1		,      __lowercase					:			List[Any]=0.0		,      __lowercase					:			int=0.0		,      __lowercase					:			str=0.02		,      __lowercase					:			Tuple=0.0		,      __lowercase					:			Union[str, Any]=False		,      __lowercase					:			Dict=True		,      __lowercase					:			List[Any]=1		,      __lowercase					:			Optional[Any]=0		,      __lowercase					:			Union[str, Any]=2		,      __lowercase					:			Optional[int]=True		,      __lowercase					:			Dict=2		,      __lowercase					:			int=2		,      __lowercase					:			Union[str, Any]=False		,      __lowercase					:			Union[str, Any]=100		,      __lowercase					:			str=800		,      **__lowercase					:			Union[str, Any]		,      )							->      Any:
        __UpperCAmelCase							:	List[str]           =  vocab_size
        __UpperCAmelCase							:	Union[str, Any]           =  max_position_embeddings
        __UpperCAmelCase							:	Optional[Any]           =  d_model
        __UpperCAmelCase							:	int           =  encoder_ffn_dim
        __UpperCAmelCase							:	Tuple           =  encoder_layers
        __UpperCAmelCase							:	List[str]           =  encoder_attention_heads
        __UpperCAmelCase							:	Any           =  decoder_ffn_dim
        __UpperCAmelCase							:	List[Any]           =  decoder_layers
        __UpperCAmelCase							:	str           =  decoder_attention_heads
        __UpperCAmelCase							:	Optional[int]           =  dropout
        __UpperCAmelCase							:	Tuple           =  attention_dropout
        __UpperCAmelCase							:	int           =  activation_dropout
        __UpperCAmelCase							:	List[Any]           =  activation_function
        __UpperCAmelCase							:	Tuple           =  init_std
        __UpperCAmelCase							:	Any           =  encoder_layerdrop
        __UpperCAmelCase							:	Union[str, Any]           =  decoder_layerdrop
        __UpperCAmelCase							:	List[Any]           =  classifier_dropout
        __UpperCAmelCase							:	Optional[int]           =  use_cache
        __UpperCAmelCase							:	int           =  encoder_layers
        __UpperCAmelCase							:	Union[str, Any]           =  scale_embedding  # scale factor will be sqrt(d_model) if True
        __UpperCAmelCase							:	Tuple           =  use_prompt
        __UpperCAmelCase							:	str           =  prompt_length
        __UpperCAmelCase							:	Union[str, Any]           =  prompt_mid_dim

        super().__init__(
            pad_token_id=__lowercase		,      bos_token_id=__lowercase		,      eos_token_id=__lowercase		,      is_encoder_decoder=__lowercase		,      decoder_start_token_id=__lowercase		,      forced_eos_token_id=__lowercase		,      **__lowercase		,      )

        if self.forced_bos_token_id is None and kwargs.get("""force_bos_token_to_be_generated"""		,      __lowercase					):
          __UpperCAmelCase							:	Optional[Any]           =  self.bos_token_id
          warnings.warn(
              f"""Please make sure the config includes `forced_bos_token_id={self.bos_token_id}` in future versions. """
              """The config can simply be saved and uploaded again to be fixed."""					)


