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







def 				A__    (  lowerCamelCase = np.pi / 2   ,			lowerCamelCase = np.pi / 2   ,			lowerCamelCase = np.pi / 2  )     ->		qiskit.result.counts.Counts:
				UpperCamelCase_:							int		=  QuantumRegister(3   ,			"""qr"""  )  # Define the number of quantum bits
				UpperCamelCase_:							Any		=  ClassicalRegister(1   ,			"""cr"""  )  # Define the number of classical bits

				UpperCamelCase_:							int		=  QuantumCircuit(lowerCamelCase   ,			lowerCamelCase  )  # Define the quantum circuit.

				# Build the circuit
				quantum_circuit.u(lowerCamelCase   ,			lowerCamelCase   ,			lowerCamelCase   ,			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
				UpperCamelCase_:							Optional[Any]		=  Aer.get_backend("""aer_simulator"""  )
				UpperCamelCase_:							str		=  execute(lowerCamelCase   ,			lowerCamelCase   ,			shots=10_00  )

				return job.result().get_counts(lowerCamelCase  )


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








import os
from shutil import copyfile
from typing import List, Optional, Tuple

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import is_sentencepiece_available, logging


if is_sentencepiece_available():
							from .tokenization_xglm import XGLMTokenizer
else:
							lowerCamelCase_  :       Optional[Any]					      =     None


lowerCamelCase_  :       str					      =     logging.get_logger(__name__)

lowerCamelCase_  :       List[str]					      =     {"""vocab_file""": """sentencepiece.bpe.model""", """tokenizer_file""": """tokenizer.json"""}

lowerCamelCase_  :       List[str]					      =     {
    """vocab_file""": {
        """facebook/xglm-564M""": """https://huggingface.co/facebook/xglm-564M/resolve/main/sentencepiece.bpe.model""",
    },
    """tokenizer_file""": {
        """facebook/xglm-564M""": """https://huggingface.co/facebook/xglm-564M/resolve/main/tokenizer.json""",
    },
}

lowerCamelCase_  :       Dict					      =     {
    """facebook/xglm-564M""": 20_48,
}

class 				_UpperCamelCase (    _A     ):






			'''simple docstring'''

			__UpperCamelCase					:  Optional[Any]    					=       VOCAB_FILES_NAMES
			__UpperCamelCase					:  int    					=       PRETRAINED_VOCAB_FILES_MAP
			__UpperCamelCase					:  List[str]    					=       PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
			__UpperCamelCase					:  Dict    					=       ["""input_ids""", """attention_mask"""]
			__UpperCamelCase					:  Union[str, Any]    					=       XGLMTokenizer

			def __init__(				self       :				Optional[Any]  ,		snake_case_       :				Optional[Any]=None  ,		snake_case_       :				Any=None  ,		snake_case_       :				Optional[Any]="<s>"  ,		snake_case_       :				Union[str, Any]="</s>"  ,		snake_case_       :				Optional[Any]="</s>"  ,		snake_case_       :				Dict="<s>"  ,		snake_case_       :				int="<unk>"  ,		snake_case_       :				Dict="<pad>"  ,		**snake_case_       :				List[str]  ,		):
							# Compatibility with the original tokenizer
							UpperCamelCase_:							List[Any]		=  7
							UpperCamelCase_:							int		=  [f'''<madeupword{i}>''' for i in range(self.num_madeup_words					)]

							UpperCamelCase_:							Any		=  kwargs.get("""additional_special_tokens"""  ,		[]					)
							kwargs["additional_special_tokens"] += [
							    word for word in madeup_words if word not in kwargs["additional_special_tokens"]
							]

							super().__init__(
							    snake_case_  ,		tokenizer_file=snake_case_  ,		bos_token=snake_case_  ,		eos_token=snake_case_  ,		sep_token=snake_case_  ,		cls_token=snake_case_  ,		unk_token=snake_case_  ,		pad_token=snake_case_  ,		**snake_case_  ,		)

							UpperCamelCase_:							Dict		=  vocab_file
							UpperCamelCase_:							Union[str, Any]		=  False if not self.vocab_file else True

			def 					lowerCAmelCase__		(				self       :				Optional[Any]  ,		snake_case_       :				List[int]  ,		snake_case_       :				Optional[List[int]] = None					):

							if token_ids_a is None:
											return [self.sep_token_id] + token_ids_a
							UpperCamelCase_:							Optional[Any]		=  [self.sep_token_id]
							return sep + token_ids_a + sep + sep + token_ids_a

			def 					lowerCAmelCase__		(				self       :				Optional[Any]  ,		snake_case_       :				List[int]  ,		snake_case_       :				Optional[List[int]] = None					):
							UpperCamelCase_:							Any		=  [self.sep_token_id]

							if token_ids_a is None:
											return len(sep + token_ids_a					) * [0]
							return len(sep + token_ids_a + sep + sep + token_ids_a					) * [0]




			def 					lowerCAmelCase__		(				self       :				Optional[Any]  ,		snake_case_       :				str  ,		snake_case_       :				Optional[str] = None					):
							if not self.can_save_slow_tokenizer:
											raise ValueError(
											    """Your fast tokenizer does not have the necessary information to save the vocabulary for a slow """
											    """tokenizer."""					)

							if not os.path.isdir(snake_case_					):
											logger.error(f'''Vocabulary path ({save_directory}) should be a directory.'''					)
											return
							UpperCamelCase_:							Optional[int]		=  os.path.join(
							    snake_case_  ,		(filename_prefix + """-""" if filename_prefix else """""") + VOCAB_FILES_NAMES["""vocab_file"""]					)

							if os.path.abspath(self.vocab_file					) != os.path.abspath(snake_case_					):
											copyfile(self.vocab_file  ,		snake_case_					)

							return (out_vocab_file,)






