1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! Block-sparse tensor storage for abelian symmetries.
//!
//! Provides [`BlockSparseTensorData<T, S>`] — the joined storage +
//! layout bundle for tensors whose blocks are constrained by an
//! abelian conservation law (flux). Only blocks satisfying the
//! conservation law are allocated; the packed flat buffer lives on
//! [`BlockSparseStorage<T>`] and the per-leg sector indices /
//! allowed-block metadata live on [`BlockSparseLayout<S>`].
//!
//! # Key types
//!
//! - [`Direction`] — leg direction (Out/In) for flux computation
//! - [`QNIndex<S>`] — quantum-number index mapping sectors to block dimensions
//! - [`BlockCoord`] — N-dimensional block coordinate
//! - [`BlockMeta`] — per-block metadata (coordinate, offset, size)
//! - [`BlockSparseStorage<T>`] / [`BlockSparseLayout<S>`] /
//! [`BlockSparseTensorData<T, S>`] — the storage / layout / joined
//! bundle
use crateSector;
pub use BlockSparseLayout;
pub use QNIndex;
pub use BlockSparseStorage;
pub use BlockSparseTensorData;
// ---------------------------------------------------------------------------
// Direction
// ---------------------------------------------------------------------------
/// Leg direction for flux computation (see each variant).
// ---------------------------------------------------------------------------
// BlockCoord
// ---------------------------------------------------------------------------
/// N-dimensional block coordinate.
///
/// Each element is an index into the corresponding `QNIndex.blocks`.
/// `Ord` is derived (lexicographic) to define a deterministic sort order
/// for `Vec<BlockMeta>`.
;
// ---------------------------------------------------------------------------
// BlockMeta
// ---------------------------------------------------------------------------
/// Metadata for a single block within a block-sparse tensor.