




"""simple docstring"""

import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig


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

UpperCamelCase__			:     Union[str, Any]			       =				{
    'facebook/musicgen-small': 'https://huggingface.co/facebook/musicgen-small/resolve/main/config.json',
    # See all Musicgen models at https://huggingface.co/models?filter=musicgen
}
class      A__   (   __snake_case  ):
	A_				:					Dict      =   """musicgen_decoder"""
	A_				:					List[str]      =   ["""past_key_values"""]




	def __init__( self	:						Optional[Any]   ,     lowercase	:						Union[str, Any]=2_048   ,     lowercase	:						int=2_048   ,     lowercase	:						int=24   ,     lowercase	:						Any=4_096   ,     lowercase	:						int=16   ,     lowercase	:						Tuple=0.0   ,     lowercase	:						str=True   ,     lowercase	:						Tuple="gelu"   ,     lowercase	:						int=1_024   ,     lowercase	:						Any=0.1   ,     lowercase	:						Union[str, Any]=0.0   ,     lowercase	:						int=0.0   ,     lowercase	:						Optional[Any]=0.02   ,     lowercase	:						str=False   ,     lowercase	:						Tuple=4   ,     lowercase	:						int=2_048   ,     lowercase	:						List[Any]=2_048   ,     lowercase	:						List[Any]=None   ,     lowercase	:						Any=False   ,     **lowercase	:						Any   ,     )       ->			Any:
						__snake_case        =						vocab_size
						__snake_case        =						max_position_embeddings
						__snake_case        =						hidden_size
						__snake_case        =						ffn_dim
						__snake_case        =						num_hidden_layers
						__snake_case        =						num_attention_heads
						__snake_case        =						dropout
						__snake_case        =						attention_dropout
						__snake_case        =						activation_dropout
						__snake_case        =						activation_function
						__snake_case        =						initializer_factor
						__snake_case        =						layerdrop
						__snake_case        =						use_cache
						__snake_case        =						scale_embedding  # scale factor will be sqrt(d_model) if True
						__snake_case        =						num_codebooks
						super().__init__(
						    pad_token_id=__UpperCamelCase   ,     bos_token_id=__UpperCamelCase   ,     eos_token_id=__UpperCamelCase   ,     tie_word_embeddings=__UpperCamelCase   ,     **__UpperCamelCase   ,     )

class      A__   (   __snake_case  ):
	A_				:					Optional[int]      =   """musicgen"""
	A_				:					Union[str, Any]      =   True




	def __init__( self	:						int   ,     **lowercase	:						Any						)       ->			Optional[int]:
						super().__init__(**__UpperCamelCase						)
						if "text_encoder" not in kwargs or "audio_encoder" not in kwargs or "decoder" not in kwargs:
											raise ValueError("""Config has to be initialized with text_encoder, audio_encoder and decoder config"""						)

						__snake_case        =						kwargs.pop("""text_encoder"""						)
						__snake_case        =						text_encoder_config.pop("""model_type"""						)

						__snake_case        =						kwargs.pop("""audio_encoder"""						)
						__snake_case        =						audio_encoder_config.pop("""model_type"""						)

						__snake_case        =						kwargs.pop("""decoder"""						)

						__snake_case        =						AutoConfig.for_model(__UpperCamelCase   ,     **__UpperCamelCase						)
						__snake_case        =						AutoConfig.for_model(__UpperCamelCase   ,     **__UpperCamelCase						)
						__snake_case        =						MusicgenDecoderConfig(**__UpperCamelCase						)
						__snake_case        =						True




	@classmethod
	def 				a_		( cls	:						Any   ,     lowercase	:						Union[str, Any]   ,     lowercase	:						Any   ,     lowercase	:						Optional[Any]   ,     **lowercase	:						Tuple   ,     )       ->			Optional[Any]:
						return cls(
						    text_encoder=text_encoder_config.to_dict()   ,     audio_encoder=audio_encoder_config.to_dict()   ,     decoder=decoder_config.to_dict()   ,     **__UpperCamelCase   ,     )




	def 				a_		( self	:						Tuple						)       ->			Optional[Any]:
						__snake_case        =						copy.deepcopy(self.__dict__						)
						__snake_case        =						self.text_encoder.to_dict()
						__snake_case        =						self.audio_encoder.to_dict()
						__snake_case        =						self.decoder.to_dict()
						__snake_case        =						self.__class__.model_type
						return output




import math

import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute





def        lowerCAmelCase       (				snake_case__   :      int = 1				,					snake_case__   :      int = 1 )->			qiskit.result.counts.Counts:
    if isinstance(snake_case__				,					snake_case__ ) or isinstance(snake_case__				,					snake_case__ ):
        raise TypeError("inputs must be integers." )
    if (bit_a < 0) or (bit_a < 0):
        raise ValueError("inputs must be positive." )
    if (math.floor(snake_case__ ) != bit_a) or (math.floor(snake_case__ ) != bit_a):
        raise ValueError("inputs must be exact integers." )
    if (bit_a > 1) or (bit_a > 1):
        raise ValueError("inputs must be less or equal to 1." )

    # build registers
    A_								=					QuantumRegister(2				,					"qr" )
    A_								=					ClassicalRegister(2				,					"cr" )

    A_								=					QuantumCircuit(snake_case__				,					snake_case__ )

    # entanglement the qubits
    quantum_circuit.h(1 )
    quantum_circuit.cx(1				,					0 )

    # send the information
    A_								=					str(snake_case__ ) + str(snake_case__ )

    if c_information == "11":
        quantum_circuit.x(1 )
        quantum_circuit.z(1 )
    elif c_information == "10":
        quantum_circuit.z(1 )
    elif c_information == "01":
        quantum_circuit.x(1 )
    else:
        quantum_circuit.i(1 )

    # unentangled the circuit
    quantum_circuit.cx(1				,					0 )
    quantum_circuit.h(1 )

    # measure the circuit
    quantum_circuit.measure(snake_case__				,					snake_case__ )

    A_								=					Aer.get_backend("aer_simulator" )
    A_								=					execute(snake_case__				,					snake_case__				,					shots=1000 )

    return job.result().get_counts(snake_case__ )


if __name__ == "__main__":
     print(f"""Counts for classical state send: {superdense_coding(1,1)}""")






