iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
📈

Exploring the Trotter Product Formula

に公開

Purpose

I want to verify the points discussed in a somewhat scattered manner in the article Trotter's Product Formula.

Review

For matrices A and B,

\begin{align*} \exp \left(\frac{A + B}{n}\right) \simeq \exp \left(\frac{A}{n}\right) \exp \left(\frac{B}{n}\right) \tag{1} \end{align*}

holds, and the error can be estimated as \mathcal{O}\left(1/n^2\right).

Let's try some calculations

As simple non-commutative matrices, let's use Pauli matrices, which are frequently encountered in quantum mechanics and quantum computing.

\begin{align*} X &= \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \\ Z &= \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} \\ \end{align*}

In fact, since XZ = \begin{pmatrix} 0 & -1 \\ 1 & 0\end{pmatrix} \neq \begin{pmatrix} 0 & 1 \\ -1 & 0\end{pmatrix} = ZX, these matrices are non-commutative, but it appears that (1) still holds. Let's try it with NumPy right away.

To calculate the matrix exponential, we will use SciPy's expm.

import numpy as np
from scipy.linalg import expm

And then

X = np.array([
    [0, 1],
    [1, 0]
])
Y = np.array([
    [1, 0],
    [0, -1]
])

Define the matrices. To calculate the error, we use the matrix norm; for A = (a_{ij}), we use:

\begin{align*} \| A \| = \left(\sum_{i,j} |a_{ij}|^2\right)^{1/2} \end{align*}

[1].

In the following code, the matrix exponential is calculated, and the difference is output in the form of \| A - B\|^2 \times n^2. If the theory holds, we can expect to see something like a constant value.

for n in [3, 5, 10, 50, 100, 500]:
    A = expm((X+Y)/n)
    B = expm(X/n)@expm(Y/n)
    print(A)
    print(B)
    print('diff * n^2:', np.sqrt(np.sum((A-B)**2)) * n**2)
    print('-'*30)

Running it results in the following:

[[1.45900094 0.34581691]
 [0.34581691 0.76736711]]
[[1.47386702 0.24329144]
 [0.47386702 0.75670856]]
diff * n^2: 1.4854883068493039
------------------------------
[[1.24294473 0.20267735]
 [0.20267735 0.83759003]]
[[1.24591235 0.16483998]
 [0.24591235 0.83516002]]
diff * n^2: 1.4395406249247398
------------------------------
[[1.11035034 0.10033367]
 [0.10033367 0.90968301]]
[[1.11070138 0.09063462]
 [0.11070138 0.90936538]]
diff * n^2: 1.4205105293677018
------------------------------
[[1.02040269 0.02000267]
 [0.02000267 0.98039736]]
[[1.02040539 0.01960528]
 [0.02040539 0.98039472]]
diff * n^2: 1.414464996624932
------------------------------
[[1.01010034 0.01000033]
 [0.01000033 0.99009967]]
[[1.01010067 0.00990066]
 [0.01010067 0.99009934]]
diff * n^2: 1.4142764174658962
------------------------------
[[1.002004 0.002   ]
 [0.002    0.998004]]
[[1.00200401 0.00199601]
 [0.00200401 0.99800399]]
diff * n^2: 1.4142160765324245

The result is as follows. It seems that approximately \| \exp \left(\frac{X + Y}{n}\right) - \exp \left(\frac{X}{n}\right) \exp \left(\frac{Y}{n}\right) \|^2 \approx \frac{1.4}{n^2} holds.

Summary

I simply calculated a specific case using SciPy, but it's interesting to see results that align with the theory. Also, to be honest, I was a bit skeptical deep down, so it was good to get calculation results that strengthened my confidence.

Supplement

If we set A = -iX, B = -iZ and write \varepsilon = 1/n, then (1) takes the form:

\begin{align*} \exp (-i \varepsilon X) \exp (-i \varepsilon Z) \simeq \exp ( -i \varepsilon (X+Z) ) \simeq \exp (-i \varepsilon Z) \exp (-i \varepsilon X) \end{align*}

According to the reference [NC2], R_x(\theta) = \exp (-i\theta X) and R_z(\theta) = \exp (-i\theta Z) are rotation gates around the X and Z axes by \theta, respectively. This suggests that when \varepsilon is sufficiently small, these infinitesimal rotations can be treated as if they were commutative, ignoring terms of order \varepsilon^2 and higher. In fact, they match up to the first-order term of \varepsilon.

I don't intend to delve any deeper this time, but I think it's interesting how restating the same formula in different words or situations can add to its depth.

References

[NC2] M. A. Nielsen, I. L. Chuang, Quantum Computation and Quantum Information II, p.8, Ohmsha, 2005

脚注
  1. Norms on finite-dimensional vector spaces are equivalent to each other, so I chose one that is easy to use for observing the order. ↩︎

GitHubで編集を提案

Discussion