import math

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



def 			__SCREAMING_SNAKE_CASE						(      __UpperCamelCase					: int = 3			)							->      qiskit.result.counts.Counts:







  """simple docstring"""





  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=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)}"""
   )




from math import isqrt



def 			__SCREAMING_SNAKE_CASE						(      __UpperCamelCase					: int			)							->      bool:







  """simple docstring"""





  return all(number % divisor != 0 for divisor in range(2				,  isqrt(__UpperCamelCase			) + 1			)			)



def 			__SCREAMING_SNAKE_CASE						(      __UpperCamelCase					: int = 10**6			)							->      int:







  """simple docstring"""





  SCREAMING_SNAKE_CASE__    							=   0
  SCREAMING_SNAKE_CASE__    							=   1
  SCREAMING_SNAKE_CASE__    							=   7
  while prime_candidate < max_prime:
    primes_count += is_prime(__UpperCamelCase			)

    cube_index += 1
    prime_candidate += 6 * cube_index

  return primes_count


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