


import math

import numpy as np
import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute
def 	_UpperCamelCase					(    lowerCAmelCase_ = 3 )    ->qiskit.result.counts.Counts:
   if isinstance(lowerCAmelCase_	,    lowerCAmelCase_ ):
      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(lowerCAmelCase_ ) != number_of_qubits:
      raise ValueError("""number of qubits must be exact integer.""" )
   if number_of_qubits > 1_0:
      raise ValueError("""number of qubits too large to simulate(>10).""" )

   UpperCAmelCase      					=  QuantumRegister(lowerCAmelCase_	,    """qr""" )
   UpperCAmelCase      					=  ClassicalRegister(lowerCAmelCase_	,    """cr""" )

   UpperCAmelCase      					=  QuantumCircuit(lowerCAmelCase_	,    lowerCAmelCase_ )

   UpperCAmelCase      					=  number_of_qubits

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

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

   # measure all the qubits
   quantum_circuit.measure(lowerCAmelCase_	,    lowerCAmelCase_ )
   # simulate with 10000 shots
   UpperCAmelCase      					=  Aer.get_backend("""qasm_simulator""" )
   UpperCAmelCase      					=  execute(lowerCAmelCase_	,    lowerCAmelCase_	,    shots=1_0_0_0_0 )

   return job.result().get_counts(lowerCAmelCase_ )


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







from __future__ import annotations

import math
def 	_UpperCamelCase					(    lowerCAmelCase_ )    ->bool:

   if 1 < number < 4:
      # 2 and 3 are primes
      return True
   elif number < 2 or number % 2 == 0 or number % 3 == 0:
      # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
      return False

   # All primes number are in format of 6k +/- 1
   for i in range(5	,    int(math.sqrt(lowerCAmelCase_ ) + 1 )	,    6 ):
      if number % i == 0 or number % (i + 2) == 0:
         return False
   return True


__a	 =      [num for num in range(3, 10_0001, 2) if not is_prime(num)]
def 	_UpperCamelCase					(    lowerCAmelCase_ )    ->list[int]:
   if not isinstance(lowerCAmelCase_	,    lowerCAmelCase_ ):
      raise ValueError("""n must be an integer""" )
   if n <= 0:
      raise ValueError("""n must be >= 0""" )

   UpperCAmelCase      					=  []
   for num in range(len(lowerCAmelCase_ ) ):
      UpperCAmelCase      					=  0
      while 2 * i * i <= odd_composites[num]:
         UpperCAmelCase      					=  odd_composites[num] - 2 * i * i
         if is_prime(lowerCAmelCase_ ):
            break
         i += 1
      else:
         list_nums.append(odd_composites[num] )
         if len(lowerCAmelCase_ ) == n:
            return list_nums

   return []
def 	_UpperCamelCase					(    )    ->int:
   return compute_nums(1 )[0]


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



