
'''simple docstring'''





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







def snake_case_    (				lowercase__ = np.pi / 2      ,					lowercase__ = np.pi / 2      ,					lowercase__ = np.pi / 2		):
  UpperCAmelCase__			:				List[Any]												=       QuantumRegister(3      ,					"qr"		)  # Define the number of quantum bits
  UpperCAmelCase__			:				List[str]												=       ClassicalRegister(1      ,					"cr"		)  # Define the number of classical bits

  UpperCAmelCase__			:				str												=       QuantumCircuit(UpperCamelCase__      ,					UpperCamelCase__		)  # Define the quantum circuit.

  # Build the circuit
  quantum_circuit.u(UpperCamelCase__      ,					UpperCamelCase__      ,					UpperCamelCase__      ,					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__			:				Any												=       execute(UpperCamelCase__      ,					UpperCamelCase__      ,					shots=1_0_0_0		)

  return job.result().get_counts(UpperCamelCase__		)


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_torch_available, is_vision_available


SCREAMING_SNAKE_CASE    =					{
    """configuration_donut_swin""": ["""DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP""", """DonutSwinConfig"""],
    """processing_donut""": ["""DonutProcessor"""],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      SCREAMING_SNAKE_CASE    =					[
          """DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """DonutSwinModel""",
          """DonutSwinPreTrainedModel""",
      ]

try:
      if not is_vision_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      SCREAMING_SNAKE_CASE    =					["""DonutFeatureExtractor"""]
      SCREAMING_SNAKE_CASE    =					["""DonutImageProcessor"""]


if TYPE_CHECKING:
      from .configuration_donut_swin import DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, DonutSwinConfig
      from .processing_donut import DonutProcessor

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_donut_swin import (
                DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
                DonutSwinModel,
                DonutSwinPreTrainedModel,
            )

      try:
            if not is_vision_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .feature_extraction_donut import DonutFeatureExtractor
            from .image_processing_donut import DonutImageProcessor

else:
      import sys

      SCREAMING_SNAKE_CASE    =					_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



