


'''simple docstring'''






import math

import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute






def 						_A					(lowerCAmelCase__	:Optional[int] = 1					,    lowerCAmelCase__	:List[Any] = 1		) ->	qiskit.result.counts.Counts:




     '''simple docstring'''



     if isinstance(_UpperCAmelCase					,    _UpperCAmelCase		) or isinstance(_UpperCAmelCase					,    _UpperCAmelCase		):
          raise TypeError('inputs must be integers.'		)
     if (bit_a < 0) or (bit_a < 0):
          raise ValueError('inputs must be positive.'		)
     if (math.floor(_UpperCAmelCase		) != bit_a) or (math.floor(_UpperCAmelCase		) != bit_a):
          raise ValueError('inputs must be exact integers.'		)
     if (bit_a > 1) or (bit_a > 1):
          raise ValueError('inputs must be less or equal to 1.'		)

     # build registers
     _a         =				QuantumRegister(2					,    'qr'		)
     _a         =				ClassicalRegister(2					,    'cr'		)

     _a         =				QuantumCircuit(_UpperCAmelCase					,    _UpperCAmelCase		)

     # entanglement the qubits
     quantum_circuit.h(1		)
     quantum_circuit.cx(1					,    0		)

     # send the information
     _a         =				str(_UpperCAmelCase		) + str(_UpperCAmelCase		)

     if c_information == "11":
          quantum_circuit.x(1		)
          quantum_circuit.z(1		)
     elif c_information == "10":
          quantum_circuit.z(1		)
     elif c_information == "01":
          quantum_circuit.x(1		)
     else:
          quantum_circuit.i(1		)

     # unentangled the circuit
     quantum_circuit.cx(1					,    0		)
     quantum_circuit.h(1		)

     # measure the circuit
     quantum_circuit.measure(_UpperCAmelCase					,    _UpperCAmelCase		)

     _a         =				Aer.get_backend('aer_simulator'		)
     _a         =				execute(_UpperCAmelCase					,    _UpperCAmelCase					,    shots=10_00		)

     return job.result().get_counts(_UpperCAmelCase		)


if __name__ == "__main__":
 print(f'''Counts for classical state send: {superdense_coding(1,1)}''')








"""simple docstring"""


def 				a__      (	_UpperCAmelCase						,  _UpperCAmelCase						,  _UpperCAmelCase						)     ->	float:

 '''simple docstring'''






 snake_case__     				=					[1 / first_term]
 snake_case__     				=					1 / first_term
 for _ in range(number_of_terms - 1						):
  first_term += common_difference
  arithmetic_progression.append(_UpperCAmelCase						)
 snake_case__     				=					[1 / step for step in arithmetic_progression]
 return sum(_UpperCAmelCase						)


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   print(sum_of_harmonic_progression(1 / 2, 2, 2))

