Documentation of CSL
Public Member Functions
csl::MetricParent Class Reference

Specialization of TensorParent for a matric object (two indices symmetric etc). An object of type Space initializated with a metric will automatically have signed indices. More...

#include <indicial.h>

Inheritance diagram for csl::MetricParent:
Inheritance graph
[legend]

Public Member Functions

 MetricParent ()
 Default constructor.
 
 MetricParent (const MetricParent &abstract)=delete
 
 MetricParent (const DeltaParent &abstract)
 Copy constructor from a DeltaParent: the metric is just a kronecker delta.
 
 MetricParent (const Space *t_space, const Expr &t_tensor, const std::string &t_name="g")
 Constructor from a Space and a tensor. The tensor here must be specified. More...
 
 MetricParent (const Space *t_space, const std::string &t_name="g")
 
cslParent::Type getType () const override
 
bool hasContractionProperty (const Abstract *self, Expr_info B) const override
 Tells if an TensorParent has contraction properties with another expression. More...
 
Expr contraction (const Abstract *self, Expr_info B) const override
 Applies a contractoin property if there is one between self and B. More...
 
void printDefinition (std::ostream &out=std::cout, int indentSize=4, bool header=false) const override
 
Expr operator() (std::vector< Index > indices) override
 Generate the Element for an TensorParent of arbitrary dimension More...
 
- Public Member Functions inherited from csl::TensorParent
 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
 
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< PermutationgetPermutation () 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...
 
std::vector< ContractionChaingetContractionProperties () const override
 
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< ExprgetComplexProperty (Expr_info self) const override
 
std::optional< ExprgetHermitianProperty (Expr_info self, const Space *t_space) const override
 
std::optional< ExprgetTransposedProperty (Expr_info self, const Space *t_space) const override
 
std::optional< Exprevaluate (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< ParentgetBrokenParts (const Space *broken) const override
 
std::vector< ParentbreakSpace (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() (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 SpacegetFieldSpace () 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)
 

Additional Inherited Members

- Protected Member Functions inherited from csl::TensorParent
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 inherited from csl::TensorParent
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< ContractionChainchainContraction
 
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
 

Detailed Description

Specialization of TensorParent for a matric object (two indices symmetric etc). An object of type Space initializated with a metric will automatically have signed indices.

Constructor & Destructor Documentation

◆ MetricParent()

csl::MetricParent::MetricParent ( const Space t_space,
const Expr t_tensor,
const std::string &  t_name = "g" 
)

Constructor from a Space and a tensor. The tensor here must be specified.

Parameters
t_spaceSpace in which the metric must be applied.
t_tensorTensor (Squared symmetric matrix) representing the metric.
t_nameName of the metric. Default = "g".

Member Function Documentation

◆ contraction()

Expr csl::MetricParent::contraction ( const Abstract self,
Expr_info  B 
) const
overridevirtual

Applies a contractoin property if there is one between self and B.

Parameters
selfA pointer to the element corresponding to the parent.
BThe other expression.
Returns
The contracted object.

Reimplemented from csl::TensorParent.

◆ getType()

cslParent::Type csl::MetricParent::getType ( ) const
overridevirtual
Returns
The type of the parent.

Reimplemented from csl::TensorParent.

◆ hasContractionProperty()

bool csl::MetricParent::hasContractionProperty ( const Abstract self,
Expr_info  B 
) const
overridevirtual

Tells if an TensorParent has contraction properties with another expression.

Parameters
selfA pointer to the element corresponding to the parent.
BThe other expression.
Returns
True if there is one particular contraction property.
False else.

Reimplemented from csl::TensorParent.

◆ operator()()

Expr csl::MetricParent::operator() ( std::vector< Index indices)
overridevirtual

Generate the Element for an TensorParent of arbitrary dimension

Parameters
indicesList of indices to generate the TensorElement.
Returns
The corresponding TensorElement.

Reimplemented from csl::TensorParent.


The documentation for this class was generated from the following files: