
'''simple docstring'''





import math

import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute







def snake_case_    (				lowercase__ = 1      ,					lowercase__ = 1		):
  if isinstance(lowercase__      ,					lowercase__		) or isinstance(lowercase__      ,					lowercase__		):
    raise TypeError("inputs must be integers."		)
  if (bit_a < 0) or (bit_a < 0):
    raise ValueError("inputs must be positive."		)
  if (math.floor(lowercase__		) != bit_a) or (math.floor(lowercase__		) != bit_a):
    raise ValueError("inputs must be exact integers."		)
  if (bit_a > 1) or (bit_a > 1):
    raise ValueError("inputs must be less or equal to 1."		)

  # build registers
  UpperCAmelCase__			:				str												=       QuantumRegister(2      ,					"qr"		)
  UpperCAmelCase__			:				int												=       ClassicalRegister(2      ,					"cr"		)

  UpperCAmelCase__			:				Tuple												=       QuantumCircuit(lowercase__      ,					lowercase__		)

  # entanglement the qubits
  quantum_circuit.h(1		)
  quantum_circuit.cx(1      ,					0		)

  # send the information
  UpperCAmelCase__			:				int												=       str(lowercase__		) + str(lowercase__		)

  if c_information == "11":
    quantum_circuit.x(1		)
    quantum_circuit.z(1		)
  elif c_information == "10":
    quantum_circuit.z(1		)
  elif c_information == "01":
    quantum_circuit.x(1		)
  else:
    quantum_circuit.i(1		)

  # unentangled the circuit
  quantum_circuit.cx(1      ,					0		)
  quantum_circuit.h(1		)

  # measure the circuit
  quantum_circuit.measure(lowercase__      ,					lowercase__		)

  UpperCAmelCase__			:				Tuple												=       Aer.get_backend("aer_simulator"		)
  UpperCAmelCase__			:				int												=       execute(lowercase__      ,					lowercase__      ,					shots=1_0_0_0		)

  return job.result().get_counts(lowercase__		)


if __name__ == "__main__":
      print(F'Counts for classical state send: {superdense_coding(1,1)}')





'''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__)



