


import math

import qiskit







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

							__snake_case						:     Dict									=  qiskit.QuantumCircuit(__lowerCamelCase				,      __lowerCamelCase      )

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

							__snake_case						:     Optional[int]									=  qiskit.Aer.get_backend("aer_simulator"      )
							__snake_case						:     int									=  qiskit.execute(__lowerCamelCase				,      __lowerCamelCase				,      shots=1_0_0_0      )

							return job.result().get_counts(__lowerCamelCase      )


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






from __future__ import annotations





def 		a__      (		_UpperCamelCase      :			int | float | str			,_UpperCamelCase      :			int | float | str				):
   if nth_term == "":
      return [""]
   __lowerCamelCase    				=     int(_UpperCamelCase				)
   __lowerCamelCase    				=     int(_UpperCamelCase				)
   __lowerCamelCase    				=     []
   for temp in range(int(_UpperCamelCase				)				):
      series.append(F"""1 / {pow(temp + 1			,int(_UpperCamelCase				)				)}""" if series else '''1'''				)
   return series


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  a_								=       int(input("""Enter the last number (nth term) of the P-Series"""))
  a_								=       int(input("""Enter the power for  P-Series"""))
  print("""Formula of P-Series => 1+1/2^p+1/3^p ..... 1/n^p""")
  print(p_series(nth_term, power))






