This is a C++14 header-only library for symmetry-optimized tensor computation and type checking.
Tensor contraction formulas can be written using Einstein index notation:
- Repeated index names are contracted.
- Index type checking ensures that incorrect formulas are caught at compile time.
- See tests for examples.
Each tensor index has a type corresponding to a space with a basis and units (e.g. meters, inverse-seconds):
- Only dual spaces can be contracted.
- The type checker will detect incompatible index contractions.
- Space types are derived according to tensor constructions.
Contracted tensor products are lazy-evaluated:
- Intermediate terms that will not be used in the final contraction are not computed.
- Index re-use in a tensor contraction expression will result in a compiler error.
Tensors with symmetries are represented using only independent components:
- Representations are implemented for fully symmetric or anti-symmetric index groups.
- Efficient multivariable polynomials are supported.
- The representation uses a single index with a distinct type.
Memory mapping to Eigen is supported for efficient matrix operations and decompositions.
Planned:
- Young Tableaux independent component specification.
- Overlapping symmetries (e.g. for Riemann curvature tensor).
- Optimal contraction ordering (like optimal rectangular matrix associative ordering).
- Git (https://git-scm.com)
- CMake (https://cmake.org)
- Variadic Meta Programming (https://github.com/Reification/VariadicMetaProgramming)
- UnitTest++ (https://github.com/unittest-cpp/unittest-cpp)
- Doxygen Filter for CMake (https://github.com/saschazelzer/CMakeDoxygenFilter)
- Conditional Sources and Verbose Message for CMake (https://github.com/wal-rus/cmake-modules)
- Doxygen (http://www.stack.nl/~dimitri/doxygen/)
- MathJax (https://www.mathjax.org)
Derived from EmptyCPP project template (https://github.com/GabrielHare/EmptyCPP)
cmake -G "Unix Makefiles" -B builds/Clang -S . -DBUILD_TESTS=ON \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
cmake --build builds/Clang --target testscmake -G Xcode -B builds/XCode2025 -S . -DBUILD_TESTS=ON
cmake --build builds/XCode2025 --target tests --config Releasecmake -G "Visual Studio 17 2022" -B builds/VS2022 -S . -DBUILD_TESTS=ON -A x64
cmake --build builds/VS2022 --target tests --config Release