23 #ifndef GINAC_INDEXED_H 24 #define GINAC_INDEXED_H 33 class scalar_products;
87 indexed(
const ex & b,
const ex & i1,
const ex & i2,
const ex & i3,
const ex & i4);
147 bool info(
unsigned inf)
const override;
221 typedef std::map<spmapkey, ex>
spmap;
230 void add(
const ex & v1,
const ex & v2,
const ex & sp);
233 void add(
const ex & v1,
const ex & v2,
const ex & dim,
const ex & sp);
288 #endif // ndef GINAC_INDEXED_H exvector get_indices() const
Return a vector containing the object's indices.
exvector get_all_dummy_indices(const ex &e)
Returns all dummy indices from the exvector.
Helper class for storing information about known scalar products which are to be automatically replac...
This class describes the symmetry of a group of indices.
ex op(size_t i) const override
Return operand/member at position i.
exvector get_all_dummy_indices_safely(const ex &e)
More reliable version of the form.
void print_indexed(const print_context &c, const char *openbrace, const char *closebrace, unsigned level) const
void validate() const
Check whether all indices are of class idx and validate the symmetry tree.
unsigned precedence() const override
Return relative operator precedence (for parenthezing output).
void archive(archive_node &n) const override
Save (a.k.a.
unsigned return_type() const override
ex evaluate(const ex &v1, const ex &v2, const ex &dim) const
Return value of defined scalar product pair.
ex get_symmetry() const
Return symmetry properties.
void add(const ex &v1, const ex &v2, const ex &sp)
Register scalar product pair and its value.
exvector get_free_indices() const override
Return a vector containing the free indices of an expression.
Interface to GiNaC's wildcard objects.
bool all_index_values_are(unsigned inf) const
Check whether all index values have a certain property.
void clear()
Clear all registered scalar products.
exvector get_dummy_indices() const
Return a vector containing the dummy indices of the object, if any.
void read_archive(const archive_node &n, lst &syms) override
Read (a.k.a.
Context for latex-parsable output.
void do_print_tree(const print_tree &c, unsigned level) const
friend ex simplify_indexed(const ex &e, exvector &free_indices, exvector &dummy_indices, const scalar_products &sp)
Simplify indexed expression, return list of free indices.
This class holds an indexed expression.
bool has_dummy_index_for(const ex &i) const
Check whether the object has an index that forms a dummy index pair with a given index.
void do_print(const print_context &c, unsigned level) const
To distinguish between different kinds of non-commutative objects.
Definition of GiNaC's exprseq.
ex imag_part() const override
ex expand_dummy_sum(const ex &e, bool subs_idx)
This function returns the given expression with expanded sums for all dummy index summations...
std::vector< ex > exvector
ex eval() const override
Perform automatic non-interruptive term rewriting rules.
void printindices(const print_context &c, unsigned level) const
ex thiscontainer(const exvector &v) const override
void do_print_latex(const print_latex &c, unsigned level) const
bool info(unsigned inf) const override
Information about the object.
return_type_t return_type_tinfo() const
return_type_t return_type_tinfo() const override
ex real_part() const override
Base class for print_contexts.
static ex symm(const ex &e, exvector::const_iterator first, exvector::const_iterator last, bool asymmetric)
ex wild(unsigned label=0)
Create a wildcard object with the specified label.
indexed(const ex &b)
Construct indexed object with no index.
ex derivative(const symbol &s) const override
Implementation of ex::diff() for an indexed object always returns 0.
friend bool reposition_dummy_indices(ex &e, exvector &variant_dummy_indices, exvector &moved_indices)
Raise/lower dummy indices in a single indexed objects to canonicalize their variance.
This class stores all properties needed to record/retrieve the state of one object of class basic (or...
Lightweight wrapper for GiNaC's symbolic objects.
lst rename_dummy_indices_uniquely(const exvector &va, const exvector &vb)
Similar to above, where va and vb are the same and the return value is a list of two lists for substi...
Wrapper template for making GiNaC classes out of STL containers.
bool operator==(const spmapkey &other) const
#define GINAC_DECLARE_REGISTERED_CLASS(classname, supername)
Macro for inclusion in the declaration of each registered class.
bool is_defined(const ex &v1, const ex &v2, const ex &dim) const
Check whether scalar product pair is defined.
GINAC_DECLARE_UNARCHIVER(add)
void add_vectors(const lst &l, const ex &dim=wild())
Register list of vectors.
friend ex simplify_indexed_product(const ex &e, exvector &free_indices, exvector &dummy_indices, const scalar_products &sp)
Simplify product of indexed expressions (commutative, noncommutative and simple squares), return list of free indices.
ex expand(unsigned options=0) const override
Expand expression, i.e.
bool operator<(const spmapkey &other) const
Context for tree-like output for debugging.
ex symtree
Index symmetry (tree of symmetry objects)
std::map< spmapkey, ex > spmap