
"""simple docstring"""




from typing import Callable, Optional, Union

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


snake_case					  =						logging.get_logger(__name__)

snake_case					  =						{
    'microsoft/prophetnet-large-uncased': (
        'https://huggingface.co/microsoft/prophetnet-large-uncased/resolve/main/config.json'
    ),
}




class 	UpperCamelCase      (			__magic_name__ ):

				"""simple docstring"""



				UpperCAmelCase_							: Optional[int]		    =							"prophetnet"
				UpperCAmelCase_							: Tuple		    =							["past_key_values"]
				UpperCAmelCase_							: Optional[int]		    =							{
				    "num_attention_heads": "num_encoder_attention_heads",
				}


				def __init__(							self						,      lowercase__ = 0.1						,      lowercase__ = "gelu"						,      lowercase__ = 30522						,      lowercase__ = 1024						,      lowercase__ = 4096						,      lowercase__ = 12						,      lowercase__ = 16						,      lowercase__ = 4096						,      lowercase__ = 12						,      lowercase__ = 16						,      lowercase__ = 0.1						,      lowercase__ = 0.1						,      lowercase__ = 512						,      lowercase__ = 0.02						,      lowercase__ = True						,      lowercase__ = True						,      lowercase__ = 0						,      lowercase__ = 2						,      lowercase__ = 32						,      lowercase__ = 128						,      lowercase__ = False						,      lowercase__ = 0.0						,      lowercase__ = True						,      lowercase__ = 0						,      lowercase__ = 1						,      lowercase__ = 2						,      **lowercase__						,      )       ->       Optional[int]:
									"""simple docstring"""







									SCREAMING_SNAKE_CASE           =      vocab_size
									SCREAMING_SNAKE_CASE           =      hidden_size
									SCREAMING_SNAKE_CASE           =      encoder_ffn_dim
									SCREAMING_SNAKE_CASE           =      num_encoder_layers
									SCREAMING_SNAKE_CASE           =      num_encoder_attention_heads
									SCREAMING_SNAKE_CASE           =      decoder_ffn_dim
									SCREAMING_SNAKE_CASE           =      num_decoder_layers
									SCREAMING_SNAKE_CASE           =      num_decoder_attention_heads
									SCREAMING_SNAKE_CASE           =      max_position_embeddings
									SCREAMING_SNAKE_CASE           =      init_std  # Normal(0, this parameter)
									SCREAMING_SNAKE_CASE           =      activation_function

									# parameters for prophetnet
									SCREAMING_SNAKE_CASE           =      ngram
									SCREAMING_SNAKE_CASE           =      num_buckets
									SCREAMING_SNAKE_CASE           =      relative_max_distance
									SCREAMING_SNAKE_CASE           =      disable_ngram_loss
									SCREAMING_SNAKE_CASE           =      eps

									# 3 Types of Dropout
									SCREAMING_SNAKE_CASE           =      attention_dropout
									SCREAMING_SNAKE_CASE           =      activation_dropout
									SCREAMING_SNAKE_CASE           =      dropout

									SCREAMING_SNAKE_CASE           =      use_cache

									super().__init__(
									    pad_token_id=lowercase__						,      bos_token_id=lowercase__						,      eos_token_id=lowercase__						,      is_encoder_decoder=lowercase__						,      add_cross_attention=lowercase__						,      decoder_start_token_id=lowercase__						,      **lowercase__						,      )


				@property
				def 				A   (							self     )       ->       int:
									"""simple docstring"""







									return self.num_encoder_layers + self.num_decoder_layers




				@num_hidden_layers.setter
				def 				A   (							self						,      lowercase__     )       ->       List[Any]:
									"""simple docstring"""







									raise NotImplementedError(
									    'This model does not support the setting of `num_hidden_layers`. Please set `num_encoder_layers` and'
									    ' `num_decoder_layers`.'     )


"""simple docstring"""




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

def     UpperCamelCase_    (						SCREAMING_SNAKE_CASE_ = np.pi / 2,	SCREAMING_SNAKE_CASE_ = np.pi / 2,	SCREAMING_SNAKE_CASE_ = np.pi / 2     ):
					SCREAMING_SNAKE_CASE           =      QuantumRegister(3,	'qr'     )  # Define the number of quantum bits
					SCREAMING_SNAKE_CASE           =      ClassicalRegister(1,	'cr'     )  # Define the number of classical bits

					SCREAMING_SNAKE_CASE           =      QuantumCircuit(SCREAMING_SNAKE_CASE_,	SCREAMING_SNAKE_CASE_     )  # Define the quantum circuit.

					# Build the circuit
					quantum_circuit.u(SCREAMING_SNAKE_CASE_,	SCREAMING_SNAKE_CASE_,	SCREAMING_SNAKE_CASE_,	0     )  # Quantum State to teleport
					quantum_circuit.h(1     )  # add hadamard gate
					quantum_circuit.cx(
					    1,	2     )  # add control gate with qubit 1 as control and 2 as target.
					quantum_circuit.cx(0,	1     )
					quantum_circuit.h(0     )
					quantum_circuit.cz(0,	2     )  # add control z gate.
					quantum_circuit.cx(1,	2     )

					quantum_circuit.measure([2],	[0]     )  # measure the qubit.

					# Simulate the circuit using qasm simulator
					SCREAMING_SNAKE_CASE           =      Aer.get_backend('aer_simulator'     )
					SCREAMING_SNAKE_CASE           =      execute(SCREAMING_SNAKE_CASE_,	SCREAMING_SNAKE_CASE_,	shots=1_0_0_0     )

					return job.result().get_counts(SCREAMING_SNAKE_CASE_     )


if __name__ == "__main__":
	print(
	    'Total count for teleported state is: '
	    f'{quantum_teleportation(np.pi/2, np.pi/2, np.pi/2)}'
	)
