


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


__lowerCAmelCase			=							logging.get_logger(__name__)

__lowerCAmelCase			=							{
    '''s-JoL/Open-Llama-V1''': '''https://huggingface.co/s-JoL/Open-Llama-V1/blob/main/config.json''',
}





class   __a      (   __UpperCamelCase				):
 __lowercase			:							Any       					=			'open-llama'
 def __init__(       self    ,			lowerCAmelCase__=100_000    ,			lowerCAmelCase__=4_096    ,			lowerCAmelCase__=11_008    ,			lowerCAmelCase__=32    ,			lowerCAmelCase__=32    ,			lowerCAmelCase__="silu"    ,			lowerCAmelCase__=2_048    ,			lowerCAmelCase__=0.0_2    ,			lowerCAmelCase__=1E-6    ,			lowerCAmelCase__=True    ,			lowerCAmelCase__=0    ,			lowerCAmelCase__=1    ,			lowerCAmelCase__=2    ,			lowerCAmelCase__=False    ,			lowerCAmelCase__=True    ,			lowerCAmelCase__=0.1    ,			lowerCAmelCase__=0.1    ,			lowerCAmelCase__=True    ,			lowerCAmelCase__=True    ,			lowerCAmelCase__=None    ,			**lowerCAmelCase__    ,			) ->    Optional[Any]:




        '''simple docstring'''
        lowercase__:       str        =       vocab_size
        lowercase__:       Optional[Any]        =       max_position_embeddings
        lowercase__:       str        =       hidden_size
        lowercase__:       Any        =       intermediate_size
        lowercase__:       List[str]        =       num_hidden_layers
        lowercase__:       List[Any]        =       num_attention_heads
        lowercase__:       Dict        =       hidden_act
        lowercase__:       Optional[int]        =       initializer_range
        lowercase__:       Dict        =       rms_norm_eps
        lowercase__:       Any        =       use_cache
        lowercase__:       Optional[Any]        =       kwargs.pop(
            'use_memorry_efficient_attention'    ,			lowerCAmelCase__			)
        lowercase__:       int        =       hidden_dropout_prob
        lowercase__:       List[str]        =       attention_dropout_prob
        lowercase__:       int        =       use_stable_embedding
        lowercase__:       Optional[Any]        =       shared_input_output_embedding
        lowercase__:       Optional[int]        =       rope_scaling
        self._rope_scaling_validation()

        super().__init__(
            pad_token_id=lowerCAmelCase__    ,			bos_token_id=lowerCAmelCase__    ,			eos_token_id=lowerCAmelCase__    ,			tie_word_embeddings=lowerCAmelCase__    ,			**lowerCAmelCase__    ,			)
 def 		SCREAMING_SNAKE_CASE__       (       self			) ->    List[Any]:




        '''simple docstring'''
        if self.rope_scaling is None:
               return

        if not isinstance(self.rope_scaling    ,			lowerCAmelCase__			) 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}'			)
        lowercase__:       str        =       self.rope_scaling.get('type'    ,			lowerCAmelCase__			)
        lowercase__:       Union[str, Any]        =       self.rope_scaling.get('factor'    ,			lowerCAmelCase__			)
        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(lowerCAmelCase__    ,			lowerCAmelCase__			) or rope_scaling_factor <= 1.0:
               raise ValueError(F'`rope_scaling`\'s factor field must be an float > 1, got {rope_scaling_factor}'			)






import math

import numpy as np
import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute




def        snake_case_					(  snake_case = 3					)  ->    qiskit.result.counts.Counts:
       if isinstance(snake_case      ,							snake_case					):
              raise TypeError('number of qubits must be a integer.'					)
       if number_of_qubits <= 0:
              raise ValueError('number of qubits must be > 0.'					)
       if math.floor(snake_case					) != number_of_qubits:
              raise ValueError('number of qubits must be exact integer.'					)
       if number_of_qubits > 10:
              raise ValueError('number of qubits too large to simulate(>10).'					)

       lowercase__:       str        =       QuantumRegister(snake_case      ,							'qr'					)
       lowercase__:       str        =       ClassicalRegister(snake_case      ,							'cr'					)

       lowercase__:       List[Any]        =       QuantumCircuit(snake_case      ,							snake_case					)

       lowercase__:       int        =       number_of_qubits

       for i in range(snake_case					):
              quantum_circuit.h(number_of_qubits - i - 1					)
              counter -= 1
              for j in range(snake_case					):
                     quantum_circuit.cp(np.pi / 2 ** (counter - j)      ,							snake_case      ,							snake_case					)

       for k in range(number_of_qubits // 2					):
              quantum_circuit.swap(snake_case      ,							number_of_qubits - k - 1					)

       # measure all the qubits
       quantum_circuit.measure(snake_case      ,							snake_case					)
       # simulate with 10000 shots
       lowercase__:       str        =       Aer.get_backend('qasm_simulator'					)
       lowercase__:       Union[str, Any]        =       execute(snake_case      ,							snake_case      ,							shots=1_00_00					)

       return job.result().get_counts(snake_case					)


if __name__ == "__main__":
 print(
     F'''Total count for quantum fourier transform state is: \
    {quantum_fourier_transform(3)}'''
 )


