Small class that allows to handle contractions of indices between tensors. More...
#include <indicial.h>
Public Member Functions | |
| SelfContraction (const Expr &A, const Expr &B, std::optional< std::function< bool(Expr_info, Expr_info)>> t_condition=std::nullopt) | |
| Constructor. Takes two tensors and determines the contractions between the two. More... | |
| SelfContraction (Expr_info A, Expr_info B, std::optional< std::function< bool(Expr_info, Expr_info)>> t_condition=std::nullopt) | |
| bool | empty () const |
| bool | conditionAppliesOn (Expr_info A, Expr_info B) const |
| bool | conditionAppliesOn (const Expr &A, const Expr &B) const |
| bool | isSwappable () const |
| void | setSwappable (bool t_swappable) |
| bool | operator== (const SelfContraction &other) const |
| Compares the SelfContraction with another. More... | |
| Expr | applyIndices (const Expr &A, const Expr &B, const SelfContraction &targetContraction, const Expr &res) const |
Protected Attributes | |
| std::vector< std::pair< int, csl::Index > > | specialAValues |
| std::vector< std::pair< int, csl::Index > > | specialBValues |
| std::vector< std::pair< int, int > > | contraction |
| Contains a list of pairs of integers. Each pair corresponds to the places of the two contracted indices (respectively in the two expressions). | |
| std::optional< std::function< bool(Expr_info, Expr_info)> > | condition |
| std::array< IndexStructure, 2 > | freeStructures |
| bool | swappable = true |
Friends | |
| std::ostream & | operator<< (std::ostream &fout, const SelfContraction &c) |
| Displays the SelfContraction c. More... | |
Small class that allows to handle contractions of indices between tensors.
This class provides a constructor that takes two TensorElement and determines automatically the contractions between the two, and an operator== that compares two contractions to see if they are the same.
| csl::SelfContraction::SelfContraction | ( | const Expr & | A, |
| const Expr & | B, | ||
| std::optional< std::function< bool(Expr_info, Expr_info)>> | t_condition = std::nullopt |
||
| ) |
Constructor. Takes two tensors and determines the contractions between the two.
| A | Must be an TensorElement. |
| B | Must be an TensorElement. |
| bool csl::SelfContraction::empty | ( | ) | const |
| bool csl::SelfContraction::operator== | ( | const SelfContraction & | other | ) | const |
Compares the SelfContraction with another.
|
friend |
Displays the SelfContraction c.
std::ostream& operator<<(std::ostream& fout, const SelfContraction& C)
1.8.13