Repository navigation
Alice 0.3.0
Alice 0.3.0 — TDVP: Real-Time Evolution
Release Date: October 18, 2026
Version 0.3.0 introduces TDVP (Time-Dependent Variational Principle), Alice's third
algorithm alongside DMRG and XTRG: a real-time solver that evolves an MPS under
|ψ(t)⟩ = exp(-i H t) |ψ(0)⟩ by projecting the Schrödinger equation onto the tangent
space of the MPS manifold and integrating the projection by projector splitting. Two
update schemes are available — 1-site at fixed bond dimension and 2-site with SVD
truncation — each driven by a Lanczos–Krylov matrix exponential and a first- or
second-order symmetric integrator. Supporting this, the network layer gains complex
amplitudes: Network.to(device, dtype), a dtype keyword on init_mps, and an
observe that contracts a complex state against a real observable. No breaking API
changes.
⏱️ TDVP Algorithm
Tangent-Space Evolution
- New
alice.algorithm.tdvppackage exportingOptions,Summary,Artifact, and
run, withtdvpadded to thealice.algorithmand top-levelalicenamespaces.
alice.xtrgis now exported at the top level as well, alongside the existing
alice.dmrg. tdvp.run(artifact, H, opts)takes the starting state bundled with itstimeand
stepin anArtifactand the Hamiltonian MPO as a separate argument — unlike XTRG,
where the generator is baked into the density matrix being squared — and returns
(Summary, Artifact).- The tangent-space projector is never formed. Its positive terms are the sequence of
single-site evolutions over a half-sweep, each of which is the projection onto one
term, since the left and right environments built from canonical neighbors are exactly
P^LandP^R. Its negative term is the zero-site back-evolution on each bond,
applied with-dt, which cancels the double counting between consecutive terms.
Omitting it does not merely degrade the order — it breaks first-order consistency. - One full sweep is one time step. There is no inner convergence loop and no
e_tol
analogue: TDVP integrates, it does not optimize.
Update Schemes
- 1-site (
'1s'): single-tensor evolution plus the zero-site bond back-evolution,
with exact (non-truncating) splits. Conserves norm and energy to roundoff and holds
every bond dimension fixed. - 2-site (
'2s', the default): evolves the merged two-site tensor Θ and splits it by
SVD undermax_bond/trunc_thresh, so bonds both grow and shrink as entanglement
develops. Its back-evolution is a 1-site evolution of the site the split just loaded
with singular values, reusingevolve_1sitefrom the 1-site module. '1sp'is accepted byOptionsfor forward compatibility and rejected byrun()with
NotImplementedError.- Scheme aliases (
'2-site','two-site', …) resolve inOptions.__post_init__,
matching the DMRG and XTRG convention.
The Frozen-Bond Trap
- The 1-site manifold is one of fixed bond dimension, so a quench started from a
product state — every bond of dimension 1 — stays a product state forever while norm
and energy remain conserved to machine precision and the run looks healthy. This is a
sharper restriction than the corresponding one in DMRG or XTRG, where a 1-site run
merely converges less well. run()detects the situation at startup and warns, naming the offending bonds and
recommending'2s'or a'2s'warm-up until every bond has opened.
Integrator Order
order=2(default, Lubich symmetric): a forward half-sweep atdt/2then a backward
one, leaving the orthogonality center back at site 0. The step is its own adjoint.order=1(Lie-Trotter): a single half-sweep atdt, with the direction alternating
between steps.- Both are globally second order at equal cost: two consecutive
order=1steps of size
dtare exactly oneorder=2step of size2dt— the same local exponentials in
the same sequence, verified to 1e-9 in the test suite. Whatorder=2buys is where the
accuracy lands. Everyorder=2snapshot lands at the end of a complete
forward-and-backward sweep pair, whereas anorder=1snapshot taken after an odd step
carries first-order error, so a trajectory measured at every step wantsorder=2.
Local Exponentials
- New
krylov.pycomputesexp(-i dt H) vfor a HermitianHgiven only a
matrix-vector product, playing the roledavidson.pyplays for DMRG. It uses the
Lanczos three-term recurrence with full re-orthogonalization — plain Lanczos loses
orthogonality rapidly in floating point, and because the output is a propagator rather
than an eigenvalue, that loss shows up directly as a non-unitary step. - The Lanczos tridiagonal is exponentiated exactly via
numpy.linalg.eigh, so no
dedicated matrix-exponential routine (and no SciPy dependency) is needed. - Termination is on happy breakdown, on the modulus of the last coefficient of
exp(-i dt T) e₁falling belowkrylov_tol, or on thekrylov_dimcap. That
coefficient is the leading truncation error term and is reported back to the caller. inner_producthere always returnscomplex, unlike its DMRG counterpart: TDVP
vectors carry physical phases, and dropping the imaginary part would silently corrupt
the recurrence.
Environments
- New
environ.pywith anEnvironmentclass holding 3rd-order blocks
(bra_bond, mpo_bond, ket_bond), instantiated twice per run. The same blocks serve all
three effective Hamiltonians — 1-site, 2-site, and the zero-site one, which contracts
env_left[b]againstenv_right[b-1]across their common MPO bond — so the zero-site
update adds no storage of its own. - Disk spilling reuses the DMRG/XTRG design: a sliding window of
env_windowblocks in
memory, asynchronous writes and prefetches through aThreadPoolExecutor, and
left/{i:05d}.pt/right/{i:05d}.ptfiles under a per-run UUID subdirectory of
env_cache_dirthat is removed whenrun()returns or raises. - Block dtypes are deliberately not uniform. The two trivial boundaries come from
identityand stay real even for a complex state; every other block contracts the
state in and turns complex at the first step.
Options, Summary, and Artifact
Optionsexposesscheme,dt(which may be negative, to evolve backwards and
measure accumulated error),n_steps,order,max_bond,trunc_thresh,
krylov_dim,krylov_tol,renormalize, theenv_cache_dir/env_async_io/
env_windowcache triple,checkpoint_dir,artifacts_dir,save_artifacts, and
save_artifacts_every.Options.from_toml/load_tomlwork as in the other
algorithms.renormalizedefaults toFalseso that norm loss from truncation stays visible in
Summary.normsinstead of being silently absorbed.Summarycarriestimes,energies,norms,max_bonds(one entry per recorded
state, son_steps + 1of them),discarded_weightsandkrylov_errors(one entry
per step performed, so one fewer), plus the finalbond_dimsprofile. It holds no
state at all.- Energy and norm are conserved exactly by the projected flow, which makes them
diagnostics of numerical health rather than of physical accuracy — a run that has
truncated away the real physics still conserves both.discarded_weightsis the
quantity to watch for accuracy, andmax_bondthe one to converge. Artifact(state,time,step) is both the input and the output ofrun(), which
is what makes a resumed run indistinguishable from a fresh one.
Checkpointing and Resumption
evolution.ckpt(the latestSummary) andtdvp.ckpt(the latestArtifact) are
written atomically after every step undercheckpoint_dir;tdvp.ckptis removed when
run()finishes successfully, so a crash leaves it behind for inspection.- Resuming is calling
run()again with theArtifactfromtdvp.ckpt; the time and
energy history is recovered fromevolution.ckptautomatically. Continuing a finished
run works the same way from any archivedartifacts/step_XXXXX.ckpt, under new options
such as a largermax_bond. Starting from a step before the end of the history
truncates it back (with aWARNING) and recomputes forward. n_stepsis the absolute step index to stop at, counted fromt = 0, not a number of
additional steps — the same convention XTRG uses for cooling steps.save_artifacts_everythins the archive: stepkis written when
k % save_artifacts_every == 0. The stride is keyed on the absolute step index, so a
trajectory stitched from several resumed calls lands on exactly the same grid as one
that ran straight through. Archives use five-digit zero padding so a long run still
sorts lexicographically.- A run never evolves past the last grid point: when
n_stepsis not a multiple of the
stride,run()stops at the largest multiple that is not greater than it and warns.
Sincetdvp.ckptis removed on success, an off-grid endpoint would otherwise finish
with no snapshot of its own final state anywhere on disk. Only the endpoint is
constrained, which is why resuming from a crash at an off-grid step still works.
🔢 Complex Amplitudes in the Network Layer
- New
Network.to(device=None, dtype=None)casts and moves every site tensor in place,
with both arguments optional. Casting the blocks also casts the Bridge intertwiner
weights, which is what a generic symmetry group needs for the tensor to contract. The
call is idempotent, so promoting an already-complex state costs nothing. Narrowing a
complex network to a real dtype raisesValueError; discarding an imaginary part has
to be asked for explicitly, per tensor. init_mpsgains adtypekeyword (defaulttorch.float64), threaded through both the
product-state and random-MPS paths, so a state intended for real-time evolution can be
built ascomplex128directly.tdvp.runpromotes a real state and a real Hamiltonian MPO tocomplex128in place,
logged at INFO. Evolution is unitary, so there is nothing to gain from a real state and
nothing correct to be had from one — and this is what lets a DMRG ground state be
handed straight to a quench with no work from the caller.observehandles complex states, including a complex state paired with a real
observable. The scalar extraction moves into a shared_real_scalarhelper that
discards an imaginary part at roundoff level and raisesValueErrorbeyond it, since a
large imaginary part means the observable is not Hermitian on this state. A boundary
tensor carrying no block at all — an annihilated symmetry sector, such as a number
operator measured on a certainly-empty site — is now read as an exactly vanishing
expectation value rather than failing.- Requires Nicole ≥ 0.4.2 for native complex tensor support; the previous floor was
0.3.7.
🧪 Tests
- Seven new test modules under
tests/algorithm/tdvp/:test_environ.py,
test_krylov.py,test_physics.py,test_scheme_1s.py,test_scheme_2s.py,
test_sweep.py, andtest_tdvp.py, plus a sharedconftest.py. test_physics.pyis the layer that pins the algorithm against physics rather than
against itself: occupations matched to the analytic single-particle propagator on a
free chain with second-order convergence indt; norm, energy, and U(1) charge
conservation across both schemes and both orders; forward-then-backward reversibility;
an eigenstate whose overlap magnitude stays at 1 while its phase winds at the
ground-state energy; exactness at full rank; and the frozen product state under'1s'
together with its recovery once the bonds are open.- New complex-dtype coverage in the network tests:
Network.topromotion, norm
preservation, idempotence, device-only moves, and the real-narrowing error;
TestObserveComplexchecking a complex state against its real counterpart (Abelian and
SU(2)), a complex observable, global-phase invariance, a non-Hermitian observable, a
complex thermal density matrix, and the annihilated-sector zero.
📚 Documentation
- New
docs/algorithms/tdvp/section — overview,Options,Summary,Artifact, and
run— covering the tangent-space projection, the two schemes and the frozen-bond
warning, integrator order, the Krylov solver, the on-disk layout and artifact grid, and
how to read a history whose lists come in two lengths. - New
docs/examples/tdvp/walkthroughs, each validated against an analytic reference or
across symmetry groups: a Gaussian wavepacket against the exact single-particle
propagator with cleandt²convergence; domain-wall melting against the exact
correlation matrix, with entanglement entropy as well as occupations; spinful melting
atU = 0checked against twice the spinless result in both Abelian and SU(2)
bookkeeping; and an interaction quench from a DMRG ground state in all four band
symmetry groups. docs/api/network/observe.mdgains a complex-states section,init-mps.mda
complex-amplitudes section, andnetwork.mdrenders the newtomethod. The
algorithms and examples indexes,mkdocs.ymlnavigation, and the README all gain TDVP
sections — and TDVP leaves the README'sUpcominglist.- New
docs/algorithms/xtrg/lessons.md:trunc_threshis an absolute singular value
cutoff, and the squaring sweeps apply it to a product of unit-norm factors whose norm is
2^(-N/2)near infinite temperature, so a longer chain needs a proportionally smaller
threshold. - The algorithms index gains the XTRG
Artifactrow it had been missing, and the
entry-point page of each algorithm is now calledLaunchthere, as it already was in
the sidebar, so a link no longer renames its destination.
📝 Examples
examples/examples_tdvp/tdvp_freefermion.py: Gaussian wavepacket propagation on a
spinless chain against the exactexp(-iht)reference.examples/examples_tdvp/tdvp_domainwall.py: many-body domain-wall melting, occupations
and entanglement entropy against the exact correlation matrix.examples/examples_tdvp/tdvp_hubbard.py: spinful melting atU = 0, Abelian versus
SU(2).examples/examples_tdvp/tdvp_hubbard_quench.py: interaction quench from a DMRG ground
state in all four symmetry groups.examples/examples_tdvp/freefermion_exact.py: the exact free-fermion reference
implementation the first three build on.
📊 Statistics
- 1,211 tests across 37 test modules (up from 979 / 30 modules in v0.2.8).
- 80 commits since v0.2.8.
- 53 files changed, 10,480 insertions, 43 deletions.
- 34 source modules in five subpackages:
alice.network,alice.physics,
alice.algorithm.dmrg,alice.algorithm.xtrg,alice.algorithm.tdvp.
✅ Compatibility
Breaking Changes: none.
Behavioral Changes:
observeraisesValueErrorwhen the expectation value has a non-negligible imaginary
part (relative tolerance1e-10, with an absolute floor of the same size), instead of
returning the real part of a meaningless number.observereturns0.0for a boundary tensor with no data block, where it previously
raisedStopIteration.tdvp.runmutates theMPSandMPOit is given, promoting both tocomplex128in
place when they are not already complex.
Requirements:
- Python ≥ 3.11
- PyTorch ≥ 2.5
- Nicole ≥ 0.4.2
📝 Notes
TDVP borrows the shape of the two algorithms already in Alice wherever they are
conceptually alike: Options/Summary follow AlgorithmOptions/AlgorithmSummary, the
scheme names and aliases match, the Artifact and checkpoint-resumption design is XTRG's
with time in place of β, and the disk-spilling Environment reuses the same
sliding-window-plus-async-I/O pattern. What does not carry over is the sweep itself. A
DMRG or XTRG sweep is one iteration of a search that repeats until something converges; a
TDVP sweep advances physical time by a fixed amount and is never repeated. There is no
inner loop to tune and no residual to watch, which is why the sweeps take a dt and
return error diagnostics rather than an energy.
The consequence worth internalizing is that TDVP's conserved quantities are not accuracy
measures. A DMRG run reports an energy that is the answer, and an XTRG run reports a
log Z that is likewise the answer; a TDVP run reports an energy and a norm that the
projected flow conserves by construction, whether or not the trajectory still resembles
the true one. They detect a broken integrator or an undersized Krylov space, nothing
more. The quantities to converge are the observables themselves, measured afterwards from
the archived snapshots, and the knob that moves them is max_bond — entanglement after a
quench grows roughly linearly in time, so the bond dimension needed grows exponentially,
and that, not the step size, is what sets the reachable time horizon.