23#ifndef GINAC_INDEXED_H
24#define GINAC_INDEXED_H
82 indexed(
const ex & b,
const ex & i1,
const ex & i2,
const ex & i3,
const ex & i4);
137 bool info(
unsigned inf)
const override;
211typedef std::map<spmapkey, ex>
spmap;
220 void add(
const ex & v1,
const ex & v2,
const ex & sp);
223 void add(
const ex & v1,
const ex & v2,
const ex & dim,
const ex & sp);
#define GINAC_DECLARE_UNARCHIVER(classname)
Helper macros to register a class with (un)archiving (a.k.a.
This class stores all properties needed to record/retrieve the state of one object of class basic (or...
This class holds archived versions of GiNaC expressions (class ex).
Wrapper template for making GiNaC classes out of STL containers.
ex op(size_t i) const override
Return operand/member at position i.
Lightweight wrapper for GiNaC's symbolic objects.
return_type_t return_type_tinfo() const
This class holds an indexed expression.
bool all_index_values_are(unsigned inf) const
Check whether all index values have a certain property.
ex thiscontainer(const exvector &v) const override
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.
unsigned precedence() const override
Return relative operator precedence (for parenthezing output).
void printindices(const print_context &c, unsigned level) const
exvector get_free_indices() const override
Return a vector containing the free indices of an expression.
ex get_symmetry() const
Return symmetry properties.
void do_print(const print_context &c, unsigned level) const
ex expand(unsigned options=0) const override
Expand expression, i.e.
void do_print_latex(const print_latex &c, unsigned level) const
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.
void read_archive(const archive_node &n, lst &syms) override
Read (a.k.a.
void do_print_tree(const print_tree &c, unsigned level) const
ex derivative(const symbol &s) const override
Implementation of ex::diff() for an indexed object always returns 0.
bool info(unsigned inf) const override
Information about the object.
ex eval() const override
Perform automatic non-interruptive term rewriting rules.
ex real_part() const override
void validate() const
Check whether all indices are of class idx and validate the symmetry tree.
ex symtree
Index symmetry (tree of symmetry objects)
exvector get_indices() const
Return a vector containing the object's indices.
return_type_t return_type_tinfo() const override
exvector get_dummy_indices() const
Return a vector containing the dummy indices of the object, if any.
void print_indexed(const print_context &c, const char *openbrace, const char *closebrace, unsigned level) const
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),...
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.
unsigned return_type() const override
ex imag_part() const override
Base class for print_contexts.
Context for latex-parsable output.
Context for tree-like output for debugging.
Helper class for storing information about known scalar products which are to be automatically replac...
bool is_defined(const ex &v1, const ex &v2, const ex &dim) const
Check whether scalar product pair is defined.
ex evaluate(const ex &v1, const ex &v2, const ex &dim) const
Return value of defined scalar product pair.
void clear()
Clear all registered scalar products.
void add_vectors(const lst &l, const ex &dim=wild())
Register list of vectors.
bool operator<(const spmapkey &other) const
bool operator==(const spmapkey &other) const
This class describes the symmetry of a group of indices.
Definition of GiNaC's exprseq.
std::map< spmapkey, ex > spmap
static ex symm(const ex &e, exvector::const_iterator first, exvector::const_iterator last, bool asymmetric)
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...
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
exvector get_all_dummy_indices(const ex &e)
Returns all dummy indices from the exvector.
ex wild(unsigned label=0)
Create a wildcard object with the specified label.
exvector get_all_dummy_indices_safely(const ex &e)
More reliable version of the form.
#define GINAC_DECLARE_REGISTERED_CLASS(classname, supername)
Macro for inclusion in the declaration of each registered class.
To distinguish between different kinds of non-commutative objects.
Interface to GiNaC's wildcard objects.