"""simple docstring"""





import math

import qiskit


def       lowercase_      (      _lowerCamelCase:		List[str] = 1  ,      _lowerCamelCase:		Union[str, Any] = 1  ,      _lowerCamelCase:		List[Any] = 1					)       ->					qiskit.result.counts.Counts:



							'''simple docstring'''

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

							__lowerCamelCase    :						Optional[int]						      =   qiskit.QuantumCircuit(_SCREAMING_SNAKE_CASE  ,      _SCREAMING_SNAKE_CASE					)

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

							__lowerCamelCase    :						Dict						      =   qiskit.Aer.get_backend("aer_simulator"					)
							__lowerCamelCase    :						Dict						      =   qiskit.execute(_SCREAMING_SNAKE_CASE  ,      _SCREAMING_SNAKE_CASE  ,      shots=1000					)

							return job.result().get_counts(_SCREAMING_SNAKE_CASE					)


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






"""simple docstring"""





import math
def  __A   (_SCREAMING_SNAKE_CASE			)					->int:





  """simple docstring"""


  if not isinstance(_SCREAMING_SNAKE_CASE     ,   _SCREAMING_SNAKE_CASE			):
    lowerCAmelCase__			:Dict											=							F"Input value of [number={number}] must be an integer"
    raise TypeError(_SCREAMING_SNAKE_CASE			)

  if number < 1:
    lowerCAmelCase__			:Dict											=							F"Input value of [number={number}] must be > 0"
    raise ValueError(_SCREAMING_SNAKE_CASE			)
  elif number == 1:
    return 3
  elif number == 2:
    return 5
  else:
    lowerCAmelCase__			:Union[str, Any]											=							int(math.log(number // 3     ,   2			)			) + 2

    lowerCAmelCase__			:Optional[Any]											=							[3, 5]
    lowerCAmelCase__			:Optional[Any]											=							2
    lowerCAmelCase__			:List[str]											=							3
    for block in range(1     ,   _SCREAMING_SNAKE_CASE			):
      for _ in range(_SCREAMING_SNAKE_CASE			):
        proth_list.append(2 ** (block + 1) + proth_list[proth_index - 1]			)
        proth_index += 1
      increment *= 2

  return proth_list[number - 1]


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  for number in range(11):
    __A											=		0
    try:
      __A											=		proth(number)
    except ValueError:
      print(F'''ValueError: there is no {number}th Proth number''')
      continue

    print(F'''The {number}th Proth number: {value}''')
