





'''simple docstring'''




import warnings

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


lowercase__    :      Optional[Any]						=    logging.get_logger(__name__)

lowercase__    :      List[str]						=    {
    '''xlnet-base-cased''': '''https://huggingface.co/xlnet-base-cased/resolve/main/config.json''',
    '''xlnet-large-cased''': '''https://huggingface.co/xlnet-large-cased/resolve/main/config.json''',
}


class  SCREAMING_SNAKE_CASE    (a__							):
     lowerCAmelCase					=       '''xlnet'''
     lowerCAmelCase					=       ['''mems''']
     lowerCAmelCase					=       {
         '''n_token''': '''vocab_size''',  # Backward compatibility
         '''hidden_size''': '''d_model''',
         '''num_attention_heads''': '''n_head''',
         '''num_hidden_layers''': '''n_layer''',
     }


     def __init__(						self						,	_UpperCAmelCase=3_2000						,	_UpperCAmelCase=1024						,	_UpperCAmelCase=24						,	_UpperCAmelCase=16						,	_UpperCAmelCase=4096						,	_UpperCAmelCase="gelu"						,	_UpperCAmelCase=True						,	_UpperCAmelCase="bi"						,	_UpperCAmelCase=0.02						,	_UpperCAmelCase=1e-1_2						,	_UpperCAmelCase=0.1						,	_UpperCAmelCase=512						,	_UpperCAmelCase=None						,	_UpperCAmelCase=True						,	_UpperCAmelCase=False						,	_UpperCAmelCase=False						,	_UpperCAmelCase=-1						,	_UpperCAmelCase=False						,	_UpperCAmelCase="last"						,	_UpperCAmelCase=True						,	_UpperCAmelCase="tanh"						,	_UpperCAmelCase=0.1						,	_UpperCAmelCase=5						,	_UpperCAmelCase=5						,	_UpperCAmelCase=5						,	_UpperCAmelCase=1						,	_UpperCAmelCase=2						,	**_UpperCAmelCase						,	):

          '''simple docstring'''






          __A						: Optional[int]      =       vocab_size
          __A						: int      =       d_model
          __A						: Union[str, Any]      =       n_layer
          __A						: List[Any]      =       n_head
          if d_model % n_head != 0:
               raise ValueError(F'\'d_model % n_head\' ({d_model % n_head}) should be equal to 0')
          if "d_head" in kwargs:
               if kwargs["d_head"] != d_model // n_head:
                    raise ValueError(
                        F'`d_head` ({kwargs["d_head"]}) should be equal to `d_model // n_head` ({d_model // n_head})')
          __A						: str      =       d_model // n_head
          __A						: Union[str, Any]      =       ff_activation
          __A						: Union[str, Any]      =       d_inner
          __A						: List[str]      =       untie_r
          __A						: Optional[int]      =       attn_type

          __A						: List[str]      =       initializer_range
          __A						: Dict      =       layer_norm_eps

          __A						: Dict      =       dropout
          __A						: Union[str, Any]      =       mem_len
          __A						: Union[str, Any]      =       reuse_len
          __A						: Union[str, Any]      =       bi_data
          __A						: Dict      =       clamp_len
          __A						: List[str]      =       same_length

          __A						: Tuple      =       summary_type
          __A						: Any      =       summary_use_proj
          __A						: Union[str, Any]      =       summary_activation
          __A						: List[Any]      =       summary_last_dropout
          __A						: int      =       start_n_top
          __A						: str      =       end_n_top

          __A						: Union[str, Any]      =       bos_token_id
          __A						: Dict      =       pad_token_id
          __A						: Optional[int]      =       eos_token_id

          if "use_cache" in kwargs:
               warnings.warn(
                   'The `use_cache` argument is deprecated and will be removed in a future version, use `use_mems_eval`'
                   ' instead.'						,	_UpperCAmelCase						,	)
               __A						: str      =       kwargs['use_cache']

          __A						: Any      =       use_mems_eval
          __A						: Optional[int]      =       use_mems_train
          super().__init__(pad_token_id=_UpperCAmelCase						,	bos_token_id=_UpperCAmelCase						,	eos_token_id=_UpperCAmelCase						,	**_UpperCAmelCase)


     @property
     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          logger.info(F'The model {self.model_type} is one of the few models that has no sequence length limit.')
          return -1


     @max_position_embeddings.setter
     def 							SCREAMING_SNAKE_CASE  (						self						,	_UpperCAmelCase):

          '''simple docstring'''






          raise NotImplementedError(
              F'The model {self.model_type} is one of the few models that has no sequence length limit.')






'''simple docstring'''




import math

import qiskit






def        _lowerCAmelCase			(  __snake_case  : int = 1 ,							__snake_case  : int = 1 ,							__snake_case  : int = 1			)     ->     qiskit.result.counts.Counts:
     if (
         isinstance(__snake_case ,							__snake_case			)
         or isinstance(__snake_case ,							__snake_case			)
         or isinstance(__snake_case ,							__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(__snake_case			) != input_a)
         or (math.floor(__snake_case			) != input_a)
         or (math.floor(__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
     __A						: int      =       qiskit.QuantumRegister(4 ,							'qr'			)
     __A						: Optional[int]      =       qiskit.ClassicalRegister(2 ,							'cr'			)
     # list the entries
     __A						: Union[str, Any]      =       [input_a, input_a, carry_in]

     __A						: Dict      =       qiskit.QuantumCircuit(__snake_case ,							__snake_case			)

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

     __A						: str      =       qiskit.Aer.get_backend('aer_simulator'			)
     __A						: Any      =       qiskit.execute(__snake_case ,							__snake_case ,							shots=10_00			)

     return job.result().get_counts(__snake_case			)


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