Parent of an indicial object, allows to generate them (TensorElement). More...
#include <indicial.h>

Public Member Functions | |
| TensorParent () | |
| Default constructor. | |
| TensorParent (const std::string &t_name) | |
| Constructor that initializes only the name of the parent. More... | |
| TensorParent (const TensorParent &abstract)=default | |
| Copy constructor = c++ default. | |
| TensorParent (const std::string &t_name, const Space *t_space) | |
| Constructor of a 1-indexed parent. More... | |
| TensorParent (const std::string &t_name, const std::vector< const Space *> &t_space) | |
| Constructor of a n-indexed parent. More... | |
| TensorParent (const std::string &t_name, const std::vector< const Space *> &t_space, const Expr &t_tensor) | |
| Constructor of a n-indexed parent, with explicit tensor tensor. More... | |
| TensorParent (const std::string &t_name, const Space *t_space, const Expr &t_tensor) | |
| Constructor of a 1-indexed parent, with explicit tensor tensor. More... | |
| cslParent::PrimaryType | getPrimaryType () const override |
| cslParent::Type | getType () const override |
| void | printDefinition (std::ostream &out=std::cout, int indentSize=4, bool header=false) const override |
| int | getDim (const Space *t_space) const override |
| Returns the dimension of the parent relatively to a certain vector space, i.e. the number of indices in this vector space. More... | |
| std::vector< const Space * > | getSpace () const override |
| Symmetry | getSymmetry () const |
| bool | getFullySymmetric () const override |
| bool | getFullyAntiSymmetric () const override |
| std::vector< Permutation > | getPermutation () const override |
| For an TensorParent returns all the possible permutations of the tensor with respect to the symmetries or antisymmetries in a vector of Permutation. More... | |
| bool | isValued () const override |
| Expr | getTensor () const override |
| For a valued TensorParent returns the corresponding tensor. Valued means that the tensor has been defined by the user. More... | |
| Expr | getTensor (Expr_info self) const override |
| Expr | getTrace () const override |
| For an TensorParent of dimension 2 (in a given unique space) returns the trace of it, i.e. the sum of its diagonal elements. | |
| bool | dependsOn (Expr_info expr) const override |
| Tells if the parent depends on another expression or not. More... | |
| bool | dependsExplicitlyOn (Expr_info expr) const override |
| Tells if the parent depends explicitely on another expression or not. More... | |
| const std::vector< Equation * > & | getProperties () const override |
| void | setComplexProperty (csl::ComplexProperty t_prop) override |
| void | setKeepBestPermutation (bool keep) |
| void | setFullySymmetric () override |
| Set the TensorParent fully symmetric. | |
| void | setFullyAntiSymmetric () override |
| Set the TensorParent fully antisymmetric. | |
| bool | isTraceLessIn (csl::Space const *space) const override |
| void | addTraceLessNess (csl::Space const *space) override |
| void | removeTraceLessNess (csl::Space const *space) override |
| void | addSpace (const Space *space) override |
| Adds a dimension to an TensorParent in a specific vector space. More... | |
| void | addSymmetry (int i1, int i2) override |
| Adds a symmetry between indices in position i1 and i2. More... | |
| void | addAntiSymmetry (int i1, int i2) override |
| Adds an antisymmetry between indices in position i1 and i2. More... | |
| void | setSymmetry (const Symmetry &t_symetry) override |
| Sets all the symmetry properties of an TensorParent from an object of type Symmetry. This erase all possible properties of (anti)symmetry the parent had before that. More... | |
| void | setTensor (const Expr &t_tensor) override |
| void | setTrace (const Expr &t_trace) override |
| void | setElementary (bool t_elementary) |
| Sets all potential variables in the tensor associated with the indicial object elementary. For example, setting a vector as elementary will set all vector elements (if they are variables) as elementary variables, i.e. that depend only on themselves. More... | |
| bool | hasContractionProperty (const Abstract *self, Expr_info B) const override |
| Tells if an TensorParent has contraction properties with another expression. More... | |
| std::vector< ContractionChain > | getContractionProperties () const override |
| Expr | contraction (const Abstract *self, Expr_info B) const override |
| Applies a contractoin property if there is one between self and B. More... | |
| void | addSelfContraction (const Expr &A, const Expr &B, const Expr &res, std::optional< std::function< bool(Expr_info, Expr_info)>> condition=std::nullopt) override |
| Adds a contraction property between an Element and another that share the parent (*this). More... | |
| void | removeSelfContraction (const Expr &A, const Expr &B) override |
| bool | hasChainContractionProperty () const override |
| void | addContractionProperty (csl::vector_expr const &leftHandSide, const Expr &rightHandSide) override |
| void | removeContractionProperty (csl::vector_expr const &leftHandSide, const Expr &rightHandSide) override |
| std::optional< Expr > | getComplexProperty (Expr_info self) const override |
| std::optional< Expr > | getHermitianProperty (Expr_info self, const Space *t_space) const override |
| std::optional< Expr > | getTransposedProperty (Expr_info self, const Space *t_space) const override |
| std::optional< Expr > | evaluate (Expr_info self, csl::eval::mode user_mode=csl::eval::base) const override |
| void | addComplexProperty (const Expr &init, const Expr &res) override |
| void | addHermitianProperty (const Space *space, const Expr &init, const Expr &res) override |
| void | addTransposedProperty (const Space *space, const Expr &init, const Expr &res) override |
| std::vector< Parent > | getBrokenParts (const Space *broken) const override |
| std::vector< Parent > | breakSpace (const Space *broken, const std::vector< const Space *> &newSpace, const std::vector< size_t > &pieces) const override |
| virtual Expr | operator() (Index index) override |
| Generate the Element for an TensorParent of dimension 1 (a single index). More... | |
| virtual Expr | operator() (std::vector< Index > indices) override |
| Generate the Element for an TensorParent of arbitrary dimension More... | |
| virtual Expr | operator() (const std::vector< int > &indices) override |
| virtual bool | operator== (const TensorParent &other) const |
| Compares the parent with another. More... | |
| virtual bool | operator!= (const TensorParent &other) const |
| Compares the parent with another. More... | |
Public Member Functions inherited from csl::AbstractParent | |
| AbstractParent () | |
| Default constructor, parent with no name. | |
| AbstractParent (const std::string &t_name) | |
| Intializes the name of the parent. More... | |
| AbstractParent (const AbstractParent &abstract)=default | |
| Copy constructor, c++ default. | |
| virtual | ~AbstractParent () |
| Destructor. | |
| Parent | self () |
| virtual bool | isAnAbbreviation () const |
| std::string const & | getName () const |
| std::string const & | getLatexName () const |
| virtual std::string const & | getBaseName () const |
| bool | getCommutable () const |
| csl::ComplexProperty | getComplexProp () const |
| virtual void | setName (std::string t_name) |
| virtual void | setLatexName (const std::string &t_name) |
| void | setCommutable (bool t_commutable) |
| void | addProperty (Equation *prop) |
| Adds a property for the parent. More... | |
| void | removeProperty (Equation *prop) |
| Removes a property. More... | |
| virtual int | getDim () const |
| void | printPropDefinition (std::ostream &out, int indentSize, bool header) const |
| virtual void | enableEvaluation () |
| virtual void | disableEvaluation () |
| virtual void | toggleEvaluation () |
| virtual Expr const & | getEncapsulated () const |
| virtual Expr | getExactEncapsulated (Expr_info self) const |
| virtual void | setEncapsulated (Expr const &) |
| virtual const Space * | getFieldSpace () const |
| virtual void | setFieldSpace (const Space *t_space) |
| virtual Expr | operator() (const Tensor &point) |
| virtual Expr | operator() (Index index, const Tensor &point) |
| virtual Expr | operator() (std::vector< Index > indices, const Tensor &point) |
| virtual Expr | operator() (const std::vector< int > &indices, const Tensor &point) |
Protected Member Functions | |
| void | applyProperty (Expr_info self, IndexStructure const &structure, Expr &res) const |
| void | checkIndexRequest (const Index &index) |
| void | checkIndexRequest (const std::vector< Index > &request) |
| void | createFixedIndices (Index &index) const |
| void | createFixedIndices (std::vector< Index > &indices) const |
Protected Attributes | |
| std::vector< const Space * > | space |
| Vector spaces in which the indices live. | |
| std::vector< bool > | covariant |
| bool | keepBestPermutation = true |
| Symmetry | symmetry |
| Symmetry properties of the tensor. | |
| bool | fullySymmetric |
| Attribute that can be set to True if the tensor must be fully symmetric. | |
| bool | fullyAntiSymmetric |
| Attribute that can be set to True if the tensor must be fully anti-symmetric. | |
| std::vector< std::pair< SelfContraction, Expr > > | selfContraction |
| List of (self) constractions that have special properties. | |
| std::vector< std::pair< SelfContraction, Expr > > | extContraction |
| std::vector< csl::AbstractParent const * > | externalTensors |
| std::vector< csl::Space const * > | traceLessNess |
| std::vector< ContractionChain > | chainContraction |
| std::map< const csl::Space *, std::vector< csl::Parent > > | brokenParts |
| bool | valued |
| Boolean that is True iif an explicit tensor is given. | |
| Expr | tensor |
| Explicit tensor that can be set by the user. | |
| Expr | trace |
| (almost) Unused attribute going to disappear. | |
| std::optional< std::pair< IndexStructure, Expr > > | conjugateProperty |
| std::map< const Space *, std::pair< IndexStructure, Expr > > | hermitianProperty |
| std::map< const Space *, std::pair< IndexStructure, Expr > > | transposedProperty |
Protected Attributes inherited from csl::AbstractParent | |
| std::string | name |
| std::string | latexName |
| bool | commutable |
| csl::ComplexProperty | complexProp = csl::ComplexProperty::Real |
| std::vector< Equation * > | props |
Friends | |
| template<class ... Args> | |
| std::shared_ptr< TensorParent > | tensor_s (Args &&...args) |
| template<class ... Args> | |
| std::shared_ptr< TensorParent > | tensor_s (std::string const &name, std::vector< const Space *> const &indices, Args &&...args) |
| std::ostream & | operator<< (std::ostream &fout, const TensorParent &) |
| Displays an TensorParent p. More... | |
Parent of an indicial object, allows to generate them (TensorElement).
|
explicit |
Constructor that initializes only the name of the parent.
| t_name | Name of the parent. |
| csl::TensorParent::TensorParent | ( | const std::string & | t_name, |
| const Space * | t_space | ||
| ) |
| csl::TensorParent::TensorParent | ( | const std::string & | t_name, |
| const std::vector< const Space *> & | t_space | ||
| ) |
Constructor of a n-indexed parent.
| t_name | Name of the parent. |
| t_space | List of the n spaces in which each index lives. |
| csl::TensorParent::TensorParent | ( | const std::string & | t_name, |
| const std::vector< const Space *> & | t_space, | ||
| const Expr & | t_tensor | ||
| ) |
Constructor of a n-indexed parent, with explicit tensor tensor.
| t_name | Name of the parent. |
| t_space | List of the n spaces in which each index lives. |
| t_tensor | Explicit tensor. Must match exactly the shape given by the IndexStructure. |
| csl::TensorParent::TensorParent | ( | const std::string & | t_name, |
| const Space * | t_space, | ||
| const Expr & | t_tensor | ||
| ) |
Constructor of a 1-indexed parent, with explicit tensor tensor.
| t_name | Name of the parent. |
| t_space | Vector space in which the index lives. |
| t_tensor | Explicit tensor. Must match exactly the shape given by the IndexStructure. |
|
overridevirtual |
Adds an antisymmetry between indices in position i1 and i2.
Reimplemented from csl::AbstractParent.
|
overridevirtual |
Adds a contraction property between an Element and another that share the parent (*this).
| A | First Element in the contraction. |
| B | Second Element in the contraction. |
Reimplemented from csl::AbstractParent.
|
overridevirtual |
Adds a dimension to an TensorParent in a specific vector space.
| t_space | Space in which we add an index. |
Reimplemented from csl::AbstractParent.
|
overridevirtual |
Adds a symmetry between indices in position i1 and i2.
Reimplemented from csl::AbstractParent.
Applies a contractoin property if there is one between self and B.
| self | A pointer to the element corresponding to the parent. |
| B | The other expression. |
Reimplemented from csl::AbstractParent.
Reimplemented in csl::MetricParent, csl::DeltaParent, and csl::EpsilonParent.
|
overridevirtual |
Tells if the parent depends explicitely on another expression or not.
| expr | from which we test the dependency. |
Reimplemented from csl::AbstractParent.
|
overridevirtual |
Tells if the parent depends on another expression or not.
| expr | from which we test the dependency. |
Reimplemented from csl::AbstractParent.
|
overridevirtual |
Returns the dimension of the parent relatively to a certain vector space, i.e. the number of indices in this vector space.
| t_space | Vector space to investigate. |
Reimplemented from csl::AbstractParent.
|
overridevirtual |
Reimplemented from csl::AbstractParent.
|
overridevirtual |
Reimplemented from csl::AbstractParent.
|
overridevirtual |
For an TensorParent returns all the possible permutations of the tensor with respect to the symmetries or antisymmetries in a vector of Permutation.
Reimplemented from csl::AbstractParent.
|
overridevirtual |
Implements csl::AbstractParent.
Reimplemented in csl::TensorFieldParent.
|
overridevirtual |
Reimplemented from csl::AbstractParent.
|
overridevirtual |
Reimplemented from csl::AbstractParent.
| Symmetry csl::TensorParent::getSymmetry | ( | ) | const |
|
overridevirtual |
For a valued TensorParent returns the corresponding tensor. Valued means that the tensor has been defined by the user.
Reimplemented from csl::AbstractParent.
|
overridevirtual |
Implements csl::AbstractParent.
Reimplemented in csl::MetricParent, csl::DeltaParent, csl::EpsilonParent, and csl::TensorFieldParent.
|
overridevirtual |
Tells if an TensorParent has contraction properties with another expression.
| self | A pointer to the element corresponding to the parent. |
| B | The other expression. |
Reimplemented from csl::AbstractParent.
Reimplemented in csl::MetricParent, csl::DeltaParent, and csl::EpsilonParent.
|
virtual |
Compares the parent with another.
Generate the Element for an TensorParent of dimension 1 (a single index).
| index | The Index of the Element. |
Reimplemented from csl::AbstractParent.
Generate the Element for an TensorParent of arbitrary dimension
| indices | List of indices to generate the TensorElement. |
Reimplemented from csl::AbstractParent.
Reimplemented in csl::MetricParent, csl::DeltaParent, and csl::EpsilonParent.
|
virtual |
Compares the parent with another.
| void csl::TensorParent::setElementary | ( | bool | t_elementary | ) |
Sets all potential variables in the tensor associated with the indicial object elementary. For example, setting a vector as elementary will set all vector elements (if they are variables) as elementary variables, i.e. that depend only on themselves.
| t_elementary | Boolean property of elementary-ness. |
|
overridevirtual |
Sets all the symmetry properties of an TensorParent from an object of type Symmetry. This erase all possible properties of (anti)symmetry the parent had before that.
| t_symmetry | New symmetry of the parent. |
Reimplemented from csl::AbstractParent.
|
overridevirtual |
| New | tensor corresponding to the TensorParent. Must match the index structure of course. |
Reimplemented from csl::AbstractParent.
|
friend |
Displays an TensorParent p.
std::ostream& operator<<(std::ostream& fout, const TensorParent& p)
1.8.13