


from __future__ import annotations

import math
from collections.abc import Callable







def        SCREAMING_SNAKE_CASE_						(			__A :			Callable[[int | float], int | float]  ,    __A :			int | float  ,    __A :			int | float  ,    __A :			int = 1_00  ,    )	->		float:

       """simple docstring"""

       a_					:		Optional[Any]							=  x_start
       a_					:		List[str]							=  fnc(__A				)
       a_					:		str							=  0.0

       for _ in range(__A				):
              # Approximates curve as a sequence of linear lines and sums their length
              a_					:		List[str]							=  (x_end - x_start) / steps + xa
              a_					:		List[Any]							=  fnc(__A				)
              length += math.hypot(xa - xa  ,    fxa - fxa				)

              # Increment step
              a_					:		Optional[int]							=  xa
              a_					:		int							=  fxa

       return length


if __name__ == "__main__":







   def        SCREAMING_SNAKE_CASE_						(			__A :			Union[str, Any]				)	->		Any:

          """simple docstring"""

          return math.sin(10 * x				)

   print('f(x) = sin(10 * x)')
   print('The length of the curve from x = -10 to x = 10 is:')
   UpperCAmelCase_      : List[str]  					=       10
   while i <= 10_0000:
      print(F'With {i} steps: {line_length(f, -10, 10, i)}')
      i *= 10



import math

import qiskit



def lowerCamelCase  (   SCREAMING_SNAKE_CASE = 1  ,			SCREAMING_SNAKE_CASE = 1  ,			SCREAMING_SNAKE_CASE = 1	):
    '''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
    __UpperCamelCase     :List[str]			  =		qiskit.QuantumRegister(4  ,			'''qr'''	)
    __UpperCamelCase     :str			  =		qiskit.ClassicalRegister(2  ,			'''cr'''	)
    # list the entries
    __UpperCamelCase     :Tuple			  =		[input_a, input_a, carry_in]

    __UpperCamelCase     :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

    __UpperCamelCase     :Optional[Any]			  =		qiskit.Aer.get_backend('''aer_simulator'''	)
    __UpperCamelCase     :Tuple			  =		qiskit.execute(SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE  ,			shots=1_000	)

    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)}')





