Expand description
§Butler-Portugal Tensor Canonicalization Library
This library implements the Butler-Portugal algorithm for tensor canonicalization in theoretical physics applications. The algorithm systematically applies symmetry operations to bring tensors into canonical form.
§Example
use butler_portugal::{canonicalize, Symmetry, Tensor, TensorIndex};
// Create a tensor with some indices
let mut tensor = Tensor::new(
"R",
vec![
TensorIndex::new("a", 0),
TensorIndex::new("b", 1),
TensorIndex::new("c", 2),
TensorIndex::new("d", 3),
],
);
// Add symmetry properties (Riemann tensor symmetries)
tensor.add_symmetry(Symmetry::antisymmetric(vec![0, 1]));
tensor.add_symmetry(Symmetry::antisymmetric(vec![2, 3]));
tensor.add_symmetry(Symmetry::symmetric_pairs(vec![(0, 1), (2, 3)]));
// Canonicalize the tensor
let canonical_tensor = canonicalize(&tensor)?;Re-exports§
pub use canonicalization::canonicalize;pub use canonicalization::canonicalize_with_optimizations;pub use canonicalization::CanonicalizationMethod;pub use error::ButlerPortugalError;pub use error::Result;pub use index::TensorIndex;pub use symmetry::Symmetry;pub use tensor::Tensor;
Modules§
- canonicalization
- Butler-Portugal tensor canonicalization algorithm
- error
- Error types for the Butler-Portugal library
- index
- Tensor index representation and manipulation
- schreier_
sims - Schreier-Sims algorithm for permutation groups
- symmetry
- Tensor symmetry properties and operations
- tensor
- Tensor representation and manipulation
- young_
tableaux - Young tableaux and related combinatorics for tensor canonicalization