


"""simple docstring"""







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


lowerCamelCase_   :   Dict									=  logging.get_logger(__name__)

lowerCamelCase_   :   Any									=  {
    """EleutherAI/gpt-neox-20b""": """https://huggingface.co/EleutherAI/gpt-neox-20b/resolve/main/config.json""",
    # See all GPTNeoX models at https://huggingface.co/models?filter=gpt_neox
}






class       __A				(       __UpperCamelCase			):






 """simple docstring"""




 __lowerCAmelCase 					=  "gpt_neox"


 def __init__(		self ,    __A=5_0432 ,    __A=6144 ,    __A=44 ,    __A=64 ,    __A=2_4576 ,    __A="gelu" ,    __A=0.25 ,    __A=1_0000 ,    __A=0.0 ,    __A=0.0 ,    __A=0.1 ,    __A=2048 ,    __A=0.02 ,    __A=1E-5 ,    __A=True ,    __A=0 ,    __A=2 ,    __A=False ,    __A=True ,    __A=None ,    **__A ,    )					->     Optional[Any]:
     super().__init__(bos_token_id=a_ ,    eos_token_id=a_ ,    **a_						)
     a 		=vocab_size
     a 		=max_position_embeddings
     a 		=hidden_size
     a 		=num_hidden_layers
     a 		=num_attention_heads
     a 		=intermediate_size
     a 		=hidden_act
     a 		=rotary_pct
     a 		=rotary_emb_base
     a 		=attention_dropout
     a 		=hidden_dropout
     a 		=classifier_dropout
     a 		=initializer_range
     a 		=layer_norm_eps
     a 		=use_cache
     a 		=tie_word_embeddings
     a 		=use_parallel_residual
     a 		=rope_scaling
     self._rope_scaling_validation()

     if self.hidden_size % self.num_attention_heads != 0:
         raise ValueError(
             '''The hidden size is not divisble by the number of attention heads! Make sure to update them!'''						)





 def       SCREAMING_SNAKE_CASE							(		self						)					->     List[Any]:





     if self.rope_scaling is None:
         return

     if not isinstance(self.rope_scaling ,    a_						) or len(self.rope_scaling						) != 2:
         raise ValueError(
             '''`rope_scaling` must be a dictionary with with two fields, `name` and `factor`, '''
             f'''got {self.rope_scaling}'''						)
     a 		=self.rope_scaling.get('''type''' ,    a_						)
     a 		=self.rope_scaling.get('''factor''' ,    a_						)
     if rope_scaling_type is None or rope_scaling_type not in ["linear", "dynamic"]:
         raise ValueError(
             f'''`rope_scaling`\'s name field must be one of [\'linear\', \'dynamic\'], got {rope_scaling_type}'''						)
     if rope_scaling_factor is None or not isinstance(a_ ,    a_						) or rope_scaling_factor <= 1.0:
         raise ValueError(f'''`rope_scaling`\'s factor field must be an float > 1, got {rope_scaling_factor}'''						)




import qiskit

def        a						(      _UpperCAmelCase							:					int ,   _UpperCAmelCase							:					int						):







		'''simple docstring'''





		__UpperCAmelCase    :     List[str]													=	qiskit.Aer.get_backend('''aer_simulator'''						)

		__UpperCAmelCase    :     Optional[Any]													=	qiskit.QuantumCircuit(4 ,   2						)
		# encode inputs in qubits 0 and 1
		if bita == 1:
				qc_ha.x(0						)
		if bita == 1:
				qc_ha.x(1						)
		qc_ha.barrier()

		# use cnots to write XOR of the inputs on qubit2
		qc_ha.cx(0 ,   2						)
		qc_ha.cx(1 ,   2						)

		# use ccx / toffoli gate to write AND of the inputs on qubit3
		qc_ha.ccx(0 ,   1 ,   3						)
		qc_ha.barrier()

		# extract outputs
		qc_ha.measure(2 ,   0						)  # extract XOR value
		qc_ha.measure(3 ,   1						)  # extract AND value

		# Execute the circuit on the qasm simulator
		__UpperCAmelCase    :     str													=	qiskit.execute(_UpperCAmelCase ,   _UpperCAmelCase ,   shots=10_00						)

		# Return the histogram data of the results of the experiment
		return job.result().get_counts(_UpperCAmelCase						)


if __name__ == "__main__":
				__A   			=half_adder(1, 1)
				print(f'''Half Adder Output Qubit Counts: {counts}''')





