




"""simple docstring"""



import math

import qiskit







def   _SCREAMING_SNAKE_CASE       (							lowercase_ = 1      ,			lowercase_ = 1      ,			lowercase_ = 1						)						->		qiskit.result.counts.Counts:





	if (
	    isinstance(lowercase__      ,			lowercase__						)
	    or isinstance(lowercase__      ,			lowercase__						)
	    or isinstance(lowercase__      ,			lowercase__						)
	):
		raise TypeError("inputs must be integers."						)

	if (input_a < 0) or (input_a < 0) or (carry_in < 0):
		raise ValueError("inputs must be positive."						)

	if (
	    (math.floor(lowercase__						) != input_a)
	    or (math.floor(lowercase__						) != input_a)
	    or (math.floor(lowercase__						) != carry_in)
	):
		raise ValueError("inputs must be exact integers."						)

	if (input_a > 2) or (input_a > 2) or (carry_in > 2):
		raise ValueError("inputs must be less or equal to 2."						)

	# build registers
	A__	=    qiskit.QuantumRegister(4      ,			"qr"						)
	A__	=    qiskit.ClassicalRegister(2      ,			"cr"						)
	# list the entries
	A__	=    [input_a, input_a, carry_in]

	A__	=    qiskit.QuantumCircuit(lowercase__      ,			lowercase__						)

	for i in range(0      ,			3						):
		if entry[i] == 2:
			quantum_circuit.h(lowercase__						)  # for hadamard entries
		elif entry[i] == 1:
			quantum_circuit.x(lowercase__						)  # for 1 entries
		elif entry[i] == 0:
			quantum_circuit.i(lowercase__						)  # for 0 entries

    # build the circuit
	quantum_circuit.ccx(0      ,			1      ,			3						)  # ccx = toffoli gate
	quantum_circuit.cx(0      ,			1						)
	quantum_circuit.ccx(1      ,			2      ,			3						)
	quantum_circuit.cx(1      ,			2						)
	quantum_circuit.cx(0      ,			1						)

	quantum_circuit.measure([2, 3]      ,			lowercase__						)  # measure the last two qbits

	A__	=    qiskit.Aer.get_backend("aer_simulator"						)
	A__	=    qiskit.execute(lowercase__      ,			lowercase__      ,			shots=10_00						)

	return job.result().get_counts(lowercase__						)


if __name__ == "__main__":
						print(f'Total sum count for state is: {quantum_full_adder(1, 1, 1)}')











"""simple docstring"""



import random

from .binary_exp_mod import bin_exp_mod







def   _SCREAMING_SNAKE_CASE       (							lowercase_      ,			lowercase_=10_00						)						->		Optional[Any]:
 if n < 2:
  return False

 if n % 2 == 0:
  return n == 2

 # this means n is odd
 A__	=    n - 1
 A__	=    0
 while d % 2 == 0:
  d /= 2
  exp += 1

 # n - 1=d*(2**exp)
 A__	=    0
 while count < prec:
  A__	=    random.randint(2      ,			n - 1						)
  A__	=    bin_exp_mod(lowercase_      ,			lowercase_      ,			lowercase_						)
  if b != 1:
   A__	=    True
   for _ in range(lowercase_						):
    if b == n - 1:
     A__	=    False
     break
    A__	=    b * b
    b %= n
   if flag:
    return False
   count += 1
 return True


if __name__ == "__main__":
      SCREAMING_SNAKE_CASE    =	abs(int(input("Enter bound : ").strip()))
      print("Here's the list of primes:")
      print(", ".join(str(i) for i in range(n + 1) if is_prime_big(i)))





