Abstract
Recently, there has been a growing literature exploring the generalization of quantum algorithms, such that different quantum algorithms are special examples of a more fundamental structure. In this short paper, we provide a general approach to describe quantum algorithms as a quantum state with amplitudes that are constructed from the expected value and standard deviation of each quantum gate or a sub-sequence of gates in the algorithm. The proposed statistical-based description relies on the celebrated Aharonov-Vaidman identity. We present a more fundamental identity that, unlike the previous one, allows us to switch the basis of the states into a desired form.