




"""simple docstring"""






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowercase__			=		{
    """configuration_megatron_bert""": ["""MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """MegatronBertConfig"""],
}

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			lowercase__			=		[
			    """MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
			    """MegatronBertForCausalLM""",
			    """MegatronBertForMaskedLM""",
			    """MegatronBertForMultipleChoice""",
			    """MegatronBertForNextSentencePrediction""",
			    """MegatronBertForPreTraining""",
			    """MegatronBertForQuestionAnswering""",
			    """MegatronBertForSequenceClassification""",
			    """MegatronBertForTokenClassification""",
			    """MegatronBertModel""",
			    """MegatronBertPreTrainedModel""",
			]

if TYPE_CHECKING:
			from .configuration_megatron_bert import MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, MegatronBertConfig

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_megatron_bert import (
						    MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST,
						    MegatronBertForCausalLM,
						    MegatronBertForMaskedLM,
						    MegatronBertForMultipleChoice,
						    MegatronBertForNextSentencePrediction,
						    MegatronBertForPreTraining,
						    MegatronBertForQuestionAnswering,
						    MegatronBertForSequenceClassification,
						    MegatronBertForTokenClassification,
						    MegatronBertModel,
						    MegatronBertPreTrainedModel,
						)

else:
			import sys

			lowercase__			=		_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)





"""simple docstring"""






import qiskit







def 	_snake_case     (							lowercase__ = 2						):
				_lowerCamelCase	:     Optional[Any]       =       qubits

				# Using Aer's simulator
				_lowerCamelCase	:     Dict       =       qiskit.Aer.get_backend('aer_simulator'						)

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

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

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

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

				# 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
				_lowerCamelCase	:     Optional[Any]       =       qiskit.execute(lowercase__				,       lowercase__				,       shots=1000						)

				return job.result().get_counts(lowercase__						)


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