




'''simple docstring'''


import math

import qiskit
from qiskit import Aer, ClassicalRegister, QuantumCircuit, QuantumRegister, execute
def 				SCREAMING_SNAKE_CASE(      __lowercase = 1		,							__lowercase = 1  ) ->   qiskit.result.counts.Counts:
     if isinstance(__lowercase		,							__lowercase  ) or isinstance(__lowercase		,							__lowercase  ):
          raise TypeError('''inputs must be integers.'''  )
     if (bit_a < 0) or (bit_a < 0):
          raise ValueError('''inputs must be positive.'''  )
     if (math.floor(__lowercase  ) != bit_a) or (math.floor(__lowercase  ) != 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:		Optional[Any]        =		QuantumRegister(2		,							'''qr'''  )
     A:		List[str]        =		ClassicalRegister(2		,							'''cr'''  )

     A:		List[Any]        =		QuantumCircuit(__lowercase		,							__lowercase  )

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

     # send the information
     A:		Optional[Any]        =		str(__lowercase  ) + str(__lowercase  )

     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(__lowercase		,							__lowercase  )

     A:		str        =		Aer.get_backend('''aer_simulator'''  )
     A:		List[str]        =		execute(__lowercase		,							__lowercase		,							shots=1_0_0_0  )

     return job.result().get_counts(__lowercase  )


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












'''simple docstring'''


def 				SCREAMING_SNAKE_CASE(      __lowercase		,							__lowercase		,							__lowercase  ) ->   float:
     A:		str        =		[1 / first_term]
     A:		Optional[int]        =		1 / first_term
     for _ in range(number_of_terms - 1  ):
          first_term += common_difference
          arithmetic_progression.append(__lowercase  )
     A:		int        =		[1 / step for step in arithmetic_progression]
     return sum(__lowercase  )


if __name__ == "__main__":
     import doctest

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






