

import math

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


def     __SCREAMING_SNAKE_CASE   (SCREAMING_SNAKE_CASE__ = 3			):
						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=10000			)

						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'''
def 					lowerCamelCase_ ( __UpperCamelCase					:       int		)					->	bool:







     """simple docstring"""
     return str(__UpperCamelCase		) == str(__UpperCamelCase		)[::-1]

def 					lowerCamelCase_ ( __UpperCamelCase					:       int		)					->	int:







     """simple docstring"""
     return int(__UpperCamelCase		) + int(str(__UpperCamelCase		)[::-1]		)

def 					lowerCamelCase_ ( __UpperCamelCase					:       int = 1_0_0_0_0		)					->	int:







     """simple docstring"""
     _A				=							[]
     for num in range(1							,    __UpperCamelCase		):
          _A				=							0
          _A				=							num
          while iterations < 5_0:
               _A				=							sum_reverse(__UpperCamelCase		)
               iterations += 1
               if is_palindrome(__UpperCamelCase		):
                    break
          else:
               lychrel_nums.append(__UpperCamelCase		)
     return len(__UpperCamelCase		)


if __name__ == "__main__":
    print(F'{solution() = }')





