run¶
Top-level TDVP entry point.
run
¶
Evolve an MPS in real time under a Hamiltonian MPO.
Advances state.state by opts.dt per step, starting at state.step and
continuing to opts.n_steps. Preparing the initial state and wrapping it
in an Artifact at step=0 is the caller's responsibility. Resuming an
interrupted run, or continuing a finished one under new options, is
calling run() again with the Artifact loaded from tdvp.ckpt or from
any archived artifacts/step_XXXXX.ckpt; the matching time/energy history
is recovered automatically from evolution.ckpt in opts.checkpoint_dir.
When that history reaches past state.step — the case when restarting
from an earlier archived step to redo a segment at, say, a larger
max_bond — the later entries are truncated (with a warning), then
recomputed by this run and overwritten on disk, together with their
step_XXXXX.ckpt archives.
Both state.state and mpo are promoted to complex128 in place when
they are not already complex.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
Artifact
|
Starting MPS, paired with its |
required |
mpo
|
MPO
|
Hamiltonian MPO. Must be time-independent and Hermitian; the Krylov solver assumes a Hermitian effective Hamiltonian at every site. |
required |
opts
|
Optional[Options]
|
TDVP run options. Defaults to |
None
|
Returns:
| Type | Description |
|---|---|
Summary
|
Trajectory history (times, energies, norms, bond dimensions, and
per-step diagnostics). Written to |
Artifact
|
Final state with its |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
NotImplementedError
|
If |
FileNotFoundError
|
If |
run() evolves the state in place
The returned Artifact holds the same MPS object that was passed in,
not a copy, so the caller's reference to the initial state is advanced
along with it. Snapshot it first if the initial state is needed for
comparison — cloning tensor by tensor instead of with copy.deepcopy,
which cannot pickle the intertwiners of a non-Abelian tensor: