





import math

import qiskit


def 	UpperCamelCase__(       UpperCamelCase__			:       int = 1 ,     UpperCamelCase__			:       int = 1 ,     UpperCamelCase__			:       int = 1  )->qiskit.result.counts.Counts:
       if (
           isinstance(__snake_case ,     __snake_case  )
           or isinstance(__snake_case ,     __snake_case  )
           or isinstance(__snake_case ,     __snake_case  )
       ):
              raise TypeError('''inputs must be integers.'''  )

       if (input_a < 0) or (input_a < 0) or (carry_in < 0):
              raise ValueError('''inputs must be positive.'''  )

       if (
           (math.floor(__snake_case  ) != input_a)
           or (math.floor(__snake_case  ) != input_a)
           or (math.floor(__snake_case  ) != carry_in)
       ):
              raise ValueError('''inputs must be exact integers.'''  )

       if (input_a > 2) or (input_a > 2) or (carry_in > 2):
              raise ValueError('''inputs must be less or equal to 2.'''  )

       # build registers
       A__											=						qiskit.QuantumRegister(4 ,     '''qr'''  )
       A__											=						qiskit.ClassicalRegister(2 ,     '''cr'''  )
       # list the entries
       A__											=						[input_a, input_a, carry_in]

       A__											=						qiskit.QuantumCircuit(__snake_case ,     __snake_case  )

       for i in range(0 ,     3  ):
              if entry[i] == 2:
                     quantum_circuit.h(__snake_case  )  # for hadamard entries
              elif entry[i] == 1:
                     quantum_circuit.x(__snake_case  )  # for 1 entries
              elif entry[i] == 0:
                     quantum_circuit.i(__snake_case  )  # for 0 entries

    # build the circuit
       quantum_circuit.ccx(0 ,     1 ,     3  )  # ccx = toffoli gate
       quantum_circuit.cx(0 ,     1  )
       quantum_circuit.ccx(1 ,     2 ,     3  )
       quantum_circuit.cx(1 ,     2  )
       quantum_circuit.cx(0 ,     1  )

       quantum_circuit.measure([2, 3] ,     __snake_case  )  # measure the last two qbits

       A__											=						qiskit.Aer.get_backend('''aer_simulator'''  )
       A__											=						qiskit.execute(__snake_case ,     __snake_case ,     shots=10_00  )

       return job.result().get_counts(__snake_case  )


if __name__ == "__main__":
       print(F"Total sum count for state is: {quantum_full_adder(1, 1, 1)}")












'''simple docstring'''




from argparse import ArgumentParser

from datasets.commands.convert import ConvertCommand
from datasets.commands.dummy_data import DummyDataCommand
from datasets.commands.env import EnvironmentCommand
from datasets.commands.run_beam import RunBeamCommand
from datasets.commands.test import TestCommand
from datasets.utils.logging import set_verbosity_info






def        _lowerCAmelCase			(  __snake_case  : Tuple			)     ->     Dict:
     return {key.lstrip('-'			): value for key, value in zip(unknown_args[::2] ,							unknown_args[1::2]			)}






def        _lowerCAmelCase			(  )     ->     Tuple:
     __A						: int      =       ArgumentParser(
         'HuggingFace Datasets CLI tool' ,							usage='datasets-cli <command> [<args>]' ,							allow_abbrev=__snake_case			)
     __A						: Optional[Any]      =       parser.add_subparsers(help='datasets-cli command helpers'			)
     set_verbosity_info()

     # Register commands
     ConvertCommand.register_subcommand(__snake_case			)
     EnvironmentCommand.register_subcommand(__snake_case			)
     TestCommand.register_subcommand(__snake_case			)
     RunBeamCommand.register_subcommand(__snake_case			)
     DummyDataCommand.register_subcommand(__snake_case			)

     # Parse args
     __A ,__A						: Optional[Any]      =       parser.parse_known_args()
     if not hasattr(__snake_case ,							'func'			):
          parser.print_help()
          exit(1			)
     __A						: Any      =       parse_unknown_args(__snake_case			)

     # Run
     __A						: List[Any]      =       args.func(__snake_case ,							**__snake_case			)
     service.run()


if __name__ == "__main__":
  main()