"""simple docstring"""







import math

import qiskit


def      __lowerCAmelCase(		__UpperCAmelCase = 1     ,__UpperCAmelCase = 1     ,__UpperCAmelCase = 1			):






	"""simple docstring"""





	if (
	    isinstance(__UpperCAmelCase     ,__UpperCAmelCase			)
	    or isinstance(__UpperCAmelCase     ,__UpperCAmelCase			)
	    or isinstance(__UpperCAmelCase     ,__UpperCAmelCase			)
	):
		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(__UpperCAmelCase			) != input_a)
	    or (math.floor(__UpperCAmelCase			) != input_a)
	    or (math.floor(__UpperCAmelCase			) != 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
	_lowercase :    Tuple							=							qiskit.QuantumRegister(4     ,'qr'			)
	_lowercase :    Dict							=							qiskit.ClassicalRegister(2     ,'cr'			)
	# list the entries
	_lowercase :    str							=							[input_a, input_a, carry_in]

	_lowercase :    Tuple							=							qiskit.QuantumCircuit(__UpperCAmelCase     ,__UpperCAmelCase			)

	for i in range(0     ,3			):
		if entry[i] == 2:
			quantum_circuit.h(__UpperCAmelCase			)  # for hadamard entries
		elif entry[i] == 1:
			quantum_circuit.x(__UpperCAmelCase			)  # for 1 entries
		elif entry[i] == 0:
			quantum_circuit.i(__UpperCAmelCase			)  # 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]     ,__UpperCAmelCase			)  # measure the last two qbits

	_lowercase :    List[Any]							=							qiskit.Aer.get_backend('aer_simulator'			)
	_lowercase :    List[str]							=							qiskit.execute(__UpperCAmelCase     ,__UpperCAmelCase     ,shots=1_000			)

	return job.result().get_counts(__UpperCAmelCase			)


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


"""simple docstring"""







from __future__ import annotations


def      __lowerCAmelCase(		__UpperCAmelCase			):






	"""simple docstring"""





	_lowercase :    Any							=							[True] * limit
	_lowercase :    Union[str, Any]							=							False
	_lowercase :    Any							=							False
	_lowercase :    List[Any]							=							True

	for i in range(3     ,int(limit**0.5 + 1			)     ,2			):
		_lowercase :    Optional[Any]							=							i * 2
		while index < limit:
			_lowercase :    int							=							False
			_lowercase :    Tuple							=							index + i

	_lowercase :    Optional[Any]							=							[2]

	for i in range(3     ,__UpperCAmelCase     ,2			):
		if is_prime[i]:
			primes.append(__UpperCAmelCase			)

	return primes


def      __lowerCAmelCase(		__UpperCAmelCase = 1_000_000			):






	"""simple docstring"""





	_lowercase :    Optional[Any]							=							prime_sieve(__UpperCAmelCase			)
	_lowercase :    int							=							0
	_lowercase :    List[Any]							=							0

	for i in range(len(__UpperCAmelCase			)			):
		for j in range(i + length     ,len(__UpperCAmelCase			)			):
			_lowercase :    List[Any]							=							sum(primes[i:j]			)
			if sol >= ceiling:
				break

			if sol in primes:
				_lowercase :    Optional[int]							=							j - i
				_lowercase :    Tuple							=							sol

	return largest


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



