from typing import Optional

from .. import Features, NamedSplit
from ..packaged_modules.text.text import Text
from ..utils.typing import NestedDataStructureLike, PathLike
from .abc import AbstractDatasetReader


class 			lowerCamelCase_  (     UpperCAmelCase_				):






    '''simple docstring'''






    def __init__(			self				,				__lowercase				,				__lowercase = None				,				__lowercase = None				,				__lowercase = None				,				__lowercase = False				,				__lowercase = False				,				__lowercase = None				,				**__lowercase				,				) ->			Union[str, Any]:
        super().__init__(
            __lowercase				,				split=__lowercase				,				features=__lowercase				,				cache_dir=__lowercase				,				keep_in_memory=__lowercase				,				streaming=__lowercase				,				num_proc=__lowercase				,				**__lowercase				,				)
        __UpperCamelCase  :Optional[Any]    						=	path_or_paths if isinstance(__lowercase				,				__lowercase) else {self.split: path_or_paths}
        __UpperCamelCase  :Optional[int]    						=	Text(
            cache_dir=__lowercase				,				data_files=__lowercase				,				features=__lowercase				,				**__lowercase				,				)







    def     UpperCamelCase__     (			self) ->			str:
        # Build iterable dataset
        if self.streaming:
            __UpperCamelCase  :Union[str, Any]    						=	self.builder.as_streaming_dataset(split=self.split)
        # Build regular (map-style) dataset
        else:
            __UpperCamelCase  :Optional[Any]    						=	None
            __UpperCamelCase  :Optional[Any]    						=	None
            __UpperCamelCase  :int    						=	None
            __UpperCamelCase  :Optional[Any]    						=	None

            self.builder.download_and_prepare(
                download_config=__lowercase				,				download_mode=__lowercase				,				verification_mode=__lowercase				,				base_path=__lowercase				,				num_proc=self.num_proc				,				)
            __UpperCamelCase  :Tuple    						=	self.builder.as_dataset(
                split=self.split				,				verification_mode=__lowercase				,				in_memory=self.keep_in_memory)
        return dataset






import qiskit



def lowerCamelCase						(     SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE			):
    '''simple docstring'''







    __UpperCamelCase  :Dict    						=	qiskit.Aer.get_backend('''aer_simulator'''			)

    __UpperCamelCase  :Tuple    						=	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
    __UpperCamelCase  :Optional[Any]    						=	qiskit.execute(SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE						,    shots=1_000			)

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


if __name__ == "__main__":
    __lowercase											=      half_adder(1, 1)
    print(F'Half Adder Output Qubit Counts: {counts}')





