# How to exactly implement Trotter-Suzuki formula on quantum computer

Recently, I am studying some topics related to product formula, and I am curious about how to implement such formula on real quantum devices. The $$(2k)$$-th order product formula can be witten as $$$$S_{2}(\lambda):=\prod_{j=1}^L \exp\left(\frac{\lambda}{2}H_j\right)\prod_{j=L}^1 \exp\left(\frac{\lambda}{2}H_{j}\right) \\ S_{2k}(\lambda):=S_{2k-2}(p_k \lambda)^2\,S_{2k-2}\left((1-4p_k)\lambda\right)\,S_{2k-2}(p_k\lambda)^2$$$$ with $$p_k:=1/(4-4^{1/(2k-1)})$$. Within this product formula, there is a $$p_k$$ term, which is an irrational number when we use the higher-order product formula.

My question is: can quantum computers exactly implement irrational numbers in reality? If yes, how to control the quantum gate with the degree in the value of irrational numbers? If not, does it means that we cannot exactly implement the higher-order product formula on the current real quantum device?

TL;DR: No, in practice quantum computers cannot implement irrational numbers exactly. However, this does not prevent us from realizing quantum gates and algorithms whose properties depend on irrationality of some of their parameters, because for all practical purposes sufficiently good approximations, rational or otherwise, are indistinguishable from the theoretical ideal.

## Physics is a science of approximations

Any physical experiment, including the execution of a quantum algorithm on a quantum computer, concludes with some type of measurement. Physical measurements are always affected by errors. This is unavoidable because we only control a small subset of all degrees of freedom in any given experimental system.

Moreover, by Dirichlet's approximation theorem, any irrational number can be approximated by rational numbers arbitrarily well. Therefore, we would need infinite precision to distinguish rational and irrational values of an input or output parameter in an experiment. This quickly leads to various singularities in experimental setup such as the need for a display of infinite area to present results or the need for infinite frequency radiation to measure arbitrarily small distances.

Thus, physics and technology rarely care whether a quantity is rational or irrational, because the two cases are generally indistinguishable in practice.

## Irrational numbers in quantum computing

Remarkably, there are situations in quantum computing where irrationality of a number plays a key role in a mathematical proof. This happens due to ubiquity of phase factors such as $$\exp(i\pi\alpha)$$ with $$\alpha\in\mathbb{R}$$. It is not hard to prove that if $$\alpha\in\mathbb{Q}$$ then repeatedly multiplying $$\exp(i\pi\alpha)$$ by itself results in a discrete subset of the complex unit circle. However, if $$\alpha\notin\mathbb{Q}$$ then repeatedly multiplying $$\exp(i\pi\alpha)$$ by itself results in a dense subset of the unit circle.

This has important consequences for universality and the choice of elementary operations for a quantum computer. We desire the ability to approximate any unitary, so for any given phase factor we need the ability to approximate all angles with arbitrary accuracy and therefore we need a way to synthesize a gate where the given phase factor is $$\exp(i\pi \alpha)$$ with $$\alpha$$ irrational.

Now, consider what happens when we fail at that goal and instead end up with $$\alpha'=p/q$$ for some $$p,q\in\mathbb{Z}$$. It turns out that if $$\alpha'$$ is a very close approximation of our irrational ideal value $$\alpha$$ then $$q$$ tends to be a very large integer. Consequently, even though repeated multiplications of $$\exp(i\pi\alpha')$$ don't generate a dense subset of the unit circle, they still produce very good approximations of all angles. Namely, the products approximate any angle to within $$\pi/q$$ which is very small since $$q$$ is very large.

## Approximate quantum state is good enough

Finally, note that in any quantum algorithm we produce a quantum state $$|\psi\rangle$$ and then sample from its associated probability distribution. In practice, we sample a finite number of times and therefore cannot distinguish the ideal $$|\psi\rangle$$ from any $$|\psi'\rangle$$ which approximates it sufficiently well in the $$L_2$$ norm. As a result, any practical realization which produces $$|\psi'\rangle$$ instead of $$|\psi\rangle$$ is sufficient for practical purposes.

Consequently, even though in the theoretical ideal certain quantum computational primitives call for the use of irrational parameters, in practice close approximations of those parameters, rational or otherwise, are sufficient for any practical realization of a quantum algorithm.

• I've got it. Thank you for your detailed and clear explanation!! Oct 25, 2021 at 13:32
• This is a really nice post, Adam. :) Oct 28, 2021 at 16:13
• There is an existing implementation of Suzuki-Trotter product formula in qiskit-terra repository: \qiskit\synthesis\evolution\suzuki_trotter.py. May 6 at 9:03