setup_lse

setup_lse(trotter_steps, *, order=1, symmetric=False)[source]

Return the linear system of equations for computing the static MPF coefficients.

This function constructs the following linear system of equations:

\[A x = b,\]

with

\[\begin{split}A_{0,j} &= 1 \\ A_{i>0,j} &= k_{j}^{-(\chi + s(i-1))} \\ b_0 &= 1 \\ b_{i>0} &= 0\end{split}\]

where $\chi$ is the order, $s$ is $2$ if symmetric is True and $1$ oterhwise, $k_{j}$ are the trotter_steps, and $x$ are the variables to solve for. The indices $i$ and $j$ start at $0$.

Here is an example:

>>> from qiskit_addon_mpf.static import setup_lse
>>> lse = setup_lse([1,2,3], order=2, symmetric=True)
>>> print(lse.A)
[[1.         1.         1.        ]
 [1.         0.25       0.11111111]
 [1.         0.0625     0.01234568]]
>>> print(lse.b)
[1. 0. 0.]
Parameters:
  • trotter_steps (list[int] | Parameter) – the sequence of trotter steps from which to build $A$. Rather than a list of integers, this may also be a Parameter instance of the desired size. In this case, the constructed LSE is parameterized whose values must be assigned before it can be solved.

  • order (int) – the order of the individual product formulas making up the MPF.

  • symmetric (bool) – whether the individual product formulas making up the MPF are symmetric. For example, the Lie-Trotter formula is not symmetric, while Suzuki-Trotter is.

Returns:

An LSE.

Return type:

LSE