Changelog¶
0.5.0 - 2026-11-22¶
TgTRG: Cooling Along the Tangent Space
Introduces TgTRG (tangent-space Tensor Renormalization Group), Alice's fifth algorithm
and its second route to finite temperature. Where XTRG reaches β by squaring the density
matrix and fitting the product back down, TgTRG projects the imaginary-time flow
dρ/dβ = -Hρ onto the tangent space of the MPO manifold and takes one sweep per step — the
projector splitting TDVP uses for real time, applied to ρ read as a super-MPS over the
doubled physical space. A sweep costs O(D³) against XTRG's O(D⁴) fit, and the β grid
is no longer forced to double. Two schemes ship, '1s' and '2s'; '1sp' follows in a
later release. No breaking API changes.
The Algorithm¶
- New
alice.algorithm.tgtrgpackage exportingOptions,Summary,Artifact, andrun, added to thealice.algorithmand top-levelalicenamespaces. - Each step applies local propagators along a sweep:
e^{-τ H⁽¹⁾}on a site tensor going forward,e^{+τ H⁽⁰⁾}on the bond matrix left behind. The backward sign subtracts the double counting two overlapping site updates introduce, as in TDVP. Hacts onρfrom one side only, so every environment block carries three indices,(bra_ρ_bond, H_bond, ket_ρ_bond), as in DMRG. The doubled physical space shows up in the local tensors, not in the environments.- At full rank the projector splitting is exact, at either integrator order and for any step size. A step size buys accuracy in the projection, not in the integrator.
tgtrg.run(state, mpo, opts)takes the Hamiltonian MPO positionally, the one signature difference fromxtrg.run: XTRG never refers back toHafter the Taylor state, while TgTRG contracts against it at every step.'2s'evolves a pair, splits by SVD, and back-evolves the site it advanced onto;'1s'cannot change a bond dimension, so its rank is the rank of the state it is handed, andmax_bondreaches it only by compacting that state before the first step.'1sp'is accepted byOptionsand rejected byrun()withNotImplementedError.trunc_threshis relative to‖Θ‖, and every Θ a cooling sweep decomposes sits at norm1, measured at1 ± 4.2e-11over anL = 8run.- Checkpointing follows XTRG's layout: the shared
thermal.ckptfor the history, the algorithm-namedtgtrg.ckptfor the mid-run artifact, andartifacts/step_XXXXX.ckpt, withsave_artifacts_everythinning the archives by a stride.
The β Grid, and Its Step Size¶
Options.gridselects'exp'(stepτ = β, soβ_n = 2^n τ₀) or'lin'(stepτ = Options.tau). A run uses one or the other; a schedule needing both is tworun()calls, the second resuming from the first'sArtifact.Summary.taustells the phases apart afterward, and the non-uniform finite differences need it.- The backward bond update amplifies the high-energy end of the local spectrum by
exp(τ ΔE), and once that exceeds the inverse of float64 resolution it amplifies roundoff along with the state. The limit is onτ ΔE, not on β, and nothing downstream notices: the Krylov expansions converge either way, correctly solving the local problem they were handed, while the state they are applied to drifts.run()therefore warns when a schedule contains a step past a conservative soft limit. - The exponential grid walks into that on its own, its step size being
β. The schedule to use is the stacked one — exponential out of the high-temperature regime, linear from there on — and the defaultn_stepsof 13 stops the exponential phase atβ = 2. log Zcomes fromNormalMPO.log_trace()at every step and is accurate to roundoff while the rank suffices;u,c_V, andSare non-uniform finite differences of it and carry the grid's spacing as an error.Options.obs_exactadds a directTr[ρH] / (Tr[ρ] L)measurement, defaulting toFalse; the gap between the two energy columns is the discretization error.
The Krylov Exponential¶
- New
krylov.pywithlanczos_expv. The projected matrix is real symmetric, soexp(-τT)goes througheigh, and the contract isexp(-τH) v = exp(log_scale) · wwith‖w‖ = ‖v‖exactly: all of the magnitude is factored intolog_scale, with the propagator column assembled in log space including the eigenvector overlaps. Shifting by an extremal eigenvalue is not enough — imaginary time runs the spectrum overτ ΔEin the exponent, so coefficients underflow as readily as they overflow, and an underflowed column arrives as a vector of zero norm.
Tests, Documentation, and Examples¶
- Six new modules under
tests/algorithm/tgtrg/plus aconftest.pycarrying free-fermion Hamiltonians, thermal states, and the analytic grand-canonical references. The environment blocks are validated against an independentNormalMPO-basedTr[ρ̂Hρ̂]in both sweep directions before anything is built on them, andtest_sweep.pystates the two things that are actually true in place of the convergence rates one would expect: a full-rank step is exact, and a rank-limited run has aτ-independent accuracy floor. - New
docs/algorithms/tgtrg/section anddocs/examples/tgtrg/walkthroughs, with the algorithms index, examples index,mkdocs.ymlnavigation, and README all gaining TgTRG sections, ordered DMRG, VUMPS, TDVP, TgTRG, XTRG. The README's "Upcoming" list loses the TgTRG entry it has carried since 0.1.0. docs/algorithms/tgtrg/lessons.mdseparates the two step-size regimes — a column that stops being representable pasttau ΔE ≈ 1400, closed off by the log-space assembly, and the roundoff amplification forty times earlier — and locates the second at(tau/2) ΔE ≈ log(1/eps) ≈ 36by varying the hopping, so the fixed soft limit of 8.0 is conservative for a spectrum of order a few and silent past it. Also there: why refiningtauunder a rank limit saturates, the tuning order it implies, why the propagator scale is measured per call instead of precomputed, and thatrun()cools in place.- New
examples/examples_tgtrg/tgtrg_spinless.pyandtgtrg_spinful.py, both on the stacked schedule and both printing their thermodynamics beside the analytic values.
Statistics¶
- 2,057 tests across 53 test modules (up from 1,779 / 47 in v0.4.2).
- 33 files changed, 8,683 insertions, 3 deletions.
- 51 source modules in seven subpackages:
alice.network,alice.physics,alice.algorithm.dmrg,alice.algorithm.vumps,alice.algorithm.tdvp,alice.algorithm.tgtrg,alice.algorithm.xtrg.
Compatibility¶
- Breaking Changes: none.
- Behavioral Changes: none. TgTRG is additive; the only changes outside its own package are the two namespace exports and the documentation.
- Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.4.2.
0.4.2 - 2026-11-21¶
VUMPS: Corrections and Warm Environments
Corrects two things in VUMPS that an energy could not see, and makes every environment
solve start from the answer of the previous one. The gradient is now the larger of the two
gauge mismatches, where reading one of them alone called a moving state converged; the
'1sp' expansion now acts on the bond in front of the center tensor, the only bond a
forward pass is free to replace, where it was built for the geometry of a backward sweep.
The warm start cuts the unit cells a run absorbs by a factor of two to three, and the
energies are unchanged throughout. Also here: a terminology pass that gives controlled
bond expansion the vocabulary it is named for. No breaking API changes.
The Convergence Measure¶
gauge_tensorsreturns the larger of|AC - AL C|and|AC - C AR|in place of the left mismatch alone, at the cost of one contraction per position. Both vanish together at a stationary point and are equal on an untouched cell, so'1s'is unaffected.- What the second form catches is a splitting sweep: each step writes its answer back as
AL Cor asC ARand the polar step hands the same factor back, so the matching mismatch is zero at every position the pass solved. Gradients under'2s'and'1sp'are therefore larger than v0.4.1 reported for the same state, and a run that stopped atgrad_tolbefore may now continue to its discarded-weight floor.
The One-Site-Plus Geometry¶
- The expansion is mirrored end to end: the complement comes from the right singular vectors of the doubly-discarded tensor, expands the left bond of the right-orthonormal tensor of the next site, and the expanded block is one step of the right environment over that neighbor. The center-side projector is a left-isometric split of the center tensor, and the split that follows cuts the center tensor on its right.
- A forward step ends with the center on the bond in front of the site it solved, so that is the bond it may replace. The v0.4.1 construction expanded the bond behind the center, which the pass had already finished with. Energies were unaffected, the expansion preserving the state and the solve being variational either way; what was lost was the point of the expansion.
Warm Environments¶
left_environment,right_environment,build_right_envs, andcell_environmentstake an optionalguess. Only its entering channel is rebuilt, the transfer operator carrying that channel to itself, so an error there would survive to bias the energy; everything else is taken as given, the iteration having one fixed point regardless of where it starts.- What is handed over is the pair of blocks the pass itself ends holding. One step inward
on each side lands both on bond
0, the bond the final split has just created, so the pair fits the next iteration whatever the split did to its width. Previous fixed points would serve'1s'alone, whose bonds never move. iMPS.set_canonicalreturns the per-bondUandVhthat rotate every bond into its Schmidt basis, and newrotate_left_envandrotate_right_envcarry a block across one. Without that step a guess is a right answer in coordinates that no longer exist.vumps.Optionsgainsenv_warm_start(defaultTrue), logged at startup. Measured on the Heisenberg chain atD = 16: cells fall from 7150 to 4408 under'1s', 82532 to 33624 under'2s', and 81729 to 35820 under'1sp', with energies agreeing to1e-13.
Terminology¶
- The "widen" family is replaced throughout the sources, tests, documentation, and examples by the vocabulary of the scheme's own name: controlled bond expansion expands a bond, leaves an expanded neighbor and an expanded basis. Where a passage describes a two-site split, a product cell growing under a raised cap, or the span of an iMPO, the wording is "grow", so that expansion names one mechanism only.
- The executable part is two local names and one debug line, now
D = %d (%d expanded). The v0.4.0 changelog entry keeps the wording it was released with.
Tests and Documentation¶
- New cases in
tests/algorithm/vumps/test_environ.py: rotating a block commutes with absorbing a unit cell on either side, a solver handed its own answer returns it in a single cell, a foreign state's environment does not move the fixed point, and a spoiled entering channel leaves no trace in the energy. New cases intest_sweep.pyrequire the saving itself, stripping either rotation making the warm solve cost more cells than the cold one. - New driver cases pin each scheme run both ways to the same energy, bond dimensions, and
final gradient, and pin the default on.
test_scheme_1s.pycovers the shape a splitting sweep ends in, where only the right mismatch has anything to say, andtest_scheme_1sp.pyfollows the mirrored expansion throughout. docs/algorithms/vumps/index.mdnames the bond a'1sp'step expands and describes the gradient with both of its forms;lessons.mdgains Starting From the Previous Answer, with the measurements, the reasoning that turns a starting error into a saving in cells, and why a reproducible SVD phase convention looked like a fix while leaving the block in the wrong coordinates.
Statistics¶
- 1,779 tests across 47 test modules (up from 1,760 in v0.4.1).
- 34 commits since v0.4.1.
- 39 files changed, 1,044 insertions, 377 deletions.
- 45 source modules in six subpackages:
alice.network,alice.physics,alice.algorithm.dmrg,alice.algorithm.vumps,alice.algorithm.tdvp,alice.algorithm.xtrg.
Compatibility¶
- Breaking Changes: none.
- Behavioral Changes:
Summary.gradientsand the logged gradient report the larger of the two gauge mismatches, so the numbers under'2s'and'1sp'are larger than v0.4.1 reported for the same state.vumps.Optionsgainsenv_warm_startafterenv_maxiter, so positional construction past that field shifts.iMPS.set_canonicalreturns the two lists of per-bond rotations where it returnedNone, andcell_updatereturns a third element, the left block the pass ends on. A'1sp'run expands the opposite bond of each pair, so its intermediate states differ while the converged energies agree. - Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.4.2.
0.4.1 - 2026-11-20¶
VUMPS: The 1-Site-Plus Scheme
Implements '1sp', the third VUMPS update scheme, which v0.4.0 accepted in Options and
rejected in run(). Before each center-tensor solve it expands the bond the solve sits on
with up to expand_k directions drawn from the complement of the space that bond currently
spans, solves the ordinary one-site eigenproblem there, and splits the answer to cut the
bond back — so the bond dimension adapts as it does under '2s' while every local solve
stays one-site sized. Each of the four algorithms in Alice now carries the same three
schemes. Also here: a language regularization pass over the comments, docstrings, and
documentation of the whole tree, and Python 3.13 through 3.15 declared supported. No
breaking API changes.
The 1-Site-Plus Scheme¶
run()acceptsscheme='1sp'and_IMPLEMENTED_SCHEMESnow holds all three schemes, so theNotImplementedErrorv0.4.0 raised for it is gone. The one-site update ends in a pair of polar decompositions, which discard nothing and so cannot replace a bond index;'1sp'buys the two-site scheme's freedom at the one-site price by expanding the bond before the solve instead of letting a larger solve discover the width on its own.- Growth is additive where a split is multiplicative: an expansion adds at most
expand_kdirections per bond per iteration, where a two-site split multiplies the bond by the physical dimension.max_bondandtrunc_threshapply as they do to'2s', andSummary.discarded_weightsis populated. A one-site unit cell is refused with aValueError, the expansion otherwise reading the bond it is about to replace. - New
alice.algorithm.vumps.complementwithexpand_bond,split_center, anddiscarded_weight, following TDVP's'1sp': the iMPO is applied independently from each side to a cheaply factored two-site tensor, the kept subspace is projected out of each half, and the SVD of the doubly-discarded outer product supplies the new directions. - Only one side exists here. A VUMPS pass meets bond
jwith the left-orthonormal tensor behind it and the center tensor in front, the geometry of a backward half-sweep in the finite algorithms, so only the complement factor facing the neighbor is ever used. - Exact state preservation: only the neighbor is expanded by
oplus, and the center tensor is filled in by projecting Θ onto the expanded neighbor basis, which is exact because the expanded basis contains the old one. Exact expanded environment: onestep_left_envcall over the expanded neighbor, keeping the cross blocks. Nothing on theARside has to be expanded at all — the right block read sits on the bond behind the one being expanded, and the bond matrix comes out ofsplit_center. - Orthonormal projectors: the neighbor side projects against the tensor itself, exactly
isometric there; the center side uses a one-site split of the center tensor, since
M M†is a projector only for an isometry. The isometric factor of Θ must not be used, asdecompkeeps every sector at full dimension and it can span the whole (bond, physical) space and project the complement away entirely. - Directions below
1e-10times‖lh‖·‖rh‖are cancellation artifacts, lie in the kept space, and are dropped; the same absolute floor gates Θ'_disc as a whole, and that is where the test must be made, since two discarded halves can each keep a remainder while their contraction cancels it. A bond with no complement — saturated, or out of the iMPO's reach — is left alone and the step degenerates into a plain one-site update. - New
_update_one_site_plusinsweep.py. Like the two-site pass it is a sweep in the finite sense, the split replacing the index the next step's left environment must be built on, and the expansion needs no environment of its own, so one right block serves both it and the solve and the sliding window still advances by one. vumps.Optionsgainsexpand_k(default4) andexpand_alpha(defaultNone), matching the other three algorithms, logged at startup under'1sp';round(sqrt(max_bond))is a reasonable starting point for both.
Tests and Documentation¶
- New
tests/algorithm/vumps/test_scheme_1sp.py: the state unchanged, the bond growing by at most what was asked for, the neighbor still orthonormal, the center-side basis, a saturated bond left alone, the floor rejecting a vanishing complement, a cheaperalphastill expanding, the solve on the expanded bond never doing worse, and the split. - The shared
TestCellUpdatecases are parametrized over all three schemes, and newTestOneSitePlusCellUpdateand driver tests cover growth from a Néel cell, growth capped byexpand_kand bymax_bond, the discarded weight, agreement with'2s'from the same start, SU(2), and a truncatedexpand_alphalanding where the full expansion does. docs/algorithms/vumps/index.mdgains a Controlled bond expansion section and lists'1sp'in its scheme table; the claim that'2s'is the only scheme that can grow a bond is gone from the docs and theOptionsdocstring.options.mdshows the two expansion keys in TOML, the README counts three schemes, and all four VUMPS example scripts accept--scheme 1spwith--expand-kand--expand-alpha.
Language Regularization¶
- The prose of comments, docstrings, and Markdown documentation across
src/,docs/,tests/, andexamples/is brought in line with the Language section of the project conventions. Each site was a judgment call and not a find-and-replace. - Two terminology fixes: the one misuse of "leg" for an index, in
tests/algorithm/tdvp/test_scheme_2s.py, and the one British spelling,labelledinsrc/alice/network/autoimpo.py. Nothing in the pass changes behavior; the one runtime string it touches is the gauge-fixing two-cycle message iniMPS.
Packaging¶
- Python 3.13, 3.14, and 3.15 are declared in the trove classifiers;
requires-pythonstays at>= 3.11. The README's Python badge is static in place of the dynamicpypi/pyversionsone, which reported whatever the last published release declared, and the PyTorch badge follows the same≥ 2.5form.
Statistics¶
- 1,760 tests across 47 test modules (up from 1,728 / 46 modules in v0.4.0).
- 55 commits since v0.4.0.
- 92 files changed, 1,864 insertions, 512 deletions.
- 45 source modules in six subpackages:
alice.network,alice.physics,alice.algorithm.dmrg,alice.algorithm.vumps,alice.algorithm.tdvp,alice.algorithm.xtrg.
Compatibility¶
- Breaking Changes: none.
- Behavioral Changes:
vumps.runno longer raisesNotImplementedErrorforscheme='1sp'; it runs the scheme.vumps.Optionsgainsexpand_kandexpand_alpha, so positional construction pastenv_windowshifts.cell_updateraisesValueErrorfor'1sp'on a one-site cell, where it previously raisedNotImplementedErrorfor the scheme itself. The gauge-fixing two-cycle message ofiMPSis reworded. - Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.4.2.
0.4.0 - 2026-10-31¶
VUMPS: The Infinite Chain
Introduces VUMPS (Variational Uniform Matrix Product States), Alice's fourth algorithm: a
ground-state solver that works directly on an infinite chain, with no system size, no
boundary, and no finite-size extrapolation. The state is a uniform MPS given by a unit cell
that tiles the chain, the Hamiltonian is an iMPO over the same cell, and the energy reported
is an energy per site. Supporting it, the network layer gains a whole infinite family —
iNetwork, iMPS, iMPO, their gauge-fixed canonical form, init_imps, and an
automaton-based build_ihamiltonian — and the 1D chain geometry gains the IBC boundary
condition and next-nearest-neighbor bonds. No breaking API changes.
Infinite Tensor Networks¶
- New
alice.network.infinitewithiNetwork,iMPS, andiMPO, exported fromalice.networkand the top-level namespace. A cell ofNsite tensors tiles the chain: siteNis site0of the next copy, so the right bond of siteN-1is the same index as the left bond of site0, and both ends of the cell carry a full virtual index rather than a trivial dimension-1 boundary. - This is a tiling, not a closed loop — it says translating by
Nsites changes nothing, not that two distant sites are bonded. The finite closed chain remainsNetworkwithbc='PBC'. The family shares no ancestry withNetwork, which is what makesisinstance(x, MPS)Falsefor an infinite state and lets the finite entry points reject one. - Canonical form by gauge fixing. With no end to sweep orthogonality in from,
iMPS.canonicalsolves for a fixed point instead: sweep the cell with a sign-fixed QR, carry the triangular factor into the next copy, repeat. It leavesAL,AR, andCsatisfyingAL[i] C[i+1] = C[i] AR[i], with eachCdiagonalized into the Schmidt basis so the stored form is unique and the entanglement spectrum can be read off. All three are kept:ALcannot be recovered fromARandCby a fresh QR sweep, which fixes its own basis on each bond. - New
set_canonicalinstalls a gauge computed elsewhere, taking all three as given. Deriving them from updated tensors would require the transfer operator of a state caught mid-update to have a single dominant eigenvalue, which it need not.canonicalraises when no gauge exists, which a random cell can land on. - New
infinite_summaryindisplay.pyrenders one cell between···─continuation markers, reporting the cell size rather than a chain length and omitting the norm, which is not a finite quantity for an infinite state.
Building the Infinite System¶
- New
build_ihamiltonianassembles the cell directly as a finite-state automaton. The finite builder cannot be reused:opluswould duplicate the unique start and finish channels of the upper-triangularW, and a second start channel generates a whole family of spurious terms, whilecompact()has no open end to sweep from and would scramble the triangular structure the environment solver reads. A term is a walk entering at start, carrying an operator string across the intervening bonds, and exiting at finish; because the string's progress is part of the channel identity, a term reaching past the cell simply places several channels on one bond, so the range is not limited byN. Companion helpersboundary_vectorsandwindow_mpoare exported alongside it. - New
init_impsbuilds the initial cell in the same two modes asinit_mps. The cell is charge neutral — fusing its physical charges has to return the charge it started from, which means half filling for fermions and zero magnetization for spins, so there is notarget_qnand aconfigcarrying net charge is refused, as is an odd cell for spin-½. Each bond carries only the charges reachable at its own position, an even number of fusion steps from its neighbors'; giving every bond the same sectors produces a transfer operator with two dominant eigenvalues of opposite sign, which gauge fixing reports as a two-cycle. A random draw landing there is repeated with a shifted seed up to eight times. intrcmap_1dchainacceptsbcx='IBC', under which aterminal_siteat or beyondLdenotes a site in the next cell, and gains ann3xkey for next-nearest-neighbor bonds, which the Majumdar-Ghosh point needs. An unrecognizedbcxnow raisesValueError.
VUMPS Algorithm¶
- New
alice.algorithm.vumpspackage exportingOptions,Summary,run,cell_update,cell_environments,Environment, and the unit-cell transfer operators, withvumpsadded to thealice.algorithmand top-level namespaces. The unit of work is an iteration, not a sweep: every position of the cell is solved against one frozen set of environments, which are then re-solved against the updated state. - 2-site (
'2s', default) solves a pair and splits it by SVD undermax_bond/trunc_thresh— the only scheme that can change the bond dimension or move weight between charge sectors. The split needs no inverse: writingC = Swith center tensorsU SandS Vhreproduces the one-site gauge step exactly. 1-site ('1s') solvesH_ACandH_Cindependently and reconciles them with two separate polar factors, taken separately because the polar decomposition ofAC C†would square the condition number of an ill-conditionedC. Discarding nothing, it is confined to the bond dimension and the sectors its initial state carried.'1sp'is accepted byOptionsand rejected byrun(). - Environments are fixed points. The iMPO being upper triangular with identities in both
corners, the start channel is solved by the identity, the string channels converge in
finitely many cells, and the finish channel's equation has no solution at all — each
application adds one more cell of energy. Subtracting that component at every step is the
cure, and the amount subtracted is the energy, which is why the solver measures it.
Nicole has no Krylov solver, so this is plain regularized power iteration, the
slowest-converging piece of an iteration. Running out of
env_maxiterwarns and continues with the best estimate. - Only the right environment blocks are stored, and that is structural: a forward pass
produces its left blocks in the order it consumes them, so one running tensor suffices,
while the right blocks come off the recursion last-built-first-used, which is what a
sliding window serves. One side of a pass is streamed and the other stored, with the same
env_cache_dir/env_async_io/env_windowtriple as the other algorithms. - Convergence is measured on the gradient
|AC - AL·C|, maximized over the cell. The Davidson eigenvalues belong to regularized local problems and the energy of an infinite chain is infinite, so the energy density comes from the environment fixed point. The gradient keeps falling long after the energy has flattened, and rests on two floors: it cannot go belowdavidson_tol, and under'2s'against a bond cap that bites it settles at a floor set by the discarded weight. Summarycarriesenergy(per site), the gauge-fixedstate,energies,converged,n_iters,bond_dims,gradients, anddiscarded_weights.vumps.ckptis written atomically every iteration and removed on success, with the finalSummaryarchived asstate.ckptunderartifacts_dir, matching DMRG's layout.
Tests¶
- Five new modules under
tests/algorithm/vumps/plus a sharedconftest.py: the transfer operators against isometry, the energy density against closed-form answers, the environments for consistency where no answer is known, the missed-tolerance warning, the bond-indexed store against its recursion and its window, both schemes' local solves and gauge steps, and the driver, its cache, and the files it leaves on disk. A_Watchedsubclass ofEnvironmentrecords how full it ever got, pinning that a pass never holds more than a window. - New
tests/network/test_infinite.py,test_autoimpo.py, andtest_autoimps.pycover the tiling and bond bookkeeping, the canonical form against states with a known Schmidt spectrum and the failures it must refuse, a window of the cell against the finite MPO built from the same terms, and both initializer modes with their refusals. tests/physics/test_chain.pygains NNN and IBC coverage. New top-leveltests/conftest.pyisolates the working directory of the whole suite from the project root, with a session-scoped fixture ahead of any fixture that callsrun(); the per-algorithm copies it supersedes are gone.
Documentation and Examples¶
- New
docs/algorithms/vumps/section and fourdocs/examples/vumps/walkthroughs, each against an exact answer: Heisenberg against1/4 - ln 2, Majumdar-Ghosh at its exactly solvable point (6e-14from exact in seven iterations), free fermion against-2/π, and Hubbard against the Lieb–Wu integral in all four band symmetries. docs/algorithms/vumps/lessons.mdmeasures the environment budget: the residual falls geometrically, soenv_tol = εcosts roughlyξ ln(1/ε)cells and the default of 200 coversξup to about seven. Nothing stalls; a gapped model saturates with the bond dimension while a critical one does not; a degenerate or over-wide state exhausts the budget while gapped. The energy is not the environment — atD = 32on the Heisenberg chain an environment with a1.9e-4residual gives an energy good to3e-14.- New API pages for
iNetwork,iMPS,iMPO,init_imps, andbuild_ihamiltonian; the API overview tables and quick links are completed; and the algorithms index, examples index, navigation, and README are reordered DMRG, VUMPS, TDVP, XTRG. - The DMRG example pages and the quick start are corrected throughout:
build_interactionreturns aGeometry, the TOML tables sit where it reads them, the initial state comes frominit_mps, and each page says why a product state wants'2s'or'1sp'— which is also the right attribution for the energy gaps they quote. The Hubbard page's energy is corrected from≈ -3.67to-20.2358, and the quick start's output is a verified run. - The three DMRG example scripts are rebuilt on the shipped Alice API alone, no longer
reaching into
tests/diagonaliztn, so--initchooses betweenrandomandproduct, both frominit_mps. The five TDVP scripts drop their redundantsys.pathinserts.
Statistics¶
- 1,728 tests across 46 test modules (up from 1,357 / 38 modules in v0.3.2).
- 175 commits since v0.3.2.
- 70 files changed, 11,723 insertions, 395 deletions.
- 44 source modules in six subpackages:
alice.network,alice.physics,alice.algorithm.dmrg,alice.algorithm.vumps,alice.algorithm.tdvp,alice.algorithm.xtrg.
Compatibility¶
- Breaking Changes: none.
- Behavioral Changes:
dmrg.runraisesTypeErrorfor anything that is not anMPSand anMPO, namingvumps.run.intrcmap_1dchainraisesValueErrorfor abcxoutside'OBC','PBC', and'IBC', where an unrecognized value previously produced an open chain, and a PBC bond's label list is now['NN', 'N2X', 'PBC']rather than['NN', 'PBC', 'N2X'](the bonds themselves are unchanged). The DMRG example scripts'--initchoices change fromiter_diag/randomtorandom/product. The test suite runs with its working directory set to a temporary path. - Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.4.2.
0.3.2 - 2026-10-24¶
Truncation Scale and Kept-Space Projection
A correctness release on two pieces v0.3.0 and v0.3.1 built. The controlled bond expansion
in DMRG and XTRG projected the center end of a bond with the center tensor itself, for
which M M† is not a projector, so part of the space the bond already carried leaked back
into the complement it was meant to be orthogonal to. XTRG's trunc_thresh and z_tol
were absolute numbers compared against a quantity that shrinks like d^{-L/2}, which made
the cutoff exponentially more aggressive with every site added and the fit-convergence test
satisfied before the fit had done anything. Both are now measured against the scale they
live on. init_mps also stops handing back a random MPS with every bond empty, and the
four TDVP example scripts accept '1sp'. No breaking API changes, but trunc_thresh is
now read relatively and its default moves from 1e-15 to 1e-12.
The Kept-Space Projection¶
- New
_center_isometry_forward/_center_isometry_backwardinalice.algorithm.dmrg.complementandalice.algorithm.xtrg.complementreturn the isometric factor of a 1-site split of the center tensor, which spans exactly what the center tensor spans.P = M M†is a projector only for an isometry: the neighbor end of the bond is one, the center end carries the singular values and is not. - The isometric factor of Θ will not serve in its place —
decompkeeps every sector at full dimension regardless of rank, so it can span the whole (bond, physical) space and annihilate the complement. TDVP already had this right; its docstring's aside about DMRG getting away with the raw site tensor is gone. - DMRG: converged energies unchanged, still matching the 2-site scheme to twelve
digits, reached one sweep earlier. XTRG: the expansion grows bonds more
conservatively, so the spinless
L = 10run ends at1.2e-06relative error in log Z rather than1.1e-07— both far below the1.6e-03of the plain 1-site scheme, and a smallertrunc_threshrecovers it. - The projector helpers take their second argument as
A/Bafter the role it plays, with docstrings stating the isometry each one satisfies.
Relative Truncation and Fit Convergence in XTRG¶
trunc_threshis now relative: a singular value is discarded belowtrunc_thresh × ‖C‖, the Frobenius norm of the tensor being decomposed. New_Truncationinsweep.pyresolves it into the absolute cutoff Nicole'sthreshmode expects by measuring the norm of the first tensor a half-sweep decomposes. One measurement suffices —‖C‖grows by well under a factor of two over a sweep, and the first tensor carries the smallest norm, so the cutoff errs on the side of keeping.- Resolution is deferred to first use because
mpo_copens a fit as the unit-norm copy ofmpo_a. A zero or non-finite norm drops the threshold and leavesmax_bondin charge;0.0is passed through. The backward 2-site half-sweep shares one resolved set of options between the trial SVD and the real split. Thecompact()calls in_fit_mpotake the relative number as it stands, normalizing before they truncate. - The default moves from
1e-15to1e-12. Read relatively,1e-15kept 599 states where1e-12kept 377 on an uncapped free-fermion chain, both on the same1e-10accuracy floor in the per-site log Z. z_tolnow compares|‖C‖ − ‖C_prev‖| < z_tol × ‖C_prev‖. Absolute, it was satisfied trivially on a long chain and stopped the inner fit after its first sweep. A vanishingprev_normnever stops early.run()labels both thresholds(relative).
Random MPS Initialization¶
init_mpswithbond_dim > 1draws bond sectors from a depth-2 search around the center-bond charge alone, so a charge path that strays further leaves the boundary bonds with no allowed sector and the canonicalization empties the chain. That object was returned as a usable MPS and failed far from its cause, as a zero-norm Davidson guess; it now raisesValueErrornamingbond_dim,target_qn, andL, and pointing atbond_dim=1with an explicitconfig=orscheme='1sp'.- The random MPS is normalized before return, matching the product-state path, instead of carrying whatever norm its blocks happened to have.
Examples and Documentation¶
tdvp_freefermion.py,tdvp_domainwall.py,tdvp_hubbard.py, andtdvp_hubbard_quench.pyacceptscheme='1sp'withexpand_kandexpand_alpha, scan modes included; the domain-wall bond scan refuses'1s', whose bonds stay at dimension 1 whatevermax_bondsays. The XTRG examples follow the newtrunc_threshdefault.docs/algorithms/xtrg/lessons.mdis rewritten around the relative cutoff: what the threshold is compared against, where the conversion happens, why the scale needs converting, the same reasoning forz_tol, and an admonition that relative is not an error bound.- The four TDVP example pages document
'1sp': a three-scheme table on the free-fermion page; a tip beside the frozen-'1s'warning on the domain-wall page, where'1sp'matches the 2-site occupation error on a smaller bond profile (and the quoted frozen-'1s'error is corrected from0.47to the measured0.421); a section onexpand_kcounting multiplets under SU(2) on the Hubbard page; and the eigenstate limit on the quench page, confirmed to6.7e-14at zero discarded weight.
Tests¶
- New
TestCenterIsometryin the DMRG and XTRGtest_scheme_1sp.py: isometry of the factor, the space it spans, axis order and itags, the center tensor demonstrably not an isometry, each projection idempotent (which it was not before), and the discarded halves orthogonal to the kept space, with guards against assertions passing on a numerically zero half. - New
TestTruncationandTestTruncationScaleintests/algorithm/xtrg/test_sweep.pycover_Truncationdirectly and check that scaling a density matrix by four orders of magnitude leaves the bonds and the reported discarded weight unchanged in all three schemes. - New
TestChainLengthPortabilityintest_xtrg.pycools a spinless chain at four and at ten sites under identical options against the exact single-particle log Z, holding the error flat where it used to lose two orders of magnitude. - New
TestInitMpsEmptyBondsandtest_norm_is_oneintests/network/test_automps.py.
Statistics¶
- 1,357 tests across 38 test modules (up from 1,313 in v0.3.1; no new modules).
- 30 commits since v0.3.1.
- 24 files changed, 1,364 insertions, 184 deletions.
- 35 source modules in five subpackages:
alice.network,alice.physics,alice.algorithm.dmrg,alice.algorithm.xtrg,alice.algorithm.tdvp(unchanged from v0.3.1).
Compatibility¶
- Breaking Changes: none.
- Behavioral Changes:
xtrg.Options.trunc_threshis read relatively and defaults to1e-12, so a value tuned against the old absolute meaning will truncate far more than it used to.z_tolis read relative to‖C_prev‖, so long-chain runs will use more of theirn_sweepsbudget. DMRG and XTRG'1sp'expand bonds more conservatively at a fixedexpand_k.init_mpswithbond_dim > 1raisesValueErrorfor atarget_qnwhose charge path strays from the center-bond sector, and the random mode returns a normalized MPS. - Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.4.2.
0.3.1 - 2026-10-21¶
TDVP: The 1-Site-Plus Scheme
Implements '1sp', the third TDVP update scheme, which v0.3.0 accepted in Options and
rejected in run(). Before each local update it widens the bond ahead of it with up to
expand_k directions drawn from the complement of the space that bond currently spans,
evolves over the widened space, and truncates back — so the rank adapts as it does under
'2s' while every local exponential stays 1-site sized. It is an adaptive-rank scheme of
the '2s' kind at close to 1-site cost, and it is free of the frozen-product-state trap.
No breaking API changes.
The 1-Site-Plus Scheme¶
run()acceptsscheme='1sp'and_IMPLEMENTED_SCHEMESnow holds all three schemes, so theNotImplementedErrorv0.3.0 raised is gone.- Where
'1s'and'2s'split one fixed tangent-space projector,'1sp'rebuilds the space it projects onto at each bond out of the state it finds there, as the sweep reaches it. - Its irreversibility is structural: the expansion is chosen from the state the step
begins in, so forward and backward steps do not widen the bond into the same subspace.
The deviation enters at the order of the integrator error and falls as
dt². expand_k = 0empties the complement and degenerates a'1sp'sweep into a'1s'sweep exactly, which separates an error in the expansion from one in the integrator.- A bond of dimension 1 has a complement like any other, so a quench from a product state
evolves. The frozen-bond warning now recommends
'2s'or'1sp'.
Complement Isometry¶
- New
alice.algorithm.tdvp.complementwithexpand_forward/expand_backward. Following DMRG's'1sp'scheme,His applied independently from the left and the right to a cheaply factored 2-site tensor, the kept subspace is projected out of each half, and the SVD of the doubly-discarded outer product supplies the new basis vectors. - Exact state preservation: only the neighbor is expanded by
oplus, and the center tensor is filled in by projecting Θ onto the expanded neighbor basis, which is exact because the expanded basis contains the old one. Expanding both tensors would move the state. - Exact expanded environment: built by a single
step_*_envcall over the expanded neighbor, keeping the cross blocks a block-diagonal assembly would drop. DMRG can afford to drop them for an initial guess; here a perturbedH_effperturbs the trajectory. - Orthonormal projectors: the neighbor side projects against the site tensor, which is
isometric there; the center side uses a 1-site split of the center tensor, since
M M†is a projector only for an isometry. The isometric factor of Θ must not be used, asdecompkeeps every sector at full dimension and that factor can span the whole (bond, physical) space and project the complement away entirely. expand_kis a cap, not a request: a bond gains however many directions its complement actually holds, typically one or two per update for a short-range Hamiltonian.- Directions below
1e-10times‖lh‖·‖rh‖are cancellation artifacts, lie in the kept space, and are dropped — a relative threshold cannot do this job, shrinking with exactly the quantity whose smallness is the thing to detect. The same absolute floor gates Θ'_disc as a whole, which is where the test must be made: two discarded halves can each keep a sizable remainder while their contraction cancels it, and the SVD returns a unit-norm vector from a zero block regardless. - A bond with no complement — saturated, or out of
H's reach — is left alone, with the environment the 1-site step would have used handed back.
Sweeps and Options¶
- New
_forward_1sp/_backward_1sphalf-sweeps insweep.py, reusing every piece of local arithmetic fromscheme_1s. Each site expands the bond ahead of it, evolves, splits with truncation undermax_bond/trunc_thresh, then back-evolves the bond tensor and absorbs it into the expanded neighbor; the far-end site takes no expansion and no back-evolution. - The zero-site step spans two bonds rather than one:
Cis rectangular, truncated bond on one axis and expanded bond on the other, which is what keeps it exact. split_forward/split_backwardgain an optionaltruncforwarded todecomp, defaulting toNone;'1s'always passesNoneand nothing else inscheme_1struncates.tdvp.Optionsgainsexpand_k(default4) andexpand_alpha(defaultNone), used only by'1sp';max_bondandtrunc_threshnow apply to'1sp'as well, andSummary.discarded_weightsis populated by it.run()logs both settings at startup.- The expansion-option guidance across all three algorithms is now
round(sqrt(max_bond))rather than a bare4.
Tests¶
- New
tests/algorithm/tdvp/test_complement.pycovering the cheap factors, the center-side orthonormalization, the half contractions reassemblingH·Θ̃, the discarded-space projections, complement detection on a bond that has one, a saturated bond, and a vanishing doubly-discarded tensor, and the expansion end to end — bond growth, state preservation, unchanged effective energy and norm, neighbor isometry, the fill-in matching zero padding, chain edges, andalphatruncation.TestNonAbelianrepeats the core cases on an SU(2) Heisenberg chain. - New
TestTruncatingSplitsintest_scheme_1s.py,TestExpansionReversibilityand bond-growth coverage intest_sweep.py,TestFreeFermion1SitePlusandTestMeltingDomainWallintest_physics.pywith adomain_wallfixture and its exact reference, andTestExpansionDriverintest_tdvp.pycovering achieved growth, the logged settings, and a resumed run reproducing an uninterrupted one.
Documentation¶
docs/algorithms/tdvp/index.mdgains a Controlled Bond Expansion section with the option table, whyexpand_kis a cap, the escape from the frozen-product-state trap, and an admonition on the scheme not being exactly time-reversible; the scheme table lists'1sp'in place of the forward-compatibility note.docs/algorithms/tdvp/options.mdgains a Choosingexpand_ksection.- New
docs/examples/tdvp/scheme-comparison.mdandexamples/examples_tdvp/tdvp_scheme_comparison.py: the three schemes on one free-fermion quench from a half-filled product state, scored against the exact correlation matrix, withexpand_kanddtscans.'1s'stays frozen at bond dimension 1 with every conservation law intact;'1sp'and'2s'both land within 9e-05 of the Gaussian solution,'1sp'on a smaller bond profile.
Statistics¶
- 1,313 tests across 38 test modules (up from 1,211 / 37 modules in v0.3.0).
- 30 commits since v0.3.0.
- 17 files changed, 3,109 insertions, 84 deletions.
- 35 source modules in five subpackages:
alice.network,alice.physics,alice.algorithm.dmrg,alice.algorithm.xtrg,alice.algorithm.tdvp.
Compatibility¶
- Breaking Changes: none.
- Behavioral Changes:
tdvp.runno longer raisesNotImplementedErrorforscheme='1sp'.tdvp.Optionsgains two fields,expand_kandexpand_alpha, so positional construction pasttrunc_threshshifts. The frozen-bond warning text now recommends'2s'or'1sp'. - Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.4.2.
0.3.0 - 2026-10-18¶
TDVP: Real-Time Evolution
Introduces TDVP (Time-Dependent Variational Principle), Alice's third algorithm alongside
DMRG and XTRG: a real-time solver that evolves an MPS under exp(-iHt) by projecting the
Schrödinger equation onto the tangent space of the MPS manifold and integrating 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. The network layer gains complex amplitudes:
Network.to(), a dtype keyword on init_mps, and an observe that contracts a complex
state against a real observable. No breaking API changes.
TDVP Algorithm¶
- New
alice.algorithm.tdvppackage exportingOptions,Summary,Artifact, andrun, added to thealice.algorithmand top-levelalicenamespaces along withalice.xtrg. tdvp.run(artifact, H, opts)takes the starting state bundled with itstimeandstepin anArtifactand the Hamiltonian MPO separately, returning(Summary, Artifact). One full sweep is one time step; there is no inner convergence loop and noe_tolanalogue.- The tangent-space projector is never formed. Its positive terms are the single-site
evolutions of the sweep; its negative term is the zero-site back-evolution on each
bond at
-dt, which cancels the double counting between consecutive terms and without which the integrator loses even first-order consistency. - 1-site (
'1s'): exact, non-truncating splits; conserves norm and energy to roundoff and holds every bond dimension fixed. 2-site ('2s', default): evolves the merged two-site tensor and splits it by SVD undermax_bond/trunc_thresh, so bonds adapt as entanglement develops.'1sp'is accepted byOptionsand rejected byrun()withNotImplementedError. - The 1-site manifold has fixed bond dimension, so a quench from a product state stays a
product state forever while norm and energy stay conserved.
run()warns at startup, naming the bonds of dimension 1. order=2(default, Lubich symmetric) andorder=1(Lie-Trotter, with alternating direction) are both globally second order at equal cost — twoorder=1steps of sizedtare exactly oneorder=2step of size2dt. The difference is that everyorder=2snapshot lands at the end of a complete forward-and-backward sweep pair.
Krylov Exponential and Environments¶
- New
krylov.pycomputesexp(-i dt H) vby Lanczos with full re-orthogonalization, exponentiating the tridiagonal exactly vianumpy.linalg.eigh(no SciPy dependency). It stops on happy breakdown, onkrylov_tol, or at thekrylov_dimcap, and reports the error estimate back asSummary.krylov_errors. - New
environ.pystores 3rd-order blocks shared by the 1-site, 2-site, and zero-site effective Hamiltonians, so the zero-site update adds no storage. Disk spilling reuses the DMRG/XTRG sliding-window-plus-async-I/O design.
Options, Summary, Artifact¶
Optionsexposesscheme,dt(may be negative),n_steps,order,max_bond,trunc_thresh,krylov_dim,krylov_tol,renormalize, the environment cache triple,checkpoint_dir,artifacts_dir,save_artifacts, andsave_artifacts_every.renormalizedefaults toFalseso truncation norm loss stays visible.Summarycarriestimes,energies,norms,max_bonds(n_steps + 1entries),discarded_weightsandkrylov_errors(n_stepsentries), and the finalbond_dimsprofile — no state.Artifact(state,time,step) is both input and output ofrun(), which is what makes a resumed run indistinguishable from a fresh one.evolution.ckptandtdvp.ckptare written atomically every step;tdvp.ckptis removed on success. A finished run continues from any archivedartifacts/step_XXXXX.ckptunder new options, and starting before the end of the history truncates and recomputes it (with aWARNING).n_stepsis the absolute step index to stop at, counted fromt = 0.save_artifacts_everythins the archive on the absolute step index, so a stitched trajectory lands on the same grid as an uninterrupted one.run()clampsn_stepsdown to the last grid point and warns, sincetdvp.ckptis removed on success and an off-grid endpoint would leave no snapshot of the final state.
Complex Amplitudes¶
- New
Network.to(device, dtype)casts and moves every site tensor in place, including the Bridge intertwiner weights. Narrowing a complex network to a real dtype raisesValueError. init_mpsgains adtypekeyword (defaulttorch.float64), threaded through both the product-state and random-MPS paths.tdvp.runpromotes a real state and a real MPO tocomplex128in place, logged at INFO, so a DMRG ground state can be handed straight to a quench.observesupports complex states, including against a real observable. Scalar extraction moves into a shared_real_scalarhelper that discards a roundoff-level imaginary part and raises beyond it, and reads a boundary tensor with no data block as an exactly vanishing expectation value.
Tests¶
- Seven new test modules under
tests/algorithm/tdvp/plus a sharedconftest.py.test_physics.pypins the algorithm against physics: the analytic single-particle propagator withdt²convergence, norm/energy/charge conservation across both schemes and orders, forward-backward reversibility, eigenstate phase winding, exactness at full rank, and the frozen product state under'1s'. - New complex-dtype coverage in
test_network.py,test_observe.py, andtest_automps.py, including SU(2), global-phase invariance, a non-Hermitian observable, and a complex thermal density matrix.
Documentation¶
- New
docs/algorithms/tdvp/section (overview,Options,Summary,Artifact,run) and fourdocs/examples/tdvp/walkthroughs, each validated against an analytic reference or across symmetry groups. - Complex-state sections added to
observe.mdandinit-mps.md,torendered onnetwork.md, and TDVP added to the algorithms/examples indexes,mkdocs.yml, and the README — where it also leaves theUpcominglist. - 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 is2^(-N/2)near infinite temperature, so a longer chain needs a proportionally smaller threshold. - The algorithms index gains the XTRG
Artifactrow it was missing, and names every algorithm's entry-point pageLaunchto match the sidebar.
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, and returns0.0for a boundary tensor with no data block where it previously raisedStopIteration.tdvp.runmutates theMPSandMPOit is given, promoting both tocomplex128in place. - Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.4.2.
0.2.8 - 2026-09-22¶
N-Site Terms as Verbatim Windows
Adds InteractionNSite, a third Interaction subclass for Hamiltonian terms with more
than two operators. Instead of naming its sites and letting build_hamiltonian
synthesize the operator string in between, it supplies the entire contiguous window
verbatim — one tensor per site from min(sites) to max(sites), including the identity
and Jordan-Wigner string tensors on sites carrying no operator. build_hamiltonian
accepts the new subclass and now rejects unrecognized Interaction subclasses instead
of silently adding a bare identity term. No breaking API changes.
InteractionNSite¶
- New dataclass in
alice.network.interaction, exported fromalice.networkand the top-levelalicenamespace, addingsites(operator site indices in operator order, e.g.[m, n, k, l]forc†_m c†_n c_k c_l) andtnsrs(the contiguous window of 4-index MPO tensors). sitesis metadata for the model builder: placement depends only on the span covered, sobuild_hamiltonianreads onlymin(sites)andmax(sites)and accepts any permutation.tnsrs[offset]goes at sitemin(sites) + offset, and the two outer bonds of the window must be trivial dim-1 charge-neutral.- Non-contiguous terms are expressed by padding the gaps with identity or string tensors, not by splitting the term.
build_hamiltonian¶
- Handles
InteractionNSitein the validation pass and the accumulation loop, applying the coupling to the last window tensor only — matching the on-site and terminal tensor rules for the other two subclasses. The docstring now states thatcplmust not be baked into the tensors, correcting wording that said otherwise. - New
ValueErrorconditions naming the offending index and sites: emptysites,tnsrs=None, and atnsrswhose length is notmax(sites) - min(sites) + 1. - An active interaction of an unsupported subclass now raises
TypeError; previously it fell through the accumulation loop and contributed a bare identity term.
Tests¶
- New
tests/network/test_autompo.py, the first dedicated AutoMPO test module, built onbuild_fermionic('U1')and a dense Jordan-Wigner reference. TestInteractionNSiteValidationcovers the three new error paths;TestFourOperatorMPOchecks a four-fermion term plus its Hermitian conjugate on anL = 4chain against the exact two-particle sector eigenvalue, an identity-padded gap between disjoint one-body factors, thep = 0density-density term over every two-particle configuration, and a hopping channel matching itsG4/G4dagInteraction2Siteconstruction.
Documentation¶
- New
docs/api/interaction/interaction-nsite.mddescribing the verbatim-window contract, linked from the API and interaction indexes, the other interaction pages, and themkdocs.ymlnavigation. core-concepts.mdnow describes four interaction dataclasses instead of three.
Statistics¶
- 979 tests across 30 test modules (up from 971 / 29 modules in v0.2.7).
- 13 commits since v0.2.7.
- 14 files changed, 477 insertions, 11 deletions.
- 28 source modules in four subpackages:
alice.network,alice.physics,alice.algorithm.dmrg,alice.algorithm.xtrg.
Compatibility¶
- Breaking Changes: none.
- Behavioral Changes:
build_hamiltonianraisesTypeErroron an active interaction that is not anInteraction1Site,Interaction2Site, orInteractionNSite; such objects previously produced an MPO with a spurious identity term. - Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.3.7.
0.2.7 - 2026-09-19¶
Small Norms Are Not Zero
Corrects the zero-norm guards in Network.normalize(), MPO.redistribute_norm(), and
NormalMPO.from_mpo(). These used an absolute tolerance of 1e-15, spuriously
rejecting small but legitimate norms — most importantly the d^(-L/2) norm of a squared
unit-norm identity-like MPO, the XTRG seed scenario on long chains. All three now reject
only an exact zero or a non-finite norm. Package metadata is updated with the new author
and maintainer contacts. No breaking API changes.
Zero-Norm Guards¶
Network.normalize(),MPO.redistribute_norm(), andNormalMPO.from_mpo()raise only when the relevant norm is exactly0.0or not finite (inf/nan). Previouslymath.isclose(n, 0.0, abs_tol=1e-15)rejected any norm below1e-15, even though dividing by such a value is well-conditioned in float64 andmath.log(n)stays finite for any non-zero float64.- Error messages now report the offending value (e.g.
"cannot normalize: network norm is 0.0") instead of the generic"numerically zero"/"zero-norm"wording.
Tests¶
- New
test_small_norm_ok_mpsandtest_redistribute_norm_small_norm_okintest_network.py: scale a canonical network to norm1e-20and check that normalization and redistribution succeed. - New
test_identity_square_small_norm_compactsintest_thermal.py: square a unit-norm identityNormalMPOon anL = 100spin-½ chain (norm2^(-50)), thencompact()it and verifylog_scale, unit internal norm, andlog_trace()against their closed forms. - Existing zero-norm tests updated to the new error messages.
Metadata¶
pyproject.toml: author email moves toc.zhang@ideogenesis.ai; newmaintainersentry for Ideogenesis AI (developer@ideogenesis.ai). Documentation hero image refreshed.
Statistics¶
- 971 tests across 29 test modules (up from 968 / 29 modules in v0.2.6).
- 7 commits since v0.2.6.
- 7 files changed, 79 insertions, 18 deletions.
- 28 source modules in four subpackages:
alice.network,alice.physics,alice.algorithm.dmrg,alice.algorithm.xtrg.
Compatibility¶
- Breaking Changes: none.
- Behavioral Changes:
normalize(),redistribute_norm(), andNormalMPO.from_mpo()no longer raise on norms in(0, 1e-15). TheValueErrormessages for a genuinely zero norm changed wording; callers matching on"numerically zero"or"zero-norm"should match on"norm is 0.0"/"norm 0.0". - Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.3.7.
0.2.6 - 2026-08-20¶
Continuable Cooling, Faster Thermal Measurement
Generalizes XTRG resumption: run() now accepts a starting state from any archived
artifacts/step_XX.ckpt, not just the step the previous run stopped at, so a finished
run can be cooled further or a segment re-cooled under different options. Separately,
observe() on a thermal NormalMPO is rewritten as a transfer-matrix environment
sweep instead of forming and compressing the MPO product ρ · O. No breaking API
changes.
Continuing a Finished XTRG Run¶
run()accepts a state at any step covered bythermal.ckpt, including one before the end of that history; the later entries are truncated (with aWARNING), then recomputed and overwritten on disk together with theirstep_XX.ckptarchives. Previously the history had to end exactly atstate.step.- History recovery moves into a new
_resume_historyhelper, with validation anchored atstate.step— β is compared athistory.betas[state.step]rather than at the end of the history, which is rejected only if it stops beforestate.step. - New checks:
history.betas[0]must matchopts.tau_0, andstate.stepmust not be pastopts.n_steps(which is the absolute step index to stop at, counted from τ₀, not a number of additional steps). - A resumed run's startup banner reports the starting step and steps remaining, and
derives
beta_maxfromstate.betainstead of τ₀.
Thermal observe() via Environment Sweep¶
observe(rho, O)for aNormalMPOnow evaluatesTr[ρ O] / Tr[ρ]with a left-to-right sweep accumulating a(ρ_bond, O_bond)environment, mirroring the MPS path, instead of formingρ · Oat bond dimensionχ_ρ · χ_Oand callingcompact()before the trace.- The ratio is still combined in log-space, so it stays correct when either trace alone
would overflow float64; the boundary scalar accounts for the Bridge (
intw) weight, covering generic symmetry groups. - A length mismatch between
rhoandobservablenow raisesValueError.
Tests¶
- New
TestResumecases intest_xtrg.pyfor continuing a finished run fromstep_02.ckpt, re-cooling from an earlier step (asserting the truncation warning), and the three new error conditions. - New thermal
observe()coverage intest_observe.py, shared via_ObserveThermalTestsand run against both U(1) and SU(2) realizations of the same Heisenberg chain, including an SU(2)-vs-U(1) cross-check of⟨H⟩_β; new session-scopedheisenberg_mpo_u1/heisenberg_mpo_su2fixtures intests/network/conftest.py.
Documentation¶
xtrg/index.mdgains a "Continuing a finished run" section; the module andrun()docstrings document the same, including the newValueErrorconditions.xtrg/summary.mdwarns that a continued run's summary may merge segments computed under different options, withu/c_Vfinite differences at the junction mixing both accuracies.
Statistics¶
- 968 tests across 29 test modules (up from 954 / 29 modules in v0.2.5).
- 8 commits since v0.2.5.
- 8 files changed, 498 insertions, 46 deletions.
- 28 source modules in four subpackages:
alice.network,alice.physics,alice.algorithm.dmrg,alice.algorithm.xtrg.
Compatibility¶
- Breaking Changes: none.
- Behavioral Changes: a
thermal.ckptreaching paststate.stepis now accepted and truncated rather than rejected, while a mismatched τ₀ and astate.steppastopts.n_stepsare now rejected; a continued run overwrites thestep_XX.ckptandthermal.ckptentries past its starting step. Thermalobserve()results may differ in the last few digits, since the environment sweep skips thecompact()compression the MPO-product path applied. - Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.3.7.
0.2.5 - 2026-08-19¶
Independent Artifact Storage for DMRG and XTRG
Decouples archived-artifact storage from the checkpoint directory in both
dmrg.run() and xtrg.run(), via a new Options.artifacts_dir. DMRG gains
final-state archiving to match XTRG's existing per-step archiving; XTRG's mid-run
Artifact file is renamed from progress.ckpt to xtrg.ckpt. Two breaking changes,
both to on-disk file names.
artifacts_dir: Decoupled from checkpoint_dir¶
- New
Options.artifacts_diron bothdmrg.Optionsandxtrg.Options(defaultNone, resolving toartifacts/undercheckpoint_dir); an explicit path archives artifacts elsewhere, independent of where checkpoints themselves live. - XTRG's
save_artifacts/save_artifacts_sincenow writestep_XX.ckptunderartifacts_dirinstead of always undercheckpoint_dir/artifacts. - Both
run()s log the resolved artifacts directory in their startup banner.
DMRG Final-State Archiving¶
- Breaking:
dmrg.run()now archives its finalSummaryasstate.ckptunderartifacts_diron success, then removes the per-sweepdmrg.ckpt/dmrg_lock.ckpt, since they are redundant with the archived artifact. Previouslydmrg.ckptwas left on disk after a successful run. - Unlike the per-sweep checkpoint, the archived
Summarycarries the correctconvergedflag, since it is built after the sweep loop exits.
XTRG xtrg.ckpt Rename¶
- Breaking: the mid-run
Artifactcheckpoint is renamed fromprogress.ckpttoxtrg.ckpt(lock fileprogress_lock.ckpt→xtrg_lock.ckpt), aligning the name with DMRG'sdmrg.ckptas each algorithm's own per-run checkpoint file. Behavior is unchanged: written every step, removed on success.
Tests¶
- New
TestArtifactclass intest_dmrg.py:state.ckptcreation, lock-file cleanup, round-trip loading with a correctconvergedflag, default placement, andartifacts_dirdecoupled fromcheckpoint_dir. - New
artifacts_dirdefault/TOML-round-trip tests in bothtest_dmrg.pyandtest_xtrg.py;test_progress_removed_after_successrenamed totest_checkpoint_removed_after_successand updated forxtrg.ckpt.
Documentation¶
artifact.md's on-disk layout diagram gainsartifacts_dirand thextrg.ckptrename;index.md's resumption example and both example scripts updated fromprogress.ckpttoxtrg.ckpt.
Statistics¶
- 954 tests across 29 test modules (up from 946 / 29 modules in v0.2.4).
- 11 commits since v0.2.4.
- 9 files changed, 214 insertions, 69 deletions.
- 28 source modules in four subpackages:
alice.network,alice.physics,alice.algorithm.dmrg,alice.algorithm.xtrg.
Compatibility¶
- Breaking Changes:
dmrg.run()no longer leavesdmrg.ckpton disk after a successful run — readartifacts_dir/state.ckptinstead. XTRG's mid-runprogress.ckptis renamed toxtrg.ckpt; callers loading it by a hardcoded path must update the filename. - Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.3.7.
0.2.4 - 2026-08-18¶
XTRG: Resumption from Interrupted Runs
Allows an interrupted XTRG run to resume from its last checkpointed step rather than
restarting from ρ(τ₀). This required moving state construction out of run(): it now
accepts a starting Artifact (rho, beta, step) supplied by the caller, instead of
building ρ(τ₀) internally via thermal_mpo(). Breaking change to the signature of
run().
Resumable run()¶
- Breaking:
run(H, spc, opts)becomesrun(state: Artifact, opts=None); the chain lengthLis read fromstate.rho.L, and the internalthermal_mpocall is removed. - At
state.step == 0,run()records the initial(beta, log Z)grid point directly fromstate, as before. When resuming (state.step > 0), it loadsthermal.ckptto recover the priorbetas/log_z/discarded_weightshistory, validates it againststate.stepandstate.beta, and continues squaring fromstate.steponward. - Callers now build the initial state explicitly —
thermal_mpo(...)wrapped in anArtifact— and resume a crashed run by passing theArtifactfromprogress.ckptback intorun().
Tests¶
- New
_initial_statehelper builds the step-zeroArtifact; all existing XTRG tests updated to use it. - New
TestResume(5 tests): a resumed run matches an uninterrupted one's thermodynamics torel_tol=1e-10while only computing the remaining steps; missing or inconsistent checkpoints raiseFileNotFoundError/ValueError; resuming pastn_stepsis a no-op.
Documentation¶
xtrg_spinless,xtrg_spinful, and the XTRG documentation and worked examples (free-fermion, Hubbard) updated to build the initialArtifactviathermal_mpobefore callingrun(). The module docstring andindex.mdgain a resumption example.
Statistics¶
- 946 tests across 29 test modules (up from 940 / 29 modules in v0.2.3).
- 9 commits since v0.2.3.
- 8 files changed, 295 insertions, 82 deletions.
- 28 source modules in four subpackages:
alice.network,alice.physics,alice.algorithm.dmrg,alice.algorithm.xtrg.
Compatibility¶
- Breaking Changes:
xtrg.run()no longer accepts(H, spc, opts); its signature is nowrun(state: Artifact, opts=None). Callers must build the initial state themselves, e.g.xtrg.Artifact(rho=thermal_mpo(H, opts.tau_0, opts.taylor_order, spc), beta=opts.tau_0, step=0).progress.ckptandthermal.ckptfrom earlier versions remain loadable for resumption. - Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.3.7.
0.2.3 - 2026-08-17¶
XTRG: Convergence-Based Early Termination
Lets XTRG's variational compression terminate before exhausting its sweep budget once it
has converged, via a new Options.z_tol tolerance on ‖C‖ between sweeps.
Summary.converged is renamed to Summary.finished to say what it actually means.
One breaking change to Summary's fields.
Early-Termination Compression Fit¶
- New
Options.z_tol(default1e-10):_fit_mpoterminates sweeping once|‖C‖ − ‖C_prev‖| < z_tol, measured at the orthogonality center after each full sweep;n_sweepsbecomes a maximum rather than a fixed count. - The criterion is exact: at the least-squares optimum,
⟨C, A·B⟩ = ‖C‖², so‖C − A·B‖²_F = ‖A·B‖² − ‖C‖²with‖A·B‖fixed across sweeps —‖C‖convergence is equivalent to residual convergence, read from the already-isometric center tensor. z_tol=0.0restores the previous fixed-sweep-count behavior exactly.run()'s startup banner now logs the configured fit convergence threshold.
Summary.finished Rename¶
- Breaking:
Summary.convergedis renamed toSummary.finished; the field was always about whether the summary came from a completedrun()call, not fit convergence.serialize()/deserialize()updated; serialization version stays at 2. - A v0.2.2
thermal.ckptstill loads, but reloads asfinished=Trueunconditionally, since the oldconvergedkey is no longer consulted.
Tests¶
- New
TestFitMpoZTol: a loosez_tolstops early,z_tol=0.0always runs the full sweep budget, and an early-terminated fit reproduces thelog_zof a full-sweep run.
Statistics¶
- 940 tests across 29 test modules (up from 937 / 29 modules in v0.2.2).
- 7 commits since v0.2.2.
- 3 files changed, 119 insertions, 20 deletions.
- 28 source modules in four subpackages:
alice.network,alice.physics,alice.algorithm.dmrg,alice.algorithm.xtrg.
Compatibility¶
- Breaking Changes:
Summary.convergedis renamed toSummary.finished; athermal.ckptfrom v0.2.2 or earlier still loads but reloads asfinished=Trueunconditionally. - Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.3.7.
0.2.2 - 2026-08-14¶
XTRG: Specific Heat and Cache Isolation
Fixes the sign of XTRG's specific heat, which was reported negative for every physical
Hamiltonian, and isolates XTRG's environment disk cache per run so that concurrent jobs
sharing one env_cache_dir no longer overwrite each other's blocks. The remainder is a
consistency pass over the codebase: American English spelling, "index" in place of "leg",
lowercase builtin type annotations, and role-based einsum index names. No breaking
changes.
Specific Heat Sign Fix¶
- Bug fixed:
_compute_observablescomputedc_V[n] = β_n Δu / ln 2, dropping the minus sign inc_V = ∂u/∂T = −β ∂u/∂(ln β). Sinceudecreases with β, the reported specific heat was negative wherever the true value is positive. - Both the interior and the trailing one-sided stencil now carry the correct sign;
free_energies,energies, andentropiesare unaffected.
XTRG Environment Cache Isolation¶
xtrg.run()now creates a unique subdirectory (first 8 hex characters of a UUID4, e.g.{env_cache_dir}/a1b2c3d4/) insideenv_cache_dirper invocation, reused by every squaring step and removed in afinallyblock on return or exception.- Cache-directory resolution moved from
_fit_mpotorun();_fit_mpogains acache_dirparameter and no longer readsopts.env_cache_dir. - The resolved cache path is logged in
run()'s startup banner.
Consistency Pass¶
- All comments, docstrings, and documentation pages converted to American English; "leg" replaced by "index" or an ordinal rank ("2nd-order" instead of "2-leg").
- XTRG drops
typing.Dict/typing.Listfor builtindict/list;sweepgains realOptionsannotations underTYPE_CHECKING. _observe_mps's contraction renamed fromeinsum('ace,abg,cdgh,efh->bdf', …)toeinsum('aob,acr,oprs,bds->cpd', …), following the project's index-naming convention.
Tests¶
- New
TestComputeObservables(specific-heat sign on a two-level system) andTestEnvCache(per-run subdirectory creation and removal, distinct subdirectories across runs, cached run matching the in-memory run, TOML round trip). test_scheme_1s's idempotency test now builds mixed-canonical environments in the compressed MPO's own canonical frame, where the 1-site update is a true variational optimum.
Documentation¶
- New Environment caching for large chains section in the XTRG free-fermion example; the DMRG Hubbard example's caching note updated for the per-run subdirectory.
Statistics¶
- 937 tests across 29 test modules (up from 930 / 29 modules in v0.2.1).
- 44 commits since v0.2.1.
- 48 files changed, 528 insertions, 313 deletions.
- 28 source modules in four subpackages:
alice.network,alice.physics,alice.algorithm.dmrg,alice.algorithm.xtrg.
Compatibility¶
- Breaking Changes: None — fully backward compatible with v0.2.1. Checkpoints from
v0.2.0/v0.2.1 still load, but their
specific_heatsentries must be negated. - Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.3.7.
0.2.1 - 2026-08-07¶
XTRG: Density-Matrix Artifacts
Splits XTRG's density matrix out of Summary into a new Artifact dataclass, and
reworks checkpointing around that split: thermal.ckpt tracks the thermodynamic history
alone, progress.ckpt protects the latest density matrix against a mid-run crash, and an
optional artifacts/ archive keeps a caller-chosen range of per-step density matrices on
disk. xtrg.run() now returns (Summary, Artifact). Breaking change to xtrg.run()'s
return signature and Summary's fields.
Artifact and Checkpointing¶
- New
Artifact(AlgorithmSummary)dataclass holdingrho(NormalMPO),beta, andstep; exported fromalice.algorithm.xtrgalongsideOptions,Summary, andrun. Summarydrops itsrhoandrho_log_scalefields entirely;serialize/deserializebump to version 2 and reject version-1 (rho-carrying) payloads with aValueError.thermal.ckptreplacesxtrg.ckpt(rho-freeSummary, written every step);progress.ckptis new (latestArtifact, deleted on successful completion).- New
Options.save_artifacts(defaultTrue) andOptions.save_artifacts_since(default0) archive per-stepArtifactfiles underartifacts/step_XX.ckpt. checkpoint_dirnow defaults to the current working directory instead of disabling checkpointing when unset.
Examples¶
xtrg_spinlessandxtrg_spinfulreturn(Summary, Artifact)and acceptsave_artifacts/save_artifacts_since; CLI gains--no-save-artifactsand--save-artifacts-since K.
Documentation¶
- New
docs/algorithms/xtrg/artifact.md; other XTRG algorithm pages updated for theSummary/Artifactsplit and the(Summary, Artifact)return tuple.
Statistics¶
- 930 tests across 29 test modules (up from 916 / 29 modules in v0.2.0).
- 19 commits since v0.2.0.
- 14 files changed, 545 insertions, 142 deletions.
- 26 source modules in four subpackages:
alice.network,alice.physics,alice.algorithm.dmrg,alice.algorithm.xtrg.
Compatibility¶
- Breaking Changes:
xtrg.run()returns(Summary, Artifact)instead of a singleSummary;Summaryno longer hasrho/rho_log_scalefields;xtrg.ckptis replaced bythermal.ckptandprogress.ckpt. - Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.3.7.
0.2.0 - 2026-08-01¶
XTRG: Finite-Temperature Thermodynamics
Introduces XTRG (eXponential Tensor Renormalization Group), Alice's second algorithm
alongside DMRG: a finite-temperature solver that computes ρ(β) = e^{-βH} by repeated
squaring, sharing the 1s/2s/1sp update schemes with DMRG. NormalMPO is upgraded to
track its physical magnitude in log form, and observe computes thermal expectation-value
ratios in log-space, keeping both stable arbitrarily deep into a cooling run. One breaking
change to NormalMPO.__init__.
XTRG Algorithm¶
- New
alice.algorithm.xtrgpackage exportingOptions,Summary, andrun, mirroring thealice.algorithm.dmrginterface. xtrg.run(H, spc, opts)initializesρ(τ₀)viathermal_mpo, then repeatedly squares it —ρ(2β) ≈ compress(ρ(β) ⊗ ρ(β))— to reachβ_max = 2^n_steps × τ₀, sampling an exponentially spaced β grid.- Three update schemes for the inner variational MPO-MPO compression
C ≈ A · B: 1-site (1s), 2-site (2s) with SVD truncation, and 1-site-plus (1sp) controlled bond expansion (CBE), adapted from DMRG's'1sp'scheme to the linear (non-eigenvalue) fitting problem. Summaryreportsbetas,log_z,free_energies,energies,specific_heats, andentropiesper cooling step;u,c_V, andSare derived fromlog_zvia log-β finite differences for uniform accuracy across the exponential grid.Options.checkpoint_diratomically checkpointsρand thermodynamic history after every cooling step, matching DMRG's checkpoint pattern.
NormalMPO: Log-Scale Representation¶
- Breaking:
NormalMPO.__init__keyword argument renamed fromscaletolog_scale(log_scale = log(scale)). - New
log_trace()method returns(log|Tr[ρ]|, sign)without ever materializing the raw trace, which can reach~10^500deep into an XTRG run;trace()is now a thin wrapper over it. Newscale_by(log_scale_delta)for in-place log-magnitude updates. __matmul__,__add__, and__mul__combinelog_scaleby addition/subtraction instead of multiplying raw floats; the sign of the physical operator is folded into site 0's tensor data instead.
observe: Log-Space Thermal Ratios¶
_observe_thermalnow computesTr[ρ O] / Tr[ρ]vialog_trace()on both numerator and denominator, combined as(sign_num · sign_den) × exp(log_num − log_den), so the well-behaved O(1) ratio remains correct even when either trace overflows float64.
Documentation¶
- New
docs/algorithms/section (replacing algorithm pages formerly underdocs/api/) with per-algorithm subdirectories (algorithms/dmrg/,algorithms/xtrg/). - New
docs/examples/xtrg/pages for free-fermion and Hubbard worked examples, validated against exact grand-canonical solutions. - README's Algorithms section gains an XTRG subsection alongside the existing DMRG one, plus a new Upcoming list (tanTRG, TDVP, TaSK).
Statistics¶
- 916 tests across 29 test modules (up from 814 / 23 modules in v0.1.6).
- 66 commits since v0.1.6.
- 49 files changed, 6,172 insertions, 92 deletions.
- 28 source modules in four subpackages:
alice.network,alice.physics,alice.algorithm.dmrg,alice.algorithm.xtrg.
Compatibility¶
- Breaking Changes:
NormalMPO.__init__keyword argument renamed fromscaletolog_scale;NormalMPO.from_mpo(),thermal_mpo(), and thescaleread-only property are unaffected. - Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.3.7.
0.1.6 - 2026-06-10¶
MPS Initialization for Odd Chains
Extends init_mps with a target_qn parameter for explicit quantum-number targeting,
fixes a silent zero-MPS bug in random initialization for odd-L chains, and replaces
warnings.warn with structured logging throughout automps. No breaking changes.
init_mps: target_qn Parameter¶
- New
target_qnkeyword oninit_mps: the desired right-boundary chargeQ[L](total quantum number of the chain). Defaults toQ_vac(half-filling), preserving behavior for even-L even-filling cases. - When
target_qnis given and the auto-config cannot reach it (e.g.target_qn=0for odd-L spin-½),init_mpsraises aValueErrorin both modes rather than silently producing an MPS in the wrong sector.
Odd-L Random MPS Fix¶
- Bug fixed:
_random_mpspreviously pinned both boundary indices toOp['vac'](chargeQ_vac). For odd L, where no config can return toQ_vac, every charge block of the last tensor was forbidden and the MPS canonicalized to zero. - The right boundary is now constructed with
Q[L](the actual charge reached by the auto-config path) whentarget_qnwas not given explicitly. For even L this is stillQ_vac; for odd L it is the correct non-vacuum charge.
Warning System Upgrade¶
init_mpsno longer callswarnings.warn(UserWarning)for odd-L chains whereQ_vacis unreachable. The message is now emitted vialogging.getLogger(__name__)and recommends passingtarget_qnexplicitly.
_auto_config Generalization¶
_auto_confignow acceptstarget_qnand all three internal strategies (single-sector fill, period-2 alternation, greedy fallback) targettarget_qninstead ofQ_vac.- The function is now a pure helper with no side effects; the sole warning site is
init_mps.
Documentation¶
init-mps.mdgains a Logic Overview decision diagram, an Odd-chain lengths section with a spin-½ example, and a corrected Bond Sectors in Random Mode table note (BFS is seeded fromQ_c = Q[L//2], not fromQ_vac).
Statistics¶
- 814 tests across 23 test modules (up from ~795 / 23 modules in v0.1.5).
- 5 commits since v0.1.5.
- 4 files changed, 423 insertions, 89 deletions.
- 22 source modules in three subpackages:
alice.network,alice.physics,alice.algorithm.dmrg.
Compatibility¶
- Breaking Changes: None — fully backward compatible with v0.1.5.
- Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.3.7.
0.1.5 - 2026-06-08¶
Cache Isolation and Thermal MPO
Fixes DMRG environment-block caching for concurrent runs and corrects the early-stopping
criterion in thermal_mpo to account for the operator norm of H. No breaking changes.
DMRG Environment Cache Isolation¶
dmrg.run()now creates a unique subdirectory (first 8 hex characters of a UUID4, e.g.{env_cache_dir}/a1b2c3d4/) insideenv_cache_dirper invocation. Previously, concurrent runs sharing the sameenv_cache_dirwrote to the sameleft/andright/paths and could corrupt each other's cached blocks.- The unique subdirectory is removed automatically in a
finallyblock on return or exception, leaving no stale files behind. Options.env_cache_dirdocstring updated to document the subdirectory scheme and automatic cleanup.
thermal_mpo Early-Stopping Correction¶
- The early-stopping guard now tests
|β^n / n!| × ‖H^n‖_F < coeff_threshrather than the bare coefficient|β^n / n!|alone. For Hamiltonians with large operator norm,‖H^n‖_Fcan be much larger than 1, causing the old criterion to exit prematurely before the series had converged. - The conditional that skipped the power-update step when the next coefficient was small
has been removed;
H_powis now always advanced whenn < order. orderandcoeff_threshparameter docstrings updated to describe the corrected criterion.
Statistics¶
- ~795 tests across 23 test modules (up from ~740 / 23 modules in v0.1.4).
- 3 commits since v0.1.4.
- 4 files changed, 141 insertions, 19 deletions.
- 22 source modules in three subpackages:
alice.network,alice.physics,alice.algorithm.dmrg.
Compatibility¶
- Breaking Changes: None — fully backward compatible with v0.1.4.
- Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.3.7.
0.1.4 - 2026-05-31¶
Thermal Density Matrix
Introduces NormalMPO, an MPO subclass with a separately tracked scale factor, and
thermal_mpo, which approximates ρ(β) = exp(−βH) via a truncated Taylor series in MPO
arithmetic. The observe function is extended to accept NormalMPO as the state
argument, enabling finite-temperature expectation values within the existing workflow.
No breaking changes.
NormalMPO¶
- New
NormalMPOclass inalice.network.thermal: represents an operator asscale × mpo_unit, keeping the internal MPO at unit Frobenius norm and carrying the physical magnitude in a separate_scaleattribute. *(scalar multiply): only_scaleis updated; site tensors are not modified.@(MPO product) and+(MPO sum) produce new site tensors with_scaleset to the combined physical magnitude.compact()folds the extracted SVD norm into_scaleafter each compression sweep and restores standard bond-arrow directions viacapcup.- Class method
NormalMPO.from_mpo(mpo)constructs aNormalMPOfrom any plainMPO. - Exported from
alice.networkand thealicetop-level namespace.
thermal_mpo¶
- New
thermal_mpo(H, beta, order, spc)function: computesρ(β) ≈ Σ (−β)^n/n! · H^nvia MPO arithmetic, callingcompact()after every addition and power step to control bond growth. Early exit when the Taylor coefficient drops belowcoeff_thresh(default1e-15). - The returned
NormalMPOcarries_scale ≈ Tr[ρ](the partition function, up to the MPO norm). - Exported from
alice.networkand thealicetop-level namespace.
observe Updated for Thermal States¶
observenow accepts aNormalMPOas the state argument: forms the MPO productρ @ O, compresses it withcompact(), and returnsTr[ρ O] / Tr[ρ]— the normalized thermal expectation value.
Documentation¶
- New API reference pages for
NormalMPOandthermal_mpo;alice.networkindex andobservereference updated to document the new types.
Statistics¶
- ~740 tests across 23 test modules (up from ~700 / 22 modules in v0.1.3).
- 13 commits since v0.1.3.
- 9 files changed, 1,192 insertions, 10 deletions.
- 22 source modules in three subpackages:
alice.network,alice.physics,alice.algorithm.dmrg.
Compatibility¶
- Breaking Changes: None — fully backward compatible with v0.1.3.
- Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.3.7.
0.1.3 - 2026-05-13¶
MPS Init and DMRG Checkpointing
Introduces init_mps, a universal MPS initializer that replaces the per-example
_random_mps helpers with a single particle-type–agnostic function. Adds atomic
per-sweep checkpointing to DMRG via dmrg.Options.checkpoint_dir, and exposes
Network.bond_states for counting physical states at each bond in non-Abelian
simulations. No breaking changes.
Universal MPS Initializer¶
- New
alice.network.autompsmodule withinit_mps: constructs an initial MPS for DMRG from any(Spc, Op)pair returned byload_space. Works for bosonic, fermionic, and conductor sites without aparticle_type=argument. bond_dim=1: deterministic product state with exact charge targeting, one sector per bond; best paired with CBE (scheme='1sp') or 2-site (scheme='2s') DMRG.bond_dim>1: random MPS with group-derived bond sectors; reachable charges are selected by BFS from the center-bond charge to depth 2.- Auto-balanced
config=Noneheuristic covers all standard even-L half-filled cases: alternating high/low for 2-sector spaces, single neutral sector for 3-sector spaces, alternating neutral-pair for 4-sector spaces, SU(2) dimer path for pure-SU(2) spaces. - Exported from
alicetop-level namespace and fromalice.network. - DMRG example scripts (
dmrg_heisenberg,dmrg_freefermion,dmrg_conductor) updated to accept aninitparameter ('iter_diag'or'random') usinginit_mps; per-example_random_mpshelpers removed.
DMRG Checkpointing¶
- New
checkpoint_diroption indmrg.Options: after every completed sweep the current state is serialized todmrg.ckptvia an atomic write (write todmrg_lock.ckpt, then rename). On POSIX systems the rename is atomic, so a crash during serialization cannot corrupt the previous checkpoint. - Checkpoint file is in PyTorch format, loadable via
dmrg.Summary.load. - Defaults to the current working directory at
run()call time (matching.logging).
Network.bond_states¶
- New
bond_statesproperty onNetwork: returns the number of physical states per internal bond (lengthL - 1). Equal tobond_dimsfor Abelian groups; larger for SU(2) due to multiplet degeneracy (2j+1 states per multiplet of spin j).
Documentation¶
- New API reference page for
init_mpswith parameter table, charge-convention notes, and runnable examples;Networkreference updated withbond_states. - Quick-start guide updated to use
init_mpsand theSummarycheckpoint interface.
Statistics¶
- ~700 tests across 22 test modules (up from ~650 / 21 modules in v0.1.2).
- 16 commits since v0.1.2.
- 17 files changed, 1,319 insertions, 187 deletions.
- 21 source modules in three subpackages:
alice.network,alice.physics,alice.algorithm.dmrg.
Compatibility¶
- Breaking Changes: None — fully backward compatible with v0.1.2.
- Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.3.6.
0.1.2 - 2026-05-11¶
Geometry Expansion and Refactor
Introduces Kagome lattice support, a full refactor of the geometry subsystem around a
Geometry dataclass, a unified traversal-order naming scheme, and ASCII text diagrams
for MPS and MPO chains. Also adds Sp4/Sm4 operator templates to build_bosonic and
build_conductor. Several breaking changes to the geometry and build_interaction APIs;
the DMRG, Hamiltonian, and algorithm APIs are unchanged.
Kagome Lattice¶
- New
alice.physics.kagomemodule withintrcmap_kagome: nearest-neighbor bond generation for Kagome lattices, covering N2U (upward-triangle: A–B, A–C, B–C within each unit cell) and N2D (downward-triangle: bonds between adjacent unit cells), with OBC/PBC boundary conditions along both axes. - Traversal orders
'sequential'(column-major, default) and'serpentine'(column-major with alternating row direction) for Kagome lattices. intrcmap_kagomeis exported fromalice.physicsalongsideintrcmap_1dchainandintrcmap_square.
Geometry Module Refactor¶
- New
Geometrydataclass returned bybuild_geometry; carriescfg,ord_map, andlattas a single typed object with derived propertieslattice,traverse,lx,ly,L, and helpersto_1d/to_2d. - All
intrcmap_*functions now take aGeometryas input (previously a plain dict) and continue to returnList[Interaction2Site]. build_interactionnow returns(interactions, spc, geo)— the third element changed from anint(site count) to theGeometryinstance.- New
build_intrcmap(geo)dispatcher: reconstructs the bond list from anyGeometryinstance, decoupling lattice construction from bond enumeration. - New
build_traversalhelpers in all three lattice modules (chain.py,square.py,kagome.py); 1D chain and square lattice geometries separated into their own modules. ord_mapkeys changed from integer flat indices to coordinate tuples:(row, col)for chain and square,(row, col, u)for Kagome (whereuis the sublattice index 0=A, 1=B, 2=C), making coordinate lookups explicit for all lattice types.
Traversal Order Naming¶
'snake'is renamed to'serpentine'(same behavior: columns alternate direction, even columns top→bottom, odd columns bottom → top).'sequential'is a new order (all columns top → bottom, no reversal) and is now the default for square and Kagome lattices.- All documentation, example configs, and tests updated to the new naming.
MPS/MPO Text Display¶
- New
alice.network.displaymodule withnetwork_summary: Unicode ASCII-art chain diagrams showing tensor nodes, bond dimensions, center site, and summary info. MPS.__repr__andMPO.__repr__delegate tonetwork_summary, giving readable representations in REPLs and notebooks.
New Operator Templates¶
build_bosonicandbuild_conductorgainSp4/Sp4dag/Sm4/Sm4dagtemplates (U(1)-only), enabling AutoMPO construction for models where raising and lowering channels must be handled separately.
Documentation¶
- New API reference pages for
intrcmap_kagomeandbuild_intrcmap; geometry and traversal pages updated to reflect the refactored two-stage construction pipeline. - All documentation page headings standardized to title case.
Statistics¶
- ~650 tests across 21 test modules (up from 538 / 19 modules in v0.1.0).
- 119 commits since v0.1.1.
- 65 files changed, 3,380 insertions, 824 deletions.
- 20 source modules in three subpackages:
alice.network,alice.physics,alice.algorithm.dmrg.
Compatibility¶
- Breaking Changes:
build_geometryreturn type changed fromList[Interaction2Site]toGeometry.- All
intrcmap_*functions now take aGeometryas input instead of a plain dict; return typeList[Interaction2Site]is unchanged. build_interactionthird return value changed fromint(site count) toGeometry.geometry_fncallable override signature changed from(geo: dict) -> List[Interaction2Site]to(geo_cfg: dict) -> Geometry; a newintrcmap_fnoverride was added with signature(geo: Geometry) -> List[Interaction2Site].- The public function
generate_snake_orderis removed; its traversal logic is now internal. - The TOML key
traverse: 'snake'is deprecated;'snake'was renamed to'serpentine', and'sequential'is the new default order.
- Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.3.6.
0.1.1 - 2026-05-06¶
Documentation Website
Introduces the complete Alice documentation site: Material-themed MkDocs with a full API
reference, worked DMRG examples, and getting-started guides. Also
renames the PyPI distribution to alice-net. No changes to the Alice project; fully
backward compatible with v0.1.0.
Documentation Infrastructure¶
- Custom
alicecolor scheme, three-tab navigation, dark/light/system theme switching, search with suggestions and shareable links - Content features: code copy, inline annotations, tabbed content, in-page edit and view actions
- Custom home page template (
docs/overrides/home.html) with hero image and feature cards; custom stylesheet (docs/stylesheets/extra.css) - Build hook (
docs/hooks.py) for table-cell bullet-list post-processing - Plugins: mkdocstrings (NumPy-style API docs), markdown-exec (configured for future live execution), git-revision-date-localized, git-committers
- Extensions: MathJax via
arithmatex, Mermaid viasuperfences, tabbed content, FontAwesome/Material emoji
Getting Started (7 pages)¶
- What is Alice: philosophy, relationship with Nicole, supported symmetry groups and algorithms
- Installation:
pip install alice-net/uv add alice-net, development setup, optional dependency groups - Core Concepts: MPS/MPO block-sparse structure, symmetry sectors, DMRG sweep logic
- Quick Start: end-to-end Heisenberg DMRG example from site definition through energy output
- Contributing: branch model, coding conventions, test requirements
- Git Control: tagging, branching, and release workflow for the Alice project
- Changelog: version history beginning with v0.1.0
API Reference (30 pages)¶
- Network —
Network,MPS,MPO: construction, canonicalization, norm, serialization, SVD compression, norm redistribution;observe: expectation-value sweep with SU(2) Bridge weight support - Interaction —
Interaction,Interaction1Site,Interaction2Sitedataclass references;build_interaction: TOML-configured builder with plugin section documentation - Geometry —
generate_snake_order,intrcmap_1dchain,intrcmap_square,build_geometry: function references with parameter tables and usage notes - Local Space —
build_bosonic,build_fermionic,build_conductor: site Hilbert space constructors with symmetry-mode tables - Hamiltonian —
build_hamiltonian: MPO assembler;build_heisenberg,build_free_fermion,build_hubbard: model-specific builders - DMRG —
dmrg.Options: parameter reference with TOML key mapping;dmrg.Summary: output fields and serialization;dmrg.run: sweep logic, update schemes (1s,2s,1sp), convergence criteria - Logging —
configure_logging: handler configuration, log levels, output file naming
Examples (8 pages)¶
- Heisenberg chain: ground-state energy of a spin-½ chain, U(1) and SU(2) symmetry comparison
- Free fermion: tight-binding chain benchmark against exact diagonalization
- Hubbard model: charge and spin sector targeting in a single-band system
- AutoMPO from TOML:
[[interaction]]tables,[plugin]sections for user-defined models, built-in presets - Custom geometry: implementing a user-defined lattice traversal and registering it with
build_geometry - Custom local space: defining a new site Hilbert space outside the built-in presets
- Custom model: wrapping a user-defined Hamiltonian function as an Alice-compatible builder
Packaging¶
- PyPI distribution renamed from
alicetoalice-net;pyproject.tomlupdated with wheel target and project URLs; README and logging banner updated - Install:
pip install alice-netoruv add alice-net; the import namespacealiceis unchanged
Statistics¶
- 45 documentation pages; all public symbols documented
- 39 commits since v0.1.0
- 112 files changed, 3,161 insertions, 63 deletions
Compatibility¶
- Breaking Changes: None — fully backward compatible with v0.1.0; import paths, function signatures, and TOML configuration formats are unchanged
- Requirements: Python ≥ 3.11, PyTorch ≥ 2.5, Nicole ≥ 0.3.6
0.1.0 - 2026-05-04¶
Initial stable release of Alice.
Tensor Network Infrastructure¶
MPS,MPO, andNetworkclasses: block-sparse matrix product states and operators inheriting Nicole's exact symmetry engine with full support for U(1), Z(2), SU(2), and product symmetry groups.Network.canonical(): left/right QR canonicalization with configurable bond truncation.Network.norm()andnormalize(): Frobenius norm via the center tensor or a full transfer-matrix sweep.Network.serialize()/Network.deserialize():torch.save-compatible serialization preserving all index metadata.MPO.compact()andMPO.redistribute_norm(): SVD compression and norm redistribution.observe(): expectation-value computation via MPS–MPO–MPS transfer-matrix sweep, with SU(2) Bridge weight support.
AutoMPO Construction¶
build_interaction(): TOML-configured interaction map builder with built-in Heisenberg, free-fermion, and Hubbard model presets and support for user-defined model functions via[plugin]sections.build_hamiltonian(): term-by-term MPO assembler using Nicole'soplus; compresses the result with two canonical sweeps; handles non-Abelian SU(2).Interaction,Interaction1Site,Interaction2Sitedataclasses.- Incremental
compact_everyparameter to limit bond dimension growth during large builds.
Lattice Geometries¶
intrcmap_1dchain(): nearest-neighbor 1D chain with optional PBC.intrcmap_square(): 2D square lattice with NN and NNN bonds, PBC support, and snake-order traversal.generate_snake_order(): boustrophedon traversal for rectangular lattices.build_geometry(): TOML dispatcher for lattice and traversal selection.
Physical Spaces¶
build_bosonic(): spin-ssite; U(1) and SU(2) symmetry.build_fermionic(): spinless-fermion site; U(1) and Z(2) symmetry.build_conductor(): spinful-fermion (Band) site; U(1)×U(1), Z(2)×U(1), U(1)×SU(2), Z(2)×SU(2) symmetry.
Physics Models¶
build_heisenberg(): Heisenberg spin model with NN couplingJand optional NNNJ'.build_free_fermion(): spinless tight-binding chain with hoppingt, optional NNNt', and chemical potentialµ.build_hubbard(): Hubbard model with hoppingt, on-siteU, optional NNNt', andµat half-filling.
DMRG Algorithm¶
dmrg.Optionsdataclass: all run parameters with TOML loading viaOptions.from_toml().dmrg.Summarydataclass: energy, optimized MPS, convergence info, and serialization.dmrg.run(): alternating sweep optimization with three update schemes (1s,2s,1sp).- Davidson eigensolver with thick restart operating directly in the symmetry-block-sparse space.
Environmentclass with optional disk-spilling (sliding window + async I/O).
Logging¶
configure_logging(): one-call setup of Alice's two-handler logging scheme (console + timestamped file). Emits startup banner, model specification summary, sweep-by-sweep diagnostics, and geometry ASCII diagrams.
Statistics¶
- 538 tests across 19 test modules.
- 196 commits across 10+ feature branches.
- 64 files, ~16,000 lines of code.
- 16 source modules in three subpackages:
alice.network,alice.physics,alice.algorithm.dmrg.