Skip to main content

tensor4all_treetn/operator/
index_mapping.rs

1//! Index mapping between true site indices and internal MPO indices.
2//!
3//! In the equation `A * x = b`:
4//! - The state `x` has site indices with certain IDs
5//! - The MPO `A` internally uses different IDs (`s_in_tmp`, `s_out_tmp`)
6//! - This mapping defines the correspondence
7
8use tensor4all_core::IndexLike;
9
10/// Mapping between true site indices and internal MPO indices.
11///
12/// In the equation `A * x = b`:
13/// - The state `x` has site indices with certain IDs
14/// - The MPO `A` internally uses different IDs (`s_in_tmp`, `s_out_tmp`)
15/// - This mapping defines the correspondence
16#[derive(Debug, Clone)]
17pub struct IndexMapping<I>
18where
19    I: IndexLike,
20{
21    /// True site index (from state x or b)
22    pub true_index: I,
23    /// Internal MPO index (s_in_tmp or s_out_tmp)
24    pub internal_index: I,
25}