Block Utilities¶
Low-level utilities for managing tensor block structure.
Description¶
The blocks module provides internal utilities for reasoning about tensor block dictionaries. Most users won't need these directly.
Key Concepts¶
BlockKey¶
A BlockKey is a tuple of charges, one per tensor index:
from nicole.blocks import BlockKey
# For a 2-index U(1) tensor
key1 = (0, 0) # Both indices have charge 0
key2 = (1, 1) # Both indices have charge 1
BlockSchema¶
Static utility class for block operations:
iter_admissible_keys(): Generate all possible charge combinationsshape_for_key(): Get block shape from keyvalidate_blocks(): Validate block datacharges_conserved(): Check conservation for a keyblock_add(): Merging or concatenating weights from a pair of blocksblock_compress(): Remove linearly dependent components from a block
Usage¶
from nicole.blocks import BlockSchema
# Check if block conserves charge
conserved = BlockSchema.charges_conserved(indices, block_key)
See Also¶
Notes¶
These are internal utilities. Most functionality is accessed through the Tensor class interface.