iNetwork¶
Base class for 1D tensor network unit cells with infinite boundaries.
iNetwork
¶
Base class for 1D tensor network unit cells with infinite boundaries.
Stores the N site tensors of one translation-invariant unit cell and
provides uniform iteration, bond bookkeeping, and axis conventions.
Subclasses add the per-type validation (iMPS, iMPO) and, for states,
the gauge-fixing machinery.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tensors
|
List[Tensor]
|
Non-empty list of the unit cell's site tensors. |
required |
center
|
Optional[int]
|
Orthogonality center site index, or |
None
|
itag_prefix
|
Optional[str]
|
Bond itag prefix string. Defaults to |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Attributes¶
center
property
¶
Orthogonality center site index, or None if unspecified.
Read-only. Set internally by the gauge-fixing routines.
bond_dims
property
¶
Bond dimension at each bond of the unit cell (length N).
Entry i is the dimension of the right bond of site i. Entry
N-1 is the bond onto the next copy of the cell, which is the same
bond as the left bond of site 0 — note the length is N, not
N-1 as in the finite case.
bond_states
property
¶
Number of physical states at each bond of the unit cell (length N).
Entry i is the state count of the right bond of site i. For
Abelian symmetry groups this is identical to bond_dims; for generic
groups (e.g. SU(2)) it is larger due to multiplet degeneracy: each
multiplet of spin j contributes 2j+1 states.
phys_dims
property
¶
Physical dimension at each site of the unit cell (axis 2, the ket index).
itag_prefix
property
writable
¶
Prefix string for bond itags produced by the gauge-fixing sweeps.
The left bond of site i is tagged {prefix}{i % N:0M} and the
right bond is tagged {prefix}{(i+1) % N:0M}, where M is
max(2, len(str(N))). Changing the prefix only affects future
canonicalization calls; existing itags are not retroactively renamed.
Methods:¶
to
¶
Move every site tensor to device and cast it to dtype, in place.
Both arguments are optional and an omitted one leaves that aspect of the tensors alone. Casting the blocks also casts the Bridge intertwiner weights, which a generic symmetry group needs: the two must agree for the tensor to contract.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device
|
Optional[Union[str, device]]
|
Target device. If |
None
|
dtype
|
Optional[dtype]
|
Target block dtype. If |
None
|
serialize
¶
Convert the unit cell to a plain dict compatible with torch.save.
The returned dict contains only Python primitives and torch.Tensor
values, making it directly usable with
torch.save / torch.load(..., weights_only=True).
Returns:
| Type | Description |
|---|---|
dict
|
Serialized representation with keys |
deserialize
staticmethod
¶
Reconstruct an iNetwork (or subclass) from a dict from serialize.
Dispatches to the correct subclass (iNetwork, iMPS, or iMPO)
based on the "class" key in data. The registry is separate from
the finite one, so a finite payload cannot be loaded as an infinite
network or the other way around.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict
|
Dict previously produced by |
required |
device
|
str
|
Device to place all tensor blocks on. Defaults to |
'cpu'
|
Returns:
| Type | Description |
|---|---|
iNetwork
|
Reconstructed network on device. The concrete type matches what was serialized. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Notes¶
The cell is cyclic: bond N is bond 0, and the constructor checks that the
right index of each site matches the left index of the next, the last site
meeting the first. bc is fixed to 'IBC' for the whole family, so code that
dispatches on boundary conditions can treat finite and infinite networks
alike.
Canonicalization does not live here, unlike in Network. An infinite cell has no end to sweep orthogonality in from, so the gauge is solved for and not swept, and iMPS carries that machinery alone. An iMPO is never canonicalized at all.