




'''simple docstring'''

import math

import numpy as np
import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute


def __UpperCAmelCase	(   _UpperCAmelCase		:   int = 3						)      ->      qiskit.result.counts.Counts:
			if isinstance(_UpperCAmelCase		,				_UpperCAmelCase						):
						raise TypeError("number of qubits must be a integer."						)
			if number_of_qubits <= 0:
						raise ValueError("number of qubits must be > 0."						)
			if math.floor(_UpperCAmelCase						) != number_of_qubits:
						raise ValueError("number of qubits must be exact integer."						)
			if number_of_qubits > 10:
						raise ValueError("number of qubits too large to simulate(>10)."						)

			__snake_case			=		QuantumRegister(_UpperCAmelCase		,				"qr"						)
			__snake_case			=		ClassicalRegister(_UpperCAmelCase		,				"cr"						)

			__snake_case			=		QuantumCircuit(_UpperCAmelCase		,				_UpperCAmelCase						)

			__snake_case			=		number_of_qubits

			for i in range(_UpperCAmelCase						):
						quantum_circuit.h(number_of_qubits - i - 1						)
						counter -= 1
						for j in range(_UpperCAmelCase						):
									quantum_circuit.cp(np.pi / 2 ** (counter - j)		,				_UpperCAmelCase		,				_UpperCAmelCase						)

			for k in range(number_of_qubits // 2						):
						quantum_circuit.swap(_UpperCAmelCase		,				number_of_qubits - k - 1						)

			# measure all the qubits
			quantum_circuit.measure(_UpperCAmelCase		,				_UpperCAmelCase						)
			# simulate with 10000 shots
			__snake_case			=		Aer.get_backend("qasm_simulator"						)
			__snake_case			=		execute(_UpperCAmelCase		,				_UpperCAmelCase		,				shots=1_00_00						)

			return job.result().get_counts(_UpperCAmelCase						)


if __name__ == "__main__":
						print(
						    F'''Total count for quantum fourier transform state is: \
    {quantum_fourier_transform(3)}'''
						)










import pytest


lowercase_													=      '''__dummy_dataset1__'''

lowercase_													=      '''
import json
import os

import datasets


REPO_URL = "https://huggingface.co/datasets/albertvillanova/tests-raw-jsonl/resolve/main/"
URLS = {"train": REPO_URL + "wikiann-bn-train.jsonl", "validation": REPO_URL + "wikiann-bn-validation.jsonl"}


class __DummyDataset1__(datasets.GeneratorBasedBuilder):

    def _info(self):
        features = datasets.Features(
            {
                "tokens": datasets.Sequence(datasets.Value("string")),
                "ner_tags": datasets.Sequence(
                    datasets.features.ClassLabel(
                        names=[
                            "O",
                            "B-PER",
                            "I-PER",
                            "B-ORG",
                            "I-ORG",
                            "B-LOC",
                            "I-LOC",
                        ]
                    )
                ),
                "langs": datasets.Sequence(datasets.Value("string")),
                "spans": datasets.Sequence(datasets.Value("string")),
            }
        )
        return datasets.DatasetInfo(features=features)

    def _split_generators(self, dl_manager):
        dl_path = dl_manager.download(URLS)
        return [
            datasets.SplitGenerator(datasets.Split.TRAIN, gen_kwargs={"filepath": dl_path["train"]}),
            datasets.SplitGenerator(datasets.Split.VALIDATION, gen_kwargs={"filepath": dl_path["validation"]}),
        ]

    def _generate_examples(self, filepath):
        with open(filepath, "r", encoding="utf-8") as f:
            for i, line in enumerate(f):
                yield i, json.loads(line)
'''






@pytest.fixture
def        __lowerCAmelCase		(	)	->    Any:
					return DATASET_LOADING_SCRIPT_NAME






@pytest.fixture
def        __lowerCAmelCase		(	)	->    Union[str, Any]:
					return DATASET_LOADING_SCRIPT_CODE






@pytest.fixture
def        __lowerCAmelCase		(	__lowerCamelCase						:     Optional[Any]					, __lowerCamelCase						:     Tuple					, __lowerCamelCase						:     str						)	->    List[str]:
					__lowerCAmelCase						 =dataset_loading_script_name
					__lowerCAmelCase						 =tmp_path / """datasets""" / script_name
					script_dir.mkdir(parents=__lowerCamelCase						)
					__lowerCAmelCase						 =script_dir / f"""{script_name}.py"""
					with open(__lowerCamelCase					, """w"""						) as f:
										f.write(__lowerCamelCase						)
					return str(__lowerCamelCase						)




