import math

import qiskit
def 		snake_case__	(		lowercase = 1							,				lowercase = 1							,				lowercase = 1					):
   if (
       isinstance(lowercase							,				lowercase					)
       or isinstance(lowercase							,				lowercase					)
       or isinstance(lowercase							,				lowercase					)
   ):
      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(lowercase					) != input_a)
       or (math.floor(lowercase					) != input_a)
       or (math.floor(lowercase					) != 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
   lowerCAmelCase_:							List[Any]       =	qiskit.QuantumRegister(4							,				"qr"					)
   lowerCAmelCase_:							List[str]       =	qiskit.ClassicalRegister(2							,				"cr"					)
   # list the entries
   lowerCAmelCase_:							List[str]       =	[input_a, input_a, carry_in]

   lowerCAmelCase_:							Union[str, Any]       =	qiskit.QuantumCircuit(lowercase							,				lowercase					)

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

   lowerCAmelCase_:							List[str]       =	qiskit.Aer.get_backend("aer_simulator"					)
   lowerCAmelCase_:							Optional[int]       =	qiskit.execute(lowercase							,				lowercase							,				shots=1000					)

   return job.result().get_counts(lowercase					)


if __name__ == "__main__":
 print(f'''Total sum count for state is: {quantum_full_adder(1, 1, 1)}''')
from ...configuration_utils import PretrainedConfig
from ...utils import logging


a  :      List[Any]            =    logging.get_logger(__name__)

a  :      Any            =    {"""openai-gpt""": """https://huggingface.co/openai-gpt/resolve/main/config.json"""}

class 					_lowercase    (     UpperCAmelCase__			):






    '''simple docstring'''
    SCREAMING_SNAKE_CASE:				int          =    'openai-gpt'
    SCREAMING_SNAKE_CASE:				List[str]          =    {
        'max_position_embeddings': 'n_positions',
        'hidden_size': 'n_embd',
        'num_attention_heads': 'n_head',
        'num_hidden_layers': 'n_layer',
    }




    def __init__(    self       ,						lowerCamelCase__=40_478       ,						lowerCamelCase__=512       ,						lowerCamelCase__=768       ,						lowerCamelCase__=12       ,						lowerCamelCase__=12       ,						lowerCamelCase__="gelu"       ,						lowerCamelCase__=0.1       ,						lowerCamelCase__=0.1       ,						lowerCamelCase__=0.1       ,						lowerCamelCase__=1E-5       ,						lowerCamelCase__=0.0_2       ,						lowerCamelCase__="cls_index"       ,						lowerCamelCase__=True       ,						lowerCamelCase__=None       ,						lowerCamelCase__=True       ,						lowerCamelCase__=0.1       ,						**lowerCamelCase__       ,						):
       lowerCAmelCase_:							Union[str, Any]       =	vocab_size
       lowerCAmelCase_:							List[Any]       =	n_positions
       lowerCAmelCase_:							Tuple       =	n_embd
       lowerCAmelCase_:							Optional[int]       =	n_layer
       lowerCAmelCase_:							Optional[int]       =	n_head
       lowerCAmelCase_:							int       =	afn
       lowerCAmelCase_:							str       =	resid_pdrop
       lowerCAmelCase_:							Optional[int]       =	embd_pdrop
       lowerCAmelCase_:							Optional[int]       =	attn_pdrop
       lowerCAmelCase_:							Dict       =	layer_norm_epsilon
       lowerCAmelCase_:							List[Any]       =	initializer_range
       lowerCAmelCase_:							Union[str, Any]       =	summary_type
       lowerCAmelCase_:							Any       =	summary_use_proj
       lowerCAmelCase_:							Dict       =	summary_activation
       lowerCAmelCase_:							Dict       =	summary_first_dropout
       lowerCAmelCase_:							List[Any]       =	summary_proj_to_labels
       super().__init__(**lowerCamelCase__ )