


import copy
from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import Audio, ClassLabel, Features
from .base import TaskTemplate



@dataclass(frozen=A						)
class 							_UpperCamelCase (						A						):

   '''simple docstring'''







   a_				:							str    = field(default="audio-classification",metadata={"include_in_asdict_even_if_is_default": True}						)
   a_				:							ClassVar[Features]    = Features({"audio": Audio()}						)
   a_				:							ClassVar[Features]    = Features({"labels": ClassLabel}						)
   a_				:							str    = "audio"
   a_				:							str    = "labels"

   def   _snake_case    (  self  : Optional[int]       ,  _lowerCamelCase  : Tuple							):






         '''simple docstring'''



         if self.label_column not in features:
               raise ValueError(F"""Column {self.label_column} is not present in features."""							)
         if not isinstance(features[self.label_column]       ,  _lowerCamelCase							):
               raise ValueError(F"""Column {self.label_column} is not a ClassLabel."""							)
         __lowerCamelCase     :      Optional[Any]       						=						copy.deepcopy(self							)
         __lowerCamelCase     :      Dict       						=						self.label_schema.copy()
         __lowerCamelCase     :      Union[str, Any]       						=						features[self.label_column]
         __lowerCamelCase     :      Dict       						=						label_schema
         return task_template


   @property
   def   _snake_case    (  self  : Dict							):






         '''simple docstring'''



         return {
             self.audio_column: "audio",
             self.label_column: "labels",
         }







import qiskit





def   _UpperCAmelCase       (     UpperCAmelCase      :			int						,	UpperCAmelCase      :			int      ):
      """simple docstring"""




      __lowerCamelCase     :      Dict       						=						qiskit.Aer.get_backend("""aer_simulator"""      )

      __lowerCamelCase     :      Dict       						=						qiskit.QuantumCircuit(4						,	2      )
      # encode inputs in qubits 0 and 1
      if bita == 1:
            qc_ha.x(0      )
      if bita == 1:
            qc_ha.x(1      )
      qc_ha.barrier()

      # use cnots to write XOR of the inputs on qubit2
      qc_ha.cx(0						,	2      )
      qc_ha.cx(1						,	2      )

      # use ccx / toffoli gate to write AND of the inputs on qubit3
      qc_ha.ccx(0						,	1						,	3      )
      qc_ha.barrier()

      # extract outputs
      qc_ha.measure(2						,	0      )  # extract XOR value
      qc_ha.measure(3						,	1      )  # extract AND value

      # Execute the circuit on the qasm simulator
      __lowerCamelCase     :      str       						=						qiskit.execute(UpperCAmelCase						,	UpperCAmelCase						,	shots=1_000      )

      # Return the histogram data of the results of the experiment
      return job.result().get_counts(UpperCAmelCase      )


if __name__ == "__main__":
    __UpperCamelCase    :						List[str]     =							half_adder(1, 1)
    print(F'''Half Adder Output Qubit Counts: {counts}''')



