Index¶
Symmetry-aware tensor index defining direction, group, and charge sectors.
Index
dataclass
¶
Symmetry-aware tensor index capturing direction, group, and charge sectors. Keeps tensor indices self-consistent so fusion and splitting utilities can rely on validated charges. The flipping pair streamline common tensor network rewrites.
Attributes:
| Name | Type | Description |
|---|---|---|
direction |
Direction
|
Orientation of the index (e.g. bra vs ket index). Flips determine how charge conjugation is applied. |
group |
SymmetryGroup
|
Symmetry group object responsible for validating and fusing charges. |
sectors |
Tuple[Sector, ...]
|
Tuple of |
dim (property) |
Property returning the total dimension derived from |
Methods:
| Name | Description |
|---|---|
dual |
Reverse orientation with or without charge conjugation to suit diagram manipulations. |
Description¶
An Index represents a single index of a tensor, specifying:
- Direction:
Direction.OUTorDirection.IN - Symmetry Group: The group governing charge conservation
- Sectors: Available charge sectors with their dimensions
Indices are immutable (frozen dataclasses) to ensure consistency across tensor operations.
Direction Rules¶
Direction.OUT: Charge contributes with positive sign (+)Direction.IN: Charge contributes with negative sign (-)
For charge conservation: ∑(OUT) - ∑(IN) = neutral
Methods¶
flip()¶
Returns a copy with direction reversed but charges unchanged.
dual()¶
Returns a copy with direction reversed AND charges conjugated.
See Also¶
- Sector: Charge-dimension pairs
- Direction: Index direction enum
- Tensor: Main tensor class
- Examples: First Tensor
Notes¶
For contraction, indices must have: 1. Opposite directions (OUT ↔ IN) 2. Same symmetry group 3. Compatible charge sectors