Skip to content

Add focused Trotter ordering benchmark#75

Draft
AlbertLee125 wants to merge 1 commit into
lanl:fermion_hamilfrom
AlbertLee125:agent/trotter-benchmark
Draft

Add focused Trotter ordering benchmark#75
AlbertLee125 wants to merge 1 commit into
lanl:fermion_hamilfrom
AlbertLee125:agent/trotter-benchmark

Conversation

@AlbertLee125

Copy link
Copy Markdown
Collaborator

What changed

  • add a deterministic three-case fermionic-vs-JW Trotter benchmark runner;
  • add first- and second-order errors at 1, 2, 5, and 10 steps;
  • add 100 seeded random vertex orderings per decomposition;
  • record graph/color schedules, color-block commutators, nested-commutator proxies, state error, infidelity, and particle-number leakage;
  • add CSV summaries, a generated Markdown report, and notebook result exploration;
  • add regression tests and reproduction instructions; and
  • ignore the generated L-sweep molecular library so large intermediates cannot be staged accidentally.

Why

The existing full-library comparison showed that graph size, edge count, and color count did not predict Trotter error. This focused benchmark asks why the fermionic and direct JW decompositions differ by comparing coefficient-weighted commutators, order sensitivity, and particle-sector preservation on three representative Hamiltonians.

During validation, the earlier tensor reconstruction was also found to count raw antisymmetric tensor permutations as separate fermionic vertices. The new runner canonicalizes and combines normal-ordered monomials before Hermitian pairing, matching the convention in h2_fermionic.ipynb without importing OpenFermion. The legacy insight report now carries a correction notice for its structural graph counts.

Main findings

  • Canonicalization reduces the selected four-qubit fermionic graph from 23 vertices/32 edges to 13/12, and the selected six-qubit graphs from 55/360 to 28/90.
  • The two B-B six-qubit cases have identical graph topology and color schedules, but their basis-dependent coefficients reverse the preferred decomposition.
  • Block and nested-commutator norms track the winner in both selected six-qubit cases, while raw graph counts do not.
  • Many random orders beat the deterministic greedy colored order, showing that one colored schedule is not a robust proxy for the best attainable ordering.
  • Complete fermionic vertices preserve particle number under all sampled orders. Random individual JW-string orders can leak, although the observed leakage is much smaller than the spectral error.

Validation

  • ruff check run_trotter_benchmark.py summarize_trotter_results.py analysis/tests/test_trotter_benchmark.py
  • PYTHONPATH=.. pytest -q analysis/tests/test_trotter_benchmark.py — 5 passed
  • notebook JSON parsing and compilation of every code cell
  • exact tensor-to-JW reconstruction below 1e-8
  • canonical coefficients independently checked against OpenFermion for all three cases
  • a second seeded run reproduced every saved benchmark output byte-for-byte

Scope

This intentionally excludes fourth-order formulas, dense evolution across all eight-qubit cases, additional coloring algorithms, and gate-count/circuit-depth claims. Generated .dat, tensor, state, HDF5, and pickle intermediates are not included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant