Alice 0.1.2
Alice 0.1.2 — Geometry Expansion and Refactor
Release Date: May 11, 2026
Version 0.1.2 adds Kagome lattice support, refactors the geometry subsystem around a
Geometry dataclass, unifies traversal-order naming across all lattices, introduces
ASCII text diagrams for MPS and MPO chains, and adds Sp4/Sm4 operator templates
to the physical-space builders. Several breaking changes to the geometry and
build_interaction APIs are detailed in the Compatibility section.
🗺️ Kagome Lattice
intrcmap_kagome
- New
alice.physics.kagomemodule implementing nearest-neighbor bond generation
for Kagome lattices with a three-site unit cell (sublattices A=0, B=1, C=2). - Two bond families, independently enabled via
n2uandn2dconfig keys:- N2U — upward-triangle bonds: A–B, A–C, B–C within each unit cell.
- N2D — downward-triangle bonds: B↔A_right (bond 4), C↔A_below (bond 5),
C↔B_below-left (bond 6), connecting adjacent unit cells.
- Supports OBC and PBC along both axes; PBC bonds carry the
'PBC'label. intrcmap_kagomeis exported fromalice.physicsat the same level as
intrcmap_1dchainandintrcmap_square.
Traversal Orders for Kagome
'sequential'(default): column-major, all columns fill rows top→bottom.'serpentine': column-major with alternating direction (even columns
top→bottom, odd columns bottom→top).- Both traversals are registered in the
_TRAVERSALSdict inkagome.py
and accepted bybuild_geometryviatraverse:in the TOML[geometry]block.
🔧 Geometry Module Refactor
Geometry Dataclass
build_geometrynow returns aGeometryinstance (previously returned
List[Interaction2Site]directly).Geometrycarriescfg,ord_map, andlattas a single typed object, plus
derived propertieslattice,traverse,lx,ly, andL.- Helper methods
to_1d(coord)andto_2d(site)convert between coordinate
tuples and 1D MPS site indices. - All
intrcmap_*functions now take aGeometryas input (previously a plain dict);
their return typeList[Interaction2Site]is unchanged. build_interactionnow returns(interactions, spc, geo)— the third element
changed from anint(site count) to theGeometryinstance.- A new
intrcmap_fnoverride parameter was added tobuild_interactionwith
signature(geo: Geometry) -> List[Interaction2Site]; the existinggeometry_fn
signature changed from(geo: dict) -> List[Interaction2Site]to
(geo_cfg: dict) -> Geometry.
build_intrcmap
- New dispatcher
build_intrcmap(geo)reconstructs the bond list from anyGeometry
instance by looking up the registeredintrcmap_*builder forgeo.lattice. - Useful for inspecting bonds after geometry construction without re-running the
full traversal.
Module Separation and build_traversal
- 1D chain, square lattice, and Kagome geometry code separated into their own modules
(chain.py,square.py,kagome.py), each exposing abuild_traversaldispatcher. build_traversalvalidates thetraversekey, selects the correct generator, and
returns(ord_map, latt), whichbuild_geometrywraps into aGeometry.
Coordinate Tuples in ord_map
ord_mapkeys changed from integer flat indices to coordinate tuples:
(row, col)for chain and square,(row, col, u)for Kagome (sublatticeu).latt[site]returns the corresponding coordinate tuple for any site index.- Key length is lattice-dependent; the
Geometrydocstring documents both conventions.
🔤 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 TOML configs, and tests updated to the new naming.
🖥️ MPS/MPO Text Display
alice.network.display
- New module with
network_summary: renders a three-block Unicode ASCII diagram
(title, chain row with tensor nodes and bond-dimension labels, info block with
length and center/norm summary) for anyMPSorMPOinstance. - The center tensor is highlighted with ⊙; non-center MPS sites with ○ and MPO
sites with □/⊡.
__repr__ on MPS and MPO
MPS.__repr__andMPO.__repr__delegate tonetwork_summary, providing
readable representations in REPLs, Jupyter notebooks, and log output.
⚛️ New Operator Templates
build_bosonicgainsSp4/Sp4dagandSm4/Sm4dag4th-order templates
(U(1)-only): same leading/terminal layout asS4/S4dagbut for the raising
(Sp) and lowering (Sm) channels individually, useful when the two channels
must be handled separately (e.g. anisotropic couplings or single-channel models).build_conductorgains the sameSp4/Sp4dag/Sm4/Sm4dagtemplates for
spinful-fermion sites (Abelian symmetry groups only).
📖 Documentation
New API Pages
intrcmap_kagome: full function reference with parameter table, bond-family
description, and label convention.build_intrcmap: dispatcher reference with usage example showing the two-stage
geometry-then-bonds workflow.
Updated Geometry Pages
intrcmap_1dchain,intrcmap_square,build_geometry: updated to document the
Geometryreturn type,build_traversal, and the revised traversal-order names.- Geometry section restructured to reflect the two-stage pipeline:
build_geometry→build_intrcmap→build_interaction.
Heading Standardization
- All documentation page headings standardized to title case throughout the
Getting Started, API Reference, and Examples sections.
📊 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 new
intrcmap_fnoverride was added with signature
(geo: Geometry) -> List[Interaction2Site].- The public function
generate_snake_orderis removed; its traversal logic is now
internal tobuild_geometry. - 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
📝 Notes
The Geometry dataclass was introduced to make the geometry pipeline universal and
extensible. Previously, build_geometry merged traversal and bond generation into one
step and returned the interaction list directly. Adding a new lattice type meant
reimplementing that entire combined step. The new design separates concerns cleanly:
build_geometry produces a Geometry struct (traversal only), and each lattice
module implements intrcmap_* against that struct. The same Geometry can then be
passed to different intrcmap_* builders — for example, to compare bond sets on the
same lattice — without rerunning the traversal.
The coordinate-tuple keys in ord_map serve the same goal: previously, ord_map was
a 2D list accessed as ord_map[row][col], which does not generalise to a
three-sublattice lattice where each site also has a sublattice index. Using a dict
keyed by (row, col) or (row, col, u) handles both cases with the same interface.