



"""simple docstring"""



import numpy as np
import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute
def     UpperCAmelCase    (					_lowercase   :      float = np.pi / 2 ,      _lowercase   :      float = np.pi / 2 ,      _lowercase   :      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(_lowercase ,      _lowercase  )  # Define the quantum circuit.

	# Build the circuit
	quantum_circuit.u(_lowercase ,      _lowercase ,      _lowercase ,      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(_lowercase ,      _lowercase ,      shots=1_0_0_0  )

	return job.result().get_counts(_lowercase  )


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



"""simple docstring"""



from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


lowercase_							 =       {'configuration_pegasus': ['PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP', 'PegasusConfig']}

try:
		if not is_sentencepiece_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase_							 =       ['PegasusTokenizer']

try:
		if not is_tokenizers_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase_							 =       ['PegasusTokenizerFast']

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase_							 =       [
		    'PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'PegasusForCausalLM',
		    'PegasusForConditionalGeneration',
		    'PegasusModel',
		    'PegasusPreTrainedModel',
		]

try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase_							 =       [
		    'TFPegasusForConditionalGeneration',
		    'TFPegasusModel',
		    'TFPegasusPreTrainedModel',
		]

try:
		if not is_flax_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase_							 =       [
		    'FlaxPegasusForConditionalGeneration',
		    'FlaxPegasusModel',
		    'FlaxPegasusPreTrainedModel',
		]


if TYPE_CHECKING:
		from .configuration_pegasus import PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP, PegasusConfig

		try:
				if not is_sentencepiece_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_pegasus import PegasusTokenizer

		try:
				if not is_tokenizers_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_pegasus_fast import PegasusTokenizerFast

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_pegasus import (
				    PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST,
				    PegasusForCausalLM,
				    PegasusForConditionalGeneration,
				    PegasusModel,
				    PegasusPreTrainedModel,
				)

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_pegasus import TFPegasusForConditionalGeneration, TFPegasusModel, TFPegasusPreTrainedModel

		try:
				if not is_flax_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_flax_pegasus import (
				    FlaxPegasusForConditionalGeneration,
				    FlaxPegasusModel,
				    FlaxPegasusPreTrainedModel,
				)

else:
		import sys

		lowercase_							 =       _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)