pub struct TensorIndex {
pub name: String,
pub index_type: IndexType,
}Expand description
A single tensor index with name and position.
Represents an index in tensor notation, specifying both the index name (typically a single letter like i, j, k) and whether it appears as an upper (contravariant) or lower (covariant) index.
§Einstein Summation Convention
When the same index name appears once as upper and once as lower in a term,
summation over that index is implied. For example, T^i_j v^j implies
Σ_j T^i_j v^j.
§Examples
use mathlex::ast::{TensorIndex, IndexType};
// Upper index i (T^i)
let upper_i = TensorIndex {
name: "i".to_string(),
index_type: IndexType::Upper,
};
// Lower index j (T_j)
let lower_j = TensorIndex {
name: "j".to_string(),
index_type: IndexType::Lower,
};Fields§
§name: StringThe index name (e.g., “i”, “j”, “k”, “μ”, “ν”)
index_type: IndexTypeWhether this is an upper or lower index
Trait Implementations§
Source§impl Clone for TensorIndex
impl Clone for TensorIndex
Source§fn clone(&self) -> TensorIndex
fn clone(&self) -> TensorIndex
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TensorIndex
impl Debug for TensorIndex
Source§impl Hash for TensorIndex
impl Hash for TensorIndex
Source§impl PartialEq for TensorIndex
impl PartialEq for TensorIndex
impl Eq for TensorIndex
impl StructuralPartialEq for TensorIndex
Auto Trait Implementations§
impl Freeze for TensorIndex
impl RefUnwindSafe for TensorIndex
impl Send for TensorIndex
impl Sync for TensorIndex
impl Unpin for TensorIndex
impl UnsafeUnpin for TensorIndex
impl UnwindSafe for TensorIndex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more