Skip to content

Implement TS-native Trotter truncation - #103

Draft
Anshhhhh-chand wants to merge 1 commit into
nicolasloizeau:mainfrom
Anshhhhh-chand:fix-ts-trotter
Draft

Implement TS-native Trotter truncation#103
Anshhhhh-chand wants to merge 1 commit into
nicolasloizeau:mainfrom
Anshhhhh-chand:fix-ts-trotter

Conversation

@Anshhhhh-chand

Copy link
Copy Markdown

Resolves #78

Description

The current implementation of Trotter time evolution for translation-symmetric (OperatorTS) objects significantly underperforms RK4 because it truncates in the standard Operator space. In standard space, each retained term represents only a single Pauli string. By contrast, RK4 works naturally in TS space, where each retained term implicitly represents the entire orbit ($N$ physical strings).

This PR solves this discrepancy by changing where the truncation happens while perfectly preserving the mathematically-optimal second-order Strang splitting.

Changes Made

  1. TS-Aware Truncation (src/evolution.jl):
    • _evolve(::Trotter, ...) for OperatorTS now applies trotter_step! without internal intermediate truncation.
    • Truncation now only occurs after the operator is folded back to OperatorTS at the end of the full time step.
    • This ensures the truncation method naturally operates on full translation orbits, recovering the $N\times$ information advantage without introducing non-symmetric intermediate errors.
  2. Convenience Abstraction (src/trotter.jl):
    • Added a trotterize dispatch for OperatorTS that automatically expands the Hamiltonian via resum(H) internally. This allows it to cleanly build the mathematically required continuous sequence of Strang gates.
  3. Tests (test/trotter.jl):
    • Added explicit tests validating that trotterize on an OperatorTS correctly maps to the exact gate sequence of the expanded Operator.
    • Verified trotter_step! interactions with an empty gate sequence over OperatorTS.

Why this is the correct approach

This approach bypasses the mathematical pitfall discussed in PR #95 where re-symmetrizing intermediate states between non-commuting gate terms introduces critical O(dt) errors that break the second-order accuracy. Instead, this implementation relies on the continuous application of the exact gate sequence followed by end-of-step OperatorTS truncation, guaranteeing rigorous continuous symmetry scaling.

All CI checks and the rigorous < 1e-4 precision bound test/evolution.jl suites pass successfully.

@nicolasloizeau

Copy link
Copy Markdown
Owner

Hi, how does the trotter example behaves now ?
https://github.com/nicolasloizeau/PauliStrings.jl/blob/main/examples/evolve_trotter_ts.jl
Are you outperforming RK4 ?

@Anshhhhh-chand

Anshhhhh-chand commented Jun 10, 2026

Copy link
Copy Markdown
Author

"By holding off on truncation until the end of the full time-step-where we project back to OperatorTS—Trotter now gets that exact same N × information advantage. It reaches much tighter convergence to the exact Heisenberg dynamics than RK4 for the same M parameter (nearly half the relative error!). However, because the intermediate operators expand exponentially during the gate sequence before the final TS truncation, this mathematically optimal approach is currently much slower than RK4 in execution time."

@Anshhhhh-chand

Copy link
Copy Markdown
Author

I am trying for much faster implementation...

@nicolasloizeau

Copy link
Copy Markdown
Owner

This is way too slow to be merged at this point. Please try to run the examples if you're still interested in this.

@nicolasloizeau
nicolasloizeau marked this pull request as draft June 15, 2026 11:44
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.

Translation symmetric trotterization

2 participants