

"""simple docstring"""




import unittest

from diffusers import __version__
from diffusers.utils import deprecate


class 		_A							(      unittest.TestCase       ):
      __a             =						'.'.join([str(int(__version__.split('.'       )[0]       ) + 1       )] + __version__.split('.'       )[1:]       )
      __a             =						'0.0.1'





      def        _lowerCamelCase	(	self		) ->       str:
         lowerCamelCase__						       =      {"deprecated_arg": 4}

         with self.assertWarns(SCREAMING_SNAKE_CASE__		) as warning:
            lowerCamelCase__						       =      deprecate("deprecated_arg"     ,    self.higher_version     ,    "message"     ,    take_from=SCREAMING_SNAKE_CASE__		)

         assert output == 4
         assert (
             str(warning.warning		)
             == f'The `deprecated_arg` argument is deprecated and will be removed in version {self.higher_version}.'
             " message"
         )





      def        _lowerCamelCase	(	self		) ->       Tuple:
         lowerCamelCase__						       =      {"deprecated_arg": 4}

         with self.assertWarns(SCREAMING_SNAKE_CASE__		) as warning:
            lowerCamelCase__						       =      deprecate(("deprecated_arg", self.higher_version, "message")     ,    take_from=SCREAMING_SNAKE_CASE__		)

         assert output == 4
         assert (
             str(warning.warning		)
             == f'The `deprecated_arg` argument is deprecated and will be removed in version {self.higher_version}.'
             " message"
         )





      def        _lowerCamelCase	(	self		) ->       Dict:
         lowerCamelCase__						       =      {"deprecated_arg_1": 4, "deprecated_arg_2": 8}
         with self.assertWarns(SCREAMING_SNAKE_CASE__		) as warning:
            lowerCamelCase__       ,							lowerCamelCase__						       =      deprecate(
                ("deprecated_arg_1", self.higher_version, "Hey")     ,    ("deprecated_arg_2", self.higher_version, "Hey")     ,    take_from=SCREAMING_SNAKE_CASE__     ,    )
         assert output_a == 4
         assert output_a == 8
         assert (
             str(warning.warnings[0].message		)
             == "The `deprecated_arg_1` argument is deprecated and will be removed in version"
             f' {self.higher_version}. Hey'
         )
         assert (
             str(warning.warnings[1].message		)
             == "The `deprecated_arg_2` argument is deprecated and will be removed in version"
             f' {self.higher_version}. Hey'
         )





      def        _lowerCamelCase	(	self		) ->       Dict:
         lowerCamelCase__						       =      {"deprecated_arg": 4}

         with self.assertRaises(SCREAMING_SNAKE_CASE__		) as error:
            deprecate(("wrong_arg", self.higher_version, "message")     ,    take_from=SCREAMING_SNAKE_CASE__		)

         assert "test_deprecate_function_incorrect_arg in" in str(error.exception		)
         assert "line" in str(error.exception		)
         assert "got an unexpected keyword argument `deprecated_arg`" in str(error.exception		)





      def        _lowerCamelCase	(	self		) ->       Dict:
         with self.assertWarns(SCREAMING_SNAKE_CASE__		) as warning:
            deprecate(("deprecated_arg", self.higher_version, "message")		)

         assert (
             str(warning.warning		)
             == f'`deprecated_arg` is deprecated and will be removed in version {self.higher_version}. message'
         )





      def        _lowerCamelCase	(	self		) ->       str:
         with self.assertWarns(SCREAMING_SNAKE_CASE__		) as warning:
            deprecate(
                ("deprecated_arg_1", self.higher_version, "Hey")     ,    ("deprecated_arg_2", self.higher_version, "Hey")     ,    )
         assert (
             str(warning.warnings[0].message		)
             == f'`deprecated_arg_1` is deprecated and will be removed in version {self.higher_version}. Hey'
         )
         assert (
             str(warning.warnings[1].message		)
             == f'`deprecated_arg_2` is deprecated and will be removed in version {self.higher_version}. Hey'
         )





      def        _lowerCamelCase	(	self		) ->       Optional[Any]:


         class 		_A							:
               __a             =						5

         with self.assertWarns(SCREAMING_SNAKE_CASE__		) as warning:
            lowerCamelCase__						       =      deprecate(("arg", self.higher_version, "message")     ,    take_from=Args()		)

         assert arg == 5
         assert (
             str(warning.warning		)
             == f'The `arg` attribute is deprecated and will be removed in version {self.higher_version}. message'
         )





      def        _lowerCamelCase	(	self		) ->       int:


         class 		_A							:
               __a             =						5
               __a             =						7

         with self.assertWarns(SCREAMING_SNAKE_CASE__		) as warning:
            lowerCamelCase__       ,							lowerCamelCase__						       =      deprecate(
                ("arg", self.higher_version, "message")     ,    ("foo", self.higher_version, "message")     ,    ("does not exist", self.higher_version, "message")     ,    take_from=Args()     ,    )

         assert arg_a == 5
         assert arg_a == 7
         assert (
             str(warning.warning		)
             == f'The `arg` attribute is deprecated and will be removed in version {self.higher_version}. message'
         )
         assert (
             str(warning.warnings[0].message		)
             == f'The `arg` attribute is deprecated and will be removed in version {self.higher_version}. message'
         )
         assert (
             str(warning.warnings[1].message		)
             == f'The `foo` attribute is deprecated and will be removed in version {self.higher_version}. message'
         )





      def        _lowerCamelCase	(	self		) ->       Union[str, Any]:
         lowerCamelCase__						       =      {"deprecated_arg": 4}

         with self.assertRaises(SCREAMING_SNAKE_CASE__		) as error:
            deprecate(("wrong_arg", self.lower_version, "message")     ,    take_from=SCREAMING_SNAKE_CASE__		)

         assert (
             str(error.exception		)
             == "The deprecation tuple ('wrong_arg', '0.0.1', 'message') should be removed since diffusers' version"
             f' {__version__} is >= {self.lower_version}'
         )





      def        _lowerCamelCase	(	self		) ->       Optional[int]:
         with self.assertWarns(SCREAMING_SNAKE_CASE__		) as warning:
            deprecate(("deprecated_arg", self.higher_version, "This message is better!!!")     ,    standard_warn=SCREAMING_SNAKE_CASE__		)

         assert str(warning.warning		) == "This message is better!!!"





      def        _lowerCamelCase	(	self		) ->       Any:
         with self.assertWarns(SCREAMING_SNAKE_CASE__		) as warning:
            deprecate(("deprecated_arg", self.higher_version, "This message is better!!!")     ,    standard_warn=SCREAMING_SNAKE_CASE__		)
         assert str(warning.warning		) == "This message is better!!!"
         assert "diffusers/tests/others/test_utils.py" in warning.filename







"""simple docstring"""




import math

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



def 						UpperCAmelCase__ (					A__ = 1						,     A__ = 1 )   ->   qiskit.result.counts.Counts:




   """simple docstring"""
   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
   lowerCamelCase__						       =      QuantumRegister(2						,     "qr" )
   lowerCamelCase__						       =      ClassicalRegister(2						,     "cr" )

   lowerCamelCase__						       =      QuantumCircuit(A__						,     A__ )

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

   # send the information
   lowerCamelCase__						       =      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__ )

   lowerCamelCase__						       =      Aer.get_backend("aer_simulator" )
   lowerCamelCase__						       =      execute(A__						,     A__						,     shots=1000 )

   return job.result().get_counts(A__ )


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




