






'''simple docstring'''







import math

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






def  lowerCAmelCase__		(					a_  :     int = 1			,						a_  :     int = 1			)   -> qiskit.result.counts.Counts:
       if isinstance(a_			,						a_			) or isinstance(a_			,						a_			):
              raise TypeError('''inputs must be integers.'''			)
       if (bit_a < 0) or (bit_a < 0):
              raise ValueError('''inputs must be positive.'''			)
       if (math.floor(a_			) != bit_a) or (math.floor(a_			) != 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__	:   Any												=	QuantumRegister(2			,						'''qr'''			)
       UpperCAmelCase__	:   Dict												=	ClassicalRegister(2			,						'''cr'''			)

       UpperCAmelCase__	:   Optional[Any]												=	QuantumCircuit(a_			,						a_			)

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

       # send the information
       UpperCAmelCase__	:   List[Any]												=	str(a_			) + str(a_			)

       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(a_			,						a_			)

       UpperCAmelCase__	:   Union[str, Any]												=	Aer.get_backend('''aer_simulator'''			)
       UpperCAmelCase__	:   List[str]												=	execute(a_			,						a_			,						shots=1_0_0_0			)

       return job.result().get_counts(a_			)


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







'''simple docstring'''







from ctypes import c_float, sizeof
from enum import Enum
from typing import TYPE_CHECKING, Optional, Union


if TYPE_CHECKING:
  from .. import AutoFeatureExtractor, AutoProcessor, AutoTokenizer  # tests_ignore




class 					__UpperCAmelCase (		UpperCamelCase__	):

      '''simple docstring'''





      SCREAMING_SNAKE_CASE				:    Dict				       =					c_float




      @property
      def 							lowerCamelCase     (					self						):
             return sizeof(self.value						)






def  lowerCAmelCase__		(					a_  :     int			,						a_  :     int			,						a_  :     int = 0			)   -> int:
       # < 0 is possible if using a dynamic axis
       if dimension <= 0:
              UpperCAmelCase__	:   List[Any]												=	fixed_dimension

       dimension -= num_token_to_add
       return dimension






def  lowerCAmelCase__		(					a_  :     int			,						a_  :     ParameterFormat			)   -> int:
       return num_parameters * dtype.size






def  lowerCAmelCase__		(					a_  :     str			)   -> Optional[Union["AutoTokenizer", "AutoFeatureExtractor", "AutoProcessor"]]:
       from .. import AutoFeatureExtractor, AutoProcessor, AutoTokenizer  # tests_ignore

       try:
              return AutoProcessor.from_pretrained(a_			)
       except (ValueError, OSError, KeyError):
              UpperCAmelCase__							,							UpperCAmelCase__	:   Dict												=	None, None
              try:
                     UpperCAmelCase__	:   Union[str, Any]												=	AutoTokenizer.from_pretrained(a_			)
              except (OSError, KeyError):
                     pass
              try:
                     UpperCAmelCase__	:   List[str]												=	AutoFeatureExtractor.from_pretrained(a_			)
              except (OSError, KeyError):
                     pass

              if tokenizer is not None and feature_extractor is not None:
                     raise ValueError(
                         f"""Couldn't auto-detect preprocessor for {model_name}. Found both a tokenizer and a feature extractor."""			)
              elif tokenizer is None and feature_extractor is None:
                     return None
              elif tokenizer is not None:
                     return tokenizer
              else:
                     return feature_extractor