
"""simple docstring"""







from __future__ import annotations

from decimal import Decimal
from math import *  # noqa: F403

from sympy import diff
def    __lowerCAmelCase    (_UpperCamelCase	,  _UpperCamelCase	,  _UpperCamelCase = 10**-10		):
	__lowerCAmelCase      :						Dict						      =				a
	while True:
		__lowerCAmelCase      :						List[str]						      =				Decimal(_UpperCamelCase		) - (
		    Decimal(eval(_UpperCamelCase		)		) / Decimal(eval(str(diff(_UpperCamelCase		)		)		)		)  # noqa: S307
		)
		# This number dictates the accuracy of the answer
		if abs(eval(_UpperCamelCase		)		) < precision:  # noqa: S307
			return float(_UpperCamelCase		)


# Let's Execute
if __name__ == "__main__":
							# Find root of trigonometric function
							# Find value of pi
							print(f'The root of sin(x) = 0 is {newton_raphson("sin(x)", 2)}')
							# Find root of polynomial
							print(f'The root of x**2 - 5*x + 2 = 0 is {newton_raphson("x**2 - 5*x + 2", 0.4)}')
							# Find Square Root of 5
							print(f'The root of log(x) - 1 = 0 is {newton_raphson("log(x) - 1", 2)}')
							# Exponential Roots
							print(f'The root of exp(x) - 1 = 0 is {newton_raphson("exp(x) - 1", 0)}')

"""simple docstring"""







import qiskit
def    __lowerCAmelCase    (_UpperCamelCase	,  _UpperCamelCase		):
	__lowerCAmelCase      :						Union[str, Any]						      =				qiskit.Aer.get_backend('aer_simulator'		)

	# Create a Quantum Circuit acting on the q register
	__lowerCAmelCase      :						str						      =				qiskit.QuantumCircuit(_UpperCamelCase	,  _UpperCamelCase		)

	# Map the quantum measurement to the classical bits
	circuit.measure([0]	,  [0]		)

	# Execute the circuit on the simulator
	__lowerCAmelCase      :						Optional[int]						      =				qiskit.execute(_UpperCamelCase	,  _UpperCamelCase	,  shots=1000		)

	# Return the histogram data of the results of the experiment.
	return job.result().get_counts(_UpperCamelCase		)


if __name__ == "__main__":
							print(f'Total count for various states are: {single_qubit_measure(1, 1)}')