Trotterized Hamiltonian simulation

Trotterization approximates Hamiltonian time evolution by applying exponentials of simpler terms:

\( H=\sum_{j=1}^{m}h_j, \qquad U(t)=e^{-iHt}. \)

Zixy Hamiltonians

Zixy stores a Hamiltonian as a sum of coefficient-weighted Pauli strings:

\( H=\sum_{j=1}^{m}a_jP_j, \qquad P_j\in\{I,X,Y,Z\}^{\otimes n}. \)

import zixy.qubit.pauli as zqp

pauli_string = zqp.String.from_str("Z0 X1", 2)
hamiltonian = zqp.RealTermSum.from_str(
    "(-0.5, Z0 X1), (-0.1, X0 Z1), (-0.2, Y0 Y1)"
)
  • zqp.String represents one tensor product of Pauli operators.

  • zqp.RealTermSum represents a Hermitian Pauli Hamiltonian by pairing those strings with real coefficients.

  • trotter_first_order converts every non-identity term into a Pauli exponential.

Pauli exponentials

pauli_exp constructs a Guppy function implementing a Pauli-string exponential:

\( U_P(\theta)=e^{-i\theta P/2}. \)

from guppyalgos.primitives.pauli.pauli_exp import cntrl_pauli_exp, pauli_exp

pauli_gadget = pauli_exp(pauli_string, n_qubits=2)
controlled_pauli_gadget = cntrl_pauli_exp(pauli_string, n_qubits=2)

The input may contain any tensor product of \(I\), \(X\), \(Y\), and \(Z\). Only its non-identity support participates in the parity ladder:

Pauli

Basis change before the parity ladder

\(I\)

None; this qubit is omitted from the ladder.

\(X\)

\(H\) maps \(X\) to \(Z\).

\(Y\)

Apply \(S^\dagger\), then \(H\), to map \(Y\) to \(Z\).

\(Z\)

None; it is already in the required basis.

For \(P = Z_0X_1\), the ordinary gadget is: