


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


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

_UpperCAmelCase			:  Dict     ={
    """tanreinama/GPTSAN-2.8B-spout_is_uniform""": (
        """https://huggingface.co/tanreinama/GPTSAN-2.8B-spout_is_uniform/resolve/main/config.json"""
    ),
}







class 				snake_case__(							UpperCAmelCase__							):







						'''simple docstring'''




						SCREAMING_SNAKE_CASE__      :  Any					=							"""gptsan-japanese"""
						SCREAMING_SNAKE_CASE__      :  str					=							[
						    """past_key_values""",
						]
						SCREAMING_SNAKE_CASE__      :  str					=							{
						    """hidden_size""": """d_model""",
						    """num_attention_heads""": """num_heads""",
						    """num_hidden_layers""": """num_layers""",
						}




						def __init__(				self   ,						__lowercase=3_6_0_0_0   ,						__lowercase=1_2_8_0   ,						__lowercase=1_0_2_4   ,						__lowercase=8_1_9_2   ,						__lowercase=4_0_9_6   ,						__lowercase=1_2_8   ,						__lowercase=1_0   ,						__lowercase=0   ,						__lowercase=1_6   ,						__lowercase=1_6   ,						__lowercase=1_2_8   ,						__lowercase=0.0   ,						__lowercase=1e-5   ,						__lowercase=False   ,						__lowercase=0.0   ,						__lowercase="float32"   ,						__lowercase=False   ,						__lowercase=False   ,						__lowercase=False   ,						__lowercase=0.0_02   ,						__lowercase=False   ,						__lowercase=True   ,						__lowercase=3_5_9_9_8   ,						__lowercase=3_5_9_9_5   ,						__lowercase=3_5_9_9_9   ,						**__lowercase   ,						)					->    Tuple:
										lowerCAmelCase_ :      str    				=				vocab_size
										lowerCAmelCase_ :      str    				=				max_position_embeddings
										lowerCAmelCase_ :      Optional[int]    				=				d_model
										lowerCAmelCase_ :      Any    				=				d_ff
										lowerCAmelCase_ :      Tuple    				=				d_ext
										lowerCAmelCase_ :      List[str]    				=				d_spout
										lowerCAmelCase_ :      Optional[Any]    				=				num_switch_layers
										lowerCAmelCase_ :      Tuple    				=				num_ext_layers
										lowerCAmelCase_ :      List[Any]    				=				num_switch_layers + num_ext_layers
										lowerCAmelCase_ :      int    				=				num_heads
										lowerCAmelCase_ :      str    				=				num_experts
										lowerCAmelCase_ :      Optional[int]    				=				expert_capacity
										lowerCAmelCase_ :      int    				=				dropout_rate
										lowerCAmelCase_ :      Any    				=				layer_norm_epsilon
										lowerCAmelCase_ :      Dict    				=				router_bias
										lowerCAmelCase_ :      Optional[int]    				=				router_jitter_noise
										lowerCAmelCase_ :      Tuple    				=				router_dtype
										lowerCAmelCase_ :      Union[str, Any]    				=				router_ignore_padding_tokens
										lowerCAmelCase_ :      Tuple    				=				output_hidden_states
										lowerCAmelCase_ :      Optional[int]    				=				output_attentions
										lowerCAmelCase_ :      int    				=				initializer_factor
										lowerCAmelCase_ :      Any    				=				output_router_logits
										lowerCAmelCase_ :      int    				=				use_cache

										super().__init__(
										    separator_token_id=__lowercase   ,						pad_token_id=__lowercase   ,						eos_token_id=__lowercase   ,						**__lowercase   ,						)



import math

import qiskit



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

				lowerCAmelCase_ :      int    				=				qiskit.QuantumCircuit(lowerCAmelCase_ ,   lowerCAmelCase_ )

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

				lowerCAmelCase_ :      Tuple    				=				qiskit.Aer.get_backend('''aer_simulator''' )
				lowerCAmelCase_ :      Union[str, Any]    				=				qiskit.execute(lowerCAmelCase_ ,   lowerCAmelCase_ ,   shots=1_000 )

				return job.result().get_counts(lowerCAmelCase_ )


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