





import math

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






def 				SCREAMING_SNAKE_CASE__							(       UpperCamelCase__:							int = 3    ):
		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)."""    )

		SCREAMING_SNAKE_CASE__			=      QuantumRegister(UpperCamelCase__					,   """qr"""    )
		SCREAMING_SNAKE_CASE__			=      ClassicalRegister(UpperCamelCase__					,   """cr"""    )

		SCREAMING_SNAKE_CASE__			=      QuantumCircuit(UpperCamelCase__					,   UpperCamelCase__    )

		SCREAMING_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
		SCREAMING_SNAKE_CASE__			=      Aer.get_backend("""qasm_simulator"""    )
		SCREAMING_SNAKE_CASE__			=      execute(UpperCamelCase__					,   UpperCamelCase__					,   shots=10_000    )

		return job.result().get_counts(UpperCamelCase__    )


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






import warnings
from functools import wraps
from typing import Callable






def 				SCREAMING_SNAKE_CASE__							(       UpperCamelCase__:							Callable    ):

		@wraps(UpperCamelCase__    )
		def _inner_fn(*UpperCamelCase__:							Dict					,   **UpperCamelCase__:							Any    ):
				warnings.warn(
				    (f'''\'{fn.__name__}\' is experimental and might be subject to breaking changes in the future.''')					,   UpperCamelCase__					,   )
				return fn(*UpperCamelCase__					,   **UpperCamelCase__    )

		return _inner_fn