Skip to content

Fix fourth-order TDVP sweep directions - #226

Open
osvathbotond wants to merge 1 commit into
ITensor:mainfrom
osvathbotond:fix/tdvp-fourth-order
Open

osvathbotond wants to merge 1 commit into
ITensor:mainfrom
osvathbotond:fix/tdvp-fourth-order

Conversation

@osvathbotond

Copy link
Copy Markdown

Description

Fix fourth-order TDVP evolution, which currently throws a BoundsError on the third substep.

sub_time_steps(::TDVPOrder{4}) defines six substeps, but orderings(::TDVPOrder{4}) supplies only two sweep directions. Repeat the forward/reverse direction pair three times to match the three symmetric second-order stages encoded by the existing coefficients.

Minimal demonstration of previous behavior

using ITensors, ITensorMPS

sites = siteinds("S=1/2", 4)
terms = OpSum()
for j in 1:3
    terms += 0.5, "S+", j, "S-", j + 1
    terms += 0.5, "S-", j, "S+", j + 1
    terms += 1.0, "Sz", j, "Sz", j + 1
end
H = MPO(terms, sites)
psi = MPS(sites, ["Up", "Dn", "Up", "Dn"])

psi_evolved = tdvp(H, -0.1im, psi; nsteps=1, order=4, cutoff=1e-12, maxdim=16, outputlevel=0)
# Throws BoundsError when accessing the third sweep direction.

Minimal demonstration of new behavior

using ITensors, ITensorMPS

sites = siteinds("S=1/2", 4)
terms = OpSum()
for j in 1:3
    terms += 0.5, "S+", j, "S-", j + 1
    terms += 0.5, "S-", j, "S+", j + 1
    terms += 1.0, "Sz", j, "Sz", j + 1
end
H = MPO(terms, sites)
psi = MPS(sites, ["Up", "Dn", "Up", "Dn"])

psi_evolved = tdvp(H, -0.1im, psi; nsteps=1, order=4, cutoff=1e-12, maxdim=16, outputlevel=0)
# Successfully returns the evolded MPS.

How Has This Been Tested?

Added test/base/test_solvers/test_tdvp_orders.jl:

  • Compare six-site evolution against an independently constructed dense matrix exponential, including the full state and global phase.
  • Cover conserved and unconserved quantum numbers, both initial sweep directions, and one-site/two-site updates.
  • Verify first-, second-, and fourth-order timestep convergence using successive refinements of a nontrivial fixed-rank, one-site TDVP flow without QN conservation.
  • Check norm conservation and stability under tighter local-solver tolerance.

All 136 assertions passed locally on Julia 1.13.0 after formatting:

  • 62 dense-exponential accuracy assertions.
  • 74 timestep-convergence assertions.

Formatter idempotence was also verified. The full repository test suite has not been run locally.

Checklist

  • My code follows the style guidelines of this project. Ran ITensorFormatter v0.2.30 on both changed files.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that verify the behavior of the changes I made.
  • I have made corresponding changes to the documentation. Not applicable: this restores existing behavior without changing the API.
  • My changes generate no new warnings. The same dependency/import warnings appeared before and after formatting; an unmodified-upstream baseline has not been checked.
  • Any dependent changes have been merged and published in downstream modules. Not applicable: no dependent changes are required.

This branch has not been deployed

No deployments
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