


"""simple docstring"""
import math

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







def 						_a				(      _SCREAMING_SNAKE_CASE = 3				)    ->				qiskit.result.counts.Counts:
							if isinstance(_SCREAMING_SNAKE_CASE				, _SCREAMING_SNAKE_CASE				):
														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(_SCREAMING_SNAKE_CASE				) != 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(_SCREAMING_SNAKE_CASE				, """qr"""				)
							snake_case_           =		ClassicalRegister(_SCREAMING_SNAKE_CASE				, """cr"""				)

							snake_case_           =		QuantumCircuit(_SCREAMING_SNAKE_CASE				, _SCREAMING_SNAKE_CASE				)

							snake_case_           =		number_of_qubits

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

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

							# measure all the qubits
							quantum_circuit.measure(_SCREAMING_SNAKE_CASE				, _SCREAMING_SNAKE_CASE				)
							# simulate with 10000 shots
							snake_case_           =		Aer.get_backend("""qasm_simulator"""				)
							snake_case_           =		execute(_SCREAMING_SNAKE_CASE				, _SCREAMING_SNAKE_CASE				, shots=10_000				)

							return job.result().get_counts(_SCREAMING_SNAKE_CASE				)


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







"""simple docstring"""
from __future__ import annotations







def 						_a				(      _SCREAMING_SNAKE_CASE				, _SCREAMING_SNAKE_CASE				)    ->				list[int]:
							snake_case_           =		0
							snake_case_           =		len(_SCREAMING_SNAKE_CASE				) - 1

							while i < j:
														if nums[i] + nums[j] == target:
																					return [i, j]
														elif nums[i] + nums[j] < target:
																					snake_case_           =		i + 1
														else:
																					snake_case_           =		j - 1

							return []


if __name__ == "__main__":
				import doctest

				doctest.testmod()
				print(f"""{two_pointer([2, 7, 11, 15], 9) = }""")



