
'''simple docstring'''

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







def   A     (      UpperCamelCase_					:     float = np.pi / 2						,	UpperCamelCase_					:     float = np.pi / 2						,	UpperCamelCase_					:     float = np.pi / 2      )					->       qiskit.result.counts.Counts:







			'''simple docstring'''



			lowerCAmelCase__								=							QuantumRegister(3						,	"qr"      )  # Define the number of quantum bits
			lowerCAmelCase__								=							ClassicalRegister(1						,	"cr"      )  # Define the number of classical bits

			lowerCAmelCase__								=							QuantumCircuit(a_						,	a_      )  # Define the quantum circuit.

			# Build the circuit
			quantum_circuit.u(a_						,	a_						,	a_						,	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
			lowerCAmelCase__								=							Aer.get_backend("aer_simulator"      )
			lowerCAmelCase__								=							execute(a_						,	a_						,	shots=10_00      )

			return job.result().get_counts(a_      )


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





'''simple docstring'''

import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_layoutlm import LayoutLMTokenizer


UpperCAmelCase__   : Optional[Any]					=		logging.get_logger(__name__)

UpperCAmelCase__   : str					=		{"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"}

UpperCAmelCase__   : Union[str, Any]					=		{
    "vocab_file": {
        "microsoft/layoutlm-base-uncased": (
            "https://huggingface.co/microsoft/layoutlm-base-uncased/resolve/main/vocab.txt"
        ),
        "microsoft/layoutlm-large-uncased": (
            "https://huggingface.co/microsoft/layoutlm-large-uncased/resolve/main/vocab.txt"
        ),
    },
    "tokenizer_file": {
        "microsoft/layoutlm-base-uncased": (
            "https://huggingface.co/microsoft/layoutlm-base-uncased/resolve/main/tokenizer.json"
        ),
        "microsoft/layoutlm-large-uncased": (
            "https://huggingface.co/microsoft/layoutlm-large-uncased/resolve/main/tokenizer.json"
        ),
    },
}

UpperCAmelCase__   : List[Any]					=		{
    "microsoft/layoutlm-base-uncased": 5_12,
    "microsoft/layoutlm-large-uncased": 5_12,
}

UpperCAmelCase__   : List[str]					=		{
    "microsoft/layoutlm-base-uncased": {"do_lower_case": True},
    "microsoft/layoutlm-large-uncased": {"do_lower_case": True},
}






class    A     (	SCREAMING_SNAKE_CASE__    ):
	snake_case__      :Union[str, Any]        =     VOCAB_FILES_NAMES
	snake_case__      :List[str]        =     PRETRAINED_VOCAB_FILES_MAP
	snake_case__      :Union[str, Any]        =     PRETRAINED_INIT_CONFIGURATION
	snake_case__      :int        =     PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
	snake_case__      :int        =     LayoutLMTokenizer





	def __init__(					self			:       Any      ,							__magic_name__			:       List[Any]=None      ,							__magic_name__			:       Optional[int]=None      ,							__magic_name__			:       Dict=True      ,							__magic_name__			:       Dict="[UNK]"      ,							__magic_name__			:       List[str]="[SEP]"      ,							__magic_name__			:       int="[PAD]"      ,							__magic_name__			:       Tuple="[CLS]"      ,							__magic_name__			:       int="[MASK]"      ,							__magic_name__			:       Dict=True      ,							__magic_name__			:       Tuple=None      ,							**__magic_name__			:       Optional[int]      ,							):


				"""simple docstring"""

				super().__init__(
				    __magic_name__      ,							tokenizer_file=__magic_name__      ,							do_lower_case=__magic_name__      ,							unk_token=__magic_name__      ,							sep_token=__magic_name__      ,							pad_token=__magic_name__      ,							cls_token=__magic_name__      ,							mask_token=__magic_name__      ,							tokenize_chinese_chars=__magic_name__      ,							strip_accents=__magic_name__      ,							**__magic_name__      ,							)

				lowerCAmelCase__								=							json.loads(self.backend_tokenizer.normalizer.__getstate__()							)
				if (
				    normalizer_state.get("lowercase"      ,							__magic_name__							) != do_lower_case
				    or normalizer_state.get("strip_accents"      ,							__magic_name__							) != strip_accents
				    or normalizer_state.get("handle_chinese_chars"      ,							__magic_name__							) != tokenize_chinese_chars
				):
							lowerCAmelCase__								=							getattr(__magic_name__      ,							normalizer_state.pop("type"							)							)
							lowerCAmelCase__								=							do_lower_case
							lowerCAmelCase__								=							strip_accents
							lowerCAmelCase__								=							tokenize_chinese_chars
							lowerCAmelCase__								=							normalizer_class(**__magic_name__							)

				lowerCAmelCase__								=							do_lower_case





	def 							__SCREAMING_SNAKE_CASE  (					self			:       List[str]      ,							__magic_name__			:       Optional[int]      ,							__magic_name__			:       List[str]=None							):


				"""simple docstring"""

				lowerCAmelCase__								=							[self.cls_token_id] + token_ids_a + [self.sep_token_id]

				if token_ids_a:
							output += token_ids_a + [self.sep_token_id]

				return output





	def 							__SCREAMING_SNAKE_CASE  (					self			:       Tuple      ,							__magic_name__			:       List[int]      ,							__magic_name__			:       Optional[List[int]] = None							):


				"""simple docstring"""

				lowerCAmelCase__								=							[self.sep_token_id]
				lowerCAmelCase__								=							[self.cls_token_id]
				if token_ids_a is None:
							return len(cls + token_ids_a + sep							) * [0]
				return len(cls + token_ids_a + sep							) * [0] + len(token_ids_a + sep							) * [1]







	def 							__SCREAMING_SNAKE_CASE  (					self			:       Optional[Any]      ,							__magic_name__			:       str      ,							__magic_name__			:       Optional[str] = None							):


				"""simple docstring"""

				lowerCAmelCase__								=							self._tokenizer.model.save(__magic_name__      ,							name=__magic_name__							)
				return tuple(__magic_name__							)





