Skip to main content
KetQat

Appearance

Trotterized Ising dynamics (statevector)

Evolve a transverse-field Ising chain with a first- or second-order product formula and measure the error against exact dynamics.

Officially provided by KetQat — method by Trotter (1959), Suzuki (1976) and others. KetQat prepares, verifies and maintains this product; it does not claim to have invented the method. Read the origin statement.

What it does and who it is for

Simulates time evolution under the transverse-field Ising Hamiltonian H = -J sum Z_i Z_{i+1} - h sum X_i on your machine, two ways. The Trotter circuit (first-order Lie-Trotter or second-order Strang/Suzuki splitting) is applied gate by gate to the amplitudes of |0...0>; the exact state exp(-iHt)|0...0> is computed by diagonalising the dense Hamiltonian. The two paths share no code, so their difference is the Trotter error itself, measured rather than bounded. The product reports the fidelity between the two states, the survival probability and the average Z magnetisation on both, and optionally fits the exponent of the infidelity against the step count, which theory fixes at -2 for first order and -4 for second.

For students checking that product formulas converge at the rate the textbooks state, and for researchers who want an exact, reproducible reference for a small Hamiltonian-simulation circuit.

Use cases

  • Measure the Trotter error of a chosen step count and time against the exact evolution
  • Verify the first- and second-order convergence exponents from the fitted log-log slope
  • Compare Trotterized and exact observables (survival probability, magnetisation) on a small Ising chain

Use it on your computer

This page never runs anything. Copy the commands into your own terminal; the product runs locally with no account and no telemetry.
  1. Install

    Installs the KetQat SDK from commit 2cedabbd814f, the exact version whose product definition this page shows. The SDK is not on PyPI yet, so pip install ketqat alone will not work.

    Terminal
    pip install "ketqat[algorithms] @ git+https://github.com/ketqat/ketqat-sdk@2cedabbd814fd199b1989c8ceb1e9efa1744c2c0#subdirectory=python"
  2. Run the example

    Save it as example.py and run python example.py. Or use the CLI: ketqat catalog run [email protected].

    Python
    import json
    from ketqat_runner import catalog
    
    record = catalog.run("[email protected]", seed=7, qubits=4, time=1.0, steps=10, order=1)
    result = record.result
    print(json.dumps({
        "status": record.status,
        "fidelity": round(result["fidelity"], 6),
        "survival_probability_exact": round(result["observables"]["survival_probability"]["exact"], 6),
        "fitted_slope": round(result["scaling"]["slope"], 2),
        "expected_slope": result["scaling"]["expected_slope"],
    }))
    
    Expected output (fields the example must print)
    {
      "status": "succeeded",
      "fidelity": 0.995078,
      "fitted_slope": -2.03,
      "expected_slope": -2,
      "survival_probability_exact": 0.210729
    }

    Verified with

    SDK
    0.3.0
    Python
    3.12.12
    Platform
    macOS-27.0.1-arm64 Python 3.12.12 (maintainer run in a clean virtualenv, test_catalog_examples.py)
    Date
    1 Nov 2026
  3. Optional: tell us it ran

    ketqat report RUN_ID sends an opt-in usage report: product, version, succeeded/failed, time and SDK version only. It shows you the exact payload first and needs an API token from Settings. Nothing is sent unless you run it.

Inputs and outputs

Inputs

Inputs of Trotterized Ising dynamics (statevector)
NameTypeDefaultAllowed valuesDescription
qubitsinteger4maximum: 12; minimum: 1Chain length n. The dense 2^n x 2^n Hamiltonian is diagonalised, so requests above 10 qubits are refused with the memory they would need.
couplingnumber1maximum: 100; minimum: -100J, the Z Z coupling.
fieldnumber1maximum: 100; minimum: -100h, the transverse field.
timenumber1maximum: 100; minimum: 0Evolution time t.
stepsinteger10maximum: 10000; minimum: 1Trotter steps r; each step evolves by t/r.
orderinteger1enum: 1, 21 for Lie-Trotter, 2 for the symmetric Strang (Suzuki) splitting.
periodicbooleanfalse—Close the chain into a ring (adds the bond between the last and first qubit; a 2-site ring is left open).
fit_scalingbooleantrue—Also evolve at each of scaling_step_counts and fit the log-log slope of infidelity against steps.
scaling_step_countsinteger[][4,8,16,32,64]minItems: 2; itemMaximum: 10000; itemMinimum: 1; uniqueItems: trueStep counts for the scaling fit.

Outputs

Outputs of Trotterized Ising dynamics (statevector)
NameTypeDescription
fidelitynumber|<exact|trotter>|^2 between the Trotterized and the exact state at time t; infidelity is 1 minus it.
state_distancenumberNorm of the difference between the two states, up to a global phase.
observablesobjectsurvival_probability (|<0...0|psi(t)>|^2) and average_magnetization_z ((1/n) sum <Z_i>), each on the Trotter and the exact state.
scalingobjectWhen fit_scaling: step_counts, infidelities, the fitted slope, expected_slope (-2 or -4) and the intercept; null with scaling_note when the terms commute and there is no error to fit.

Sample result

4-qubit chain, J = h = 1, t = 1, 10 first-order steps: fidelity 0.995078 with the exact state (survival probability 0.2088 Trotter vs 0.2107 exact); the infidelity over 4..64 steps fits a slope of -2.03 against the theoretical -2.

Generated with

Product version
1.0.0
Seed
7
Parameters
{"time":1,"field":1,"order":1,"steps":10,"qubits":4,"coupling":1,"periodic":false,"fit_scaling":true,"scaling_step_counts":[4,8,16,32,64]}
SDK
0.3.0
Python
3.12.12
Platform
macOS-27.0.1-arm64-arm-64bit
Result data (JSON)
{
  "time": 1,
  "field": 1,
  "model": "H = -J sum_<i,j> Z_i Z_j - h sum_i X_i",
  "order": 1,
  "steps": 10,
  "qubits": 4,
  "scaling": {
    "note": "Infidelity ~ steps^-2.03. Theory gives amplitude error O(t^2/steps^1), and infidelity is its square, so the expected slope is -2.",
    "slope": -2.02771039075,
    "intercept": -0.625421648931,
    "step_counts": [
      4,
      8,
      16,
      32,
      64
    ],
    "infidelities": [
      0.032899952131,
      0.007752494869,
      0.001904256842,
      0.000473393413,
      0.000118112715
    ],
    "expected_slope": -2
  },
  "coupling": 1,
  "fidelity": 0.995078196614,
  "periodic": false,
  "execution": "statevector simulation of the Trotter circuit; exact reference by dense eigendecomposition",
  "reference": "exp(-iHt) by eigendecomposition, exact up to floating point",
  "splitting": "first-order Lie-Trotter: exp(-iH_ZZ dt) exp(-iH_X dt) per step",
  "infidelity": 0.004921803386,
  "observables": {
    "survival_probability": {
      "exact": 0.21072880398,
      "trotter": 0.208798179005
    },
    "average_magnetization_z": {
      "exact": 0.135077479856,
      "trotter": 0.132944995786
    }
  },
  "scaling_note": null,
  "initial_state": "|0...0> (all spins up along Z)",
  "state_distance": 0.070198820305
}

Assumptions, scope and limitations

Assumptions

  • Ideal, noiseless gates: exp(i J dt Z Z) and exp(i h dt X) are applied exactly to the amplitudes; only the splitting of H into its two non-commuting parts is approximate.
  • The initial state is |0...0> (all spins up along Z); open boundary unless periodic=true.
  • The exact reference is exp(-iHt) by eigendecomposition of the dense Hamiltonian, exact up to floating point.

Scope

  • Transverse-field Ising chains or rings of 1 to 10 qubits, any real J, h and t in the declared ranges, 1 to 10000 steps, first or second order.
  • Fidelity, state distance, two observables on both states, and the fitted convergence exponent.

Limitations

  • One Hamiltonian family only; general Pauli Hamiltonians and higher-order (Suzuki 4+) formulas are not offered.
  • Dense diagonalisation caps the product at 10 qubits; it says nothing about hardware cost, gate counts or noise.
  • The fitted slope is reliable only in the asymptotic regime: with very few steps or very long times the infidelity saturates and the slope departs from -2 or -4.
  • When J or h is zero the terms commute, the splitting is exact and no scaling fit is possible; the result says so instead of fitting zero.
  • Tested on macOS and Linux only; Windows is untested.

Environment and resources

Runs
Locally, on your computer
Type
Simulation
Python
>=3.10
Operating systems
Linux, macOS
Resources
4 qubits with the scaling fit: ~0.05 s. 8 qubits: ~0.3 s. 10 qubits: ~10 s (six eigendecompositions of a 1024x1024 matrix, 16 MiB) on a 2024 laptop. 11 and 12 qubits are refused: the dense Hamiltonian would need 64-256 MiB and about 1 GB of workspace to diagonalise.
SDK extras
algorithms
Minimum SDK
0.3.0

Validation

Verified: the example was executed by CI, validation tests exist and limitations are recorded.

Versions and changelog

  1. 1.0.01 Nov 2026currentShown on this page

    • First catalog release, wrapping the SDK's existing Trotter-Ising simulation with observables and a resource ceiling.

    Needs SDK 0.3.0 or later with extras: algorithms.

All product changelogs

Origin, license and credits

KetQat implementation of published methods

The product formula is due to Trotter (1959) and its symmetric higher-order generalisation to Suzuki (1976); their use for simulating quantum dynamics on a quantum computer was proposed by Lloyd (1996), and the error theory is reviewed by Childs, Su, Tran, Wiebe and Zhu (2021). KetQat wrote this NumPy implementation (trotter.py), the exact eigendecomposition reference, the scaling fit, the validation tests and this catalog entry. KetQat did not invent the method.

Upstream software

License of what you receive

Apache-2.0 — see Licensing.

Contributors

People credited for this product. KetQat publishes and maintains it; contributors are credited for their work and are not sellers.

  • dorakingx · KetQat maintainer: implementation, validation and catalog entry

How to contribute

References

  1. H. F. Trotter (1959). On the product of semi-groups of operators. Proceedings of the American Mathematical Society 10, 545-551.
  2. Masuo Suzuki (1976). Generalized Trotter's formula and systematic approximants of exponential operators and inner derivations with applications to many-body problems. Communications in Mathematical Physics 51, 183-190.
  3. Seth Lloyd (1996). Universal Quantum Simulators. Science 273, 1073-1078.DOI 10.1126/science.273.5278.1073
  4. Andrew M. Childs, Yuan Su, Minh C. Tran, Nathan Wiebe, Shuchen Zhu (2021). Theory of Trotter Error with Commutator Scaling. Physical Review X 11, 011020.DOI 10.1103/PhysRevX.11.011020arXiv:1912.08854

Usage

No usage reports yet

Distinct signed-in accounts that chose to send at least one usage report (ketqat report) for this product in the last 90 days. KetQat staff, test and bot accounts are excluded. Reports are opt-in, so this is not a count of all users.

Computed 10 Nov 2026, 17:34 UTC.

Reviews

Not yet rated

Be the first to rate this product after you run it.

Mean of visible reviews. Hidden reviews and reviews by KetQat staff, test and bot accounts are excluded. Pro status gives no extra weight.

Sign in to review this product. One review per person; you can edit it later.

No reviews yet.