


import doctest

import projectq
from projectq.ops import H, Measure
def        __lowerCamelCase		(				UpperCAmelCase_		):




      """simple docstring"""





      a		:Optional[Any]											= quantum_engine.allocate_qubit()
      H | qubit
      Measure | qubit
      return int(UpperCAmelCase_		)


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

     # initialises a new quantum backend
     snake_case       :					Optional[Any]        =  projectq.MainEngine()

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

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

     print('''Random numbers''', random_numbers_list)









import numpy as np
def        __lowerCamelCase		(				UpperCAmelCase_		:	Optional[Any]		):




      """simple docstring"""





      a							,       a		:Union[str, Any]											= a.shape
      a		:Any											= min(UpperCAmelCase_				,						UpperCAmelCase_		)
      a		:Tuple											= np.eye(UpperCAmelCase_		)
      a		:Any											= a.copy()

      for k in range(t - 1		):
            # select a column of modified matrix A':
            a		:List[str]											= r[k:, [k]]
            # construct first basis vector
            a		:List[str]											= np.zeros_like(UpperCAmelCase_		)
            a		:List[Any]											= 1.0
            # determine scaling factor
            a		:Union[str, Any]											= np.linalg.norm(UpperCAmelCase_		)
            # construct vector v for Householder reflection
            a		:List[str]											= x + np.sign(x[0]		) * alpha * ea
            v /= np.linalg.norm(UpperCAmelCase_		)

            # construct the Householder matrix
            a		:Union[str, Any]											= np.eye(m - k		) - 2.0 * v @ v.T
            # pad with ones and zeros as necessary
            a		:Tuple											= np.block([[np.eye(UpperCAmelCase_		), np.zeros((k, m - k)		)], [np.zeros((m - k, k)		), q_k]]		)

            a		:List[Any]											= q @ q_k.T
            a		:int											= q_k @ r

      return q, r


if __name__ == "__main__":
     import doctest

     doctest.testmod()





