

'''simple docstring'''



import math

import qiskit







def   a__			(    a__ = 1 ,       a__ = 1 ,       a__ = 1		):




     """simple docstring"""


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

     __SCREAMING_SNAKE_CASE      = qiskit.QuantumCircuit(a__ ,       a__		)

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

     __SCREAMING_SNAKE_CASE      = qiskit.Aer.get_backend("""aer_simulator"""		)
     __SCREAMING_SNAKE_CASE      = qiskit.execute(a__ ,       a__ ,       shots=10_00		)

     return job.result().get_counts(a__		)


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









'''simple docstring'''



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


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

UpperCAmelCase					:			Any       =	{
    'uw-madison/mra-base-512-4': 'https://huggingface.co/uw-madison/mra-base-512-4/resolve/main/config.json',
}







class 		lowerCAmelCase__  ( a   ):



 """simple docstring"""



 lowerCAmelCase__       = "mra"
 def __init__(						self   :			Tuple   ,				__SCREAMING_SNAKE_CASE   :			Dict=50_265   ,				__SCREAMING_SNAKE_CASE   :			Union[str, Any]=768   ,				__SCREAMING_SNAKE_CASE   :			int=12   ,				__SCREAMING_SNAKE_CASE   :			List[Any]=12   ,				__SCREAMING_SNAKE_CASE   :			Union[str, Any]=3_072   ,				__SCREAMING_SNAKE_CASE   :			Optional[Any]="gelu"   ,				__SCREAMING_SNAKE_CASE   :			List[str]=0.1   ,				__SCREAMING_SNAKE_CASE   :			List[Any]=0.1   ,				__SCREAMING_SNAKE_CASE   :			List[Any]=512   ,				__SCREAMING_SNAKE_CASE   :			Union[str, Any]=1   ,				__SCREAMING_SNAKE_CASE   :			Any=0.02   ,				__SCREAMING_SNAKE_CASE   :			Optional[Any]=1E-5   ,				__SCREAMING_SNAKE_CASE   :			str="absolute"   ,				__SCREAMING_SNAKE_CASE   :			List[Any]=4   ,				__SCREAMING_SNAKE_CASE   :			Optional[Any]="full"   ,				__SCREAMING_SNAKE_CASE   :			str=0   ,				__SCREAMING_SNAKE_CASE   :			Dict=0   ,				__SCREAMING_SNAKE_CASE   :			Optional[Any]=1   ,				__SCREAMING_SNAKE_CASE   :			Dict=0   ,				__SCREAMING_SNAKE_CASE   :			Dict=2   ,				**__SCREAMING_SNAKE_CASE   :			Optional[int]   ,				)    ->					Tuple:


      """simple docstring"""




      super().__init__(pad_token_id=__SCREAMING_SNAKE_CASE   ,				bos_token_id=__SCREAMING_SNAKE_CASE   ,				eos_token_id=__SCREAMING_SNAKE_CASE   ,				**__SCREAMING_SNAKE_CASE     )

      __SCREAMING_SNAKE_CASE      = vocab_size
      __SCREAMING_SNAKE_CASE      = max_position_embeddings
      __SCREAMING_SNAKE_CASE      = hidden_size
      __SCREAMING_SNAKE_CASE      = num_hidden_layers
      __SCREAMING_SNAKE_CASE      = num_attention_heads
      __SCREAMING_SNAKE_CASE      = intermediate_size
      __SCREAMING_SNAKE_CASE      = hidden_act
      __SCREAMING_SNAKE_CASE      = hidden_dropout_prob
      __SCREAMING_SNAKE_CASE      = attention_probs_dropout_prob
      __SCREAMING_SNAKE_CASE      = initializer_range
      __SCREAMING_SNAKE_CASE      = type_vocab_size
      __SCREAMING_SNAKE_CASE      = layer_norm_eps
      __SCREAMING_SNAKE_CASE      = position_embedding_type
      __SCREAMING_SNAKE_CASE      = block_per_row
      __SCREAMING_SNAKE_CASE      = approx_mode
      __SCREAMING_SNAKE_CASE      = initial_prior_first_n_blocks
      __SCREAMING_SNAKE_CASE      = initial_prior_diagonal_n_blocks






