



'''simple docstring'''





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tokenizers_available,
    is_torch_available,
    is_vision_available,
)


A__    :   Optional[int]           =					{
    '''configuration_perceiver''': ['''PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''PerceiverConfig''', '''PerceiverOnnxConfig'''],
    '''tokenization_perceiver''': ['''PerceiverTokenizer'''],
}

try:
    if not is_vision_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    A__    :   Optional[int]           =					['''PerceiverFeatureExtractor''']
    A__    :   str           =					['''PerceiverImageProcessor''']

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    A__    :   Union[str, Any]           =					[
        '''PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST''',
        '''PerceiverForImageClassificationConvProcessing''',
        '''PerceiverForImageClassificationFourier''',
        '''PerceiverForImageClassificationLearned''',
        '''PerceiverForMaskedLM''',
        '''PerceiverForMultimodalAutoencoding''',
        '''PerceiverForOpticalFlow''',
        '''PerceiverForSequenceClassification''',
        '''PerceiverLayer''',
        '''PerceiverModel''',
        '''PerceiverPreTrainedModel''',
    ]


if TYPE_CHECKING:
    from .configuration_perceiver import PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP, PerceiverConfig, PerceiverOnnxConfig
    from .tokenization_perceiver import PerceiverTokenizer

    try:
        if not is_vision_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .feature_extraction_perceiver import PerceiverFeatureExtractor
        from .image_processing_perceiver import PerceiverImageProcessor

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_perceiver import (
            PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST,
            PerceiverForImageClassificationConvProcessing,
            PerceiverForImageClassificationFourier,
            PerceiverForImageClassificationLearned,
            PerceiverForMaskedLM,
            PerceiverForMultimodalAutoencoding,
            PerceiverForOpticalFlow,
            PerceiverForSequenceClassification,
            PerceiverLayer,
            PerceiverModel,
            PerceiverPreTrainedModel,
        )

else:
    import sys

    A__    :   Tuple           =					_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)








'''simple docstring'''





import qiskit





def   a_   (		_UpperCAmelCase    :      int = 2				)    ->  qiskit.result.counts.Counts:
      __snake_case :   Union[str, Any]													=    qubits

      # Using Aer's simulator
      __snake_case :   List[Any]													=    qiskit.Aer.get_backend('aer_simulator'				)

      # Creating a Quantum Circuit acting on the q register
      __snake_case :   Dict													=    qiskit.QuantumCircuit(_UpperCAmelCase ,_UpperCAmelCase				)

      # Adding a H gate on qubit 0 (now q0 in superposition)
      circuit.h(0				)

      for i in range(1 ,_UpperCAmelCase				):
            # Adding CX (CNOT) gate
            circuit.cx(i - 1 ,_UpperCAmelCase				)

      # Mapping the quantum measurement to the classical bits
      circuit.measure(list(range(_UpperCAmelCase				)				) ,list(range(_UpperCAmelCase				)				)				)

      # Now measuring any one qubit would affect other qubits to collapse
      # their super position and have same state as the measured one.

      # Executing the circuit on the simulator
      __snake_case :   Optional[Any]													=    qiskit.execute(_UpperCAmelCase ,_UpperCAmelCase ,shots=10_00				)

      return job.result().get_counts(_UpperCAmelCase				)


if __name__ == "__main__":
    print(F"""Total count for various states are: {quantum_entanglement(3)}""")



