



'''simple docstring'''





import random





class 							lowerCAmelCase_		:





    def __init__(    self    :    List[str],    _snake_case    :    float,    _snake_case    :    float     ):



       '''simple docstring'''







       snake_case   :							Tuple						  =x
       snake_case   :							Optional[Any]						  =y





    def 					__snake_case       (    self    :    Optional[Any]     ):



       '''simple docstring'''







       return (self.x**2 + self.y**2) <= 1






    @classmethod
    def 					__snake_case       (    cls    :    Optional[Any]     ):



       '''simple docstring'''







       return cls(x=random.random(),    y=random.random()     )




def 		_a   (  lowerCamelCase_							):



   if number_of_simulations < 1:
      raise ValueError('''At least one simulation is necessary to estimate PI.'''							)

   snake_case   :							Optional[Any]						  =0
   for _ in range(UpperCamelCase_							):
      snake_case   :							Tuple						  =Point.random_unit_square()

      if random_point.is_in_unit_circle():
         number_in_unit_circle += 1

   return 4 * number_in_unit_circle / number_of_simulations


if __name__ == "__main__":
      # import doctest

      # doctest.testmod()
      from math import pi

      A			:   str			=      "Please enter the desired number of Monte Carlo simulations: "
      A			:   Union[str, Any]			=      estimate_pi(int(input(prompt).strip()))
      print(f"An estimate of PI is {my_pi} with an error of {abs(my_pi - pi)}")






'''simple docstring'''





import doctest

import projectq
from projectq.ops import H, Measure
def 		_a   (  lowerCamelCase_							):
   snake_case   :							str						  =quantum_engine.allocate_qubit()
   H | qubit
   Measure | qubit
   return int(lowerCamelCase_							)


if __name__ == "__main__":
      doctest.testmod()

      # initialises a new quantum backend
      A			:   Dict			=      projectq.MainEngine()

      # Generate a list of 10 random numbers
      A			:   Dict			=      [get_random_number(quantum_engine) for _ in range(10)]

      # Flushes the quantum engine from memory
      quantum_engine.flush()

      print("""Random numbers""", random_numbers_list)





