|
GiNaC
1.6.2
|
This class holds an indexed expression. More...
#include <indexed.h>
Public Member Functions | |
| indexed (const ex &b) | |
| Construct indexed object with no index. | |
| indexed (const ex &b, const ex &i1) | |
| Construct indexed object with one index. | |
| indexed (const ex &b, const ex &i1, const ex &i2) | |
| Construct indexed object with two indices. | |
| indexed (const ex &b, const ex &i1, const ex &i2, const ex &i3) | |
| Construct indexed object with three indices. | |
| indexed (const ex &b, const ex &i1, const ex &i2, const ex &i3, const ex &i4) | |
| Construct indexed object with four indices. | |
| indexed (const ex &b, const symmetry &symm, const ex &i1, const ex &i2) | |
| Construct indexed object with two indices and a specified symmetry. | |
| indexed (const ex &b, const symmetry &symm, const ex &i1, const ex &i2, const ex &i3) | |
| Construct indexed object with three indices and a specified symmetry. | |
| indexed (const ex &b, const symmetry &symm, const ex &i1, const ex &i2, const ex &i3, const ex &i4) | |
| Construct indexed object with four indices and a specified symmetry. | |
| indexed (const ex &b, const exvector &iv) | |
| Construct indexed object with a specified vector of indices. | |
| indexed (const ex &b, const symmetry &symm, const exvector &iv) | |
| Construct indexed object with a specified vector of indices and symmetry. | |
| indexed (const symmetry &symm, const exprseq &es) | |
| indexed (const symmetry &symm, const exvector &v, bool discardable=false) | |
| indexed (const symmetry &symm, std::auto_ptr< exvector > vp) | |
| unsigned | precedence () const |
| Return relative operator precedence (for parenthezing output). | |
| bool | info (unsigned inf) const |
| Information about the object. | |
| ex | eval (int level=0) const |
| Perform automatic non-interruptive term rewriting rules. | |
| ex | real_part () const |
| ex | imag_part () const |
| exvector | get_free_indices () const |
| Return a vector containing the free indices of an expression. | |
| void | archive (archive_node &n) const |
| Save (a.k.a. | |
| void | read_archive (const archive_node &n, lst &syms) |
| Read (a.k.a. | |
| bool | all_index_values_are (unsigned inf) const |
| Check whether all index values have a certain property. | |
| exvector | get_indices () const |
| Return a vector containing the object's indices. | |
| exvector | get_dummy_indices () const |
| Return a vector containing the dummy indices of the object, if any. | |
| exvector | get_dummy_indices (const indexed &other) const |
| Return a vector containing the dummy indices in the contraction with another indexed object. | |
| 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. | |
| ex | get_symmetry () const |
| Return symmetry properties. | |
Protected Member Functions | |
| ex | derivative (const symbol &s) const |
| Implementation of ex::diff() for an indexed object always returns 0. | |
| ex | thiscontainer (const exvector &v) const |
| ex | thiscontainer (std::auto_ptr< exvector > vp) const |
| unsigned | return_type () const |
| return_type_t | return_type_tinfo () const |
| ex | expand (unsigned options=0) const |
| Expand expression, i.e. | |
| void | printindices (const print_context &c, unsigned level) const |
| void | print_indexed (const print_context &c, const char *openbrace, const char *closebrace, unsigned level) const |
| void | do_print (const print_context &c, unsigned level) const |
| Default output to stream. | |
| void | do_print_latex (const print_latex &c, unsigned level) const |
| void | do_print_tree (const print_tree &c, unsigned level) const |
| Tree output to stream. | |
| void | validate () const |
| Check whether all indices are of class idx and validate the symmetry tree. | |
Protected Attributes | |
| ex | symtree |
| Index symmetry (tree of symmetry objects) | |
Friends | |
| ex | simplify_indexed (const ex &e, exvector &free_indices, exvector &dummy_indices, const scalar_products &sp) |
| Simplify indexed expression, return list of free indices. | |
| 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. | |
| 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 holds an indexed expression.
It consists of a 'base' expression (the expression being indexed) which can be accessed as op(0), and n (n >= 0) indices (all of class idx), accessible as op(1)..op(n).
| GiNaC::indexed::indexed | ( | const ex & | b | ) |
Construct indexed object with no index.
| b | Base expression |
Definition at line 64 of file indexed.cpp.
References validate().
Referenced by eval(), GiNaC::clifford::get_metric(), and thiscontainer().
Construct indexed object with one index.
The index must be of class idx.
| b | Base expression |
| i1 | The index |
Definition at line 69 of file indexed.cpp.
References validate().
Construct indexed object with two indices.
The indices must be of class idx.
| b | Base expression |
| i1 | First index |
| i2 | Second index |
Definition at line 74 of file indexed.cpp.
References validate().
Construct indexed object with three indices.
The indices must be of class idx.
| b | Base expression |
| i1 | First index |
| i2 | Second index |
| i3 | Third index |
Definition at line 79 of file indexed.cpp.
References validate().
| GiNaC::indexed::indexed | ( | const ex & | b, |
| const ex & | i1, | ||
| const ex & | i2, | ||
| const ex & | i3, | ||
| const ex & | i4 | ||
| ) |
Construct indexed object with four indices.
The indices must be of class idx.
| b | Base expression |
| i1 | First index |
| i2 | Second index |
| i3 | Third index |
| i4 | Fourth index |
Definition at line 84 of file indexed.cpp.
References validate().
Construct indexed object with two indices and a specified symmetry.
The indices must be of class idx.
| b | Base expression |
| symm | Symmetry of indices |
| i1 | First index |
| i2 | Second index |
Definition at line 89 of file indexed.cpp.
References validate().
| GiNaC::indexed::indexed | ( | const ex & | b, |
| const symmetry & | symm, | ||
| const ex & | i1, | ||
| const ex & | i2, | ||
| const ex & | i3 | ||
| ) |
Construct indexed object with three indices and a specified symmetry.
The indices must be of class idx.
| b | Base expression |
| symm | Symmetry of indices |
| i1 | First index |
| i2 | Second index |
| i3 | Third index |
Definition at line 94 of file indexed.cpp.
References validate().
| GiNaC::indexed::indexed | ( | const ex & | b, |
| const symmetry & | symm, | ||
| const ex & | i1, | ||
| const ex & | i2, | ||
| const ex & | i3, | ||
| const ex & | i4 | ||
| ) |
Construct indexed object with four indices and a specified symmetry.
The indices must be of class idx.
| b | Base expression |
| symm | Symmetry of indices |
| i1 | First index |
| i2 | Second index |
| i3 | Third index |
| i4 | Fourth index |
Definition at line 99 of file indexed.cpp.
References validate().
Construct indexed object with a specified vector of indices.
The indices must be of class idx.
| b | Base expression |
| iv | Vector of indices |
Definition at line 104 of file indexed.cpp.
References GiNaC::container_storage< C >::seq, and validate().
Construct indexed object with a specified vector of indices and symmetry.
The indices must be of class idx.
| b | Base expression |
| symm | Symmetry of indices |
| iv | Vector of indices |
Definition at line 110 of file indexed.cpp.
References GiNaC::container_storage< C >::seq, and validate().
Definition at line 116 of file indexed.cpp.
Definition at line 120 of file indexed.cpp.
Definition at line 124 of file indexed.cpp.
| unsigned GiNaC::indexed::precedence | ( | ) | const [inline, virtual] |
Return relative operator precedence (for parenthezing output).
Reimplemented from GiNaC::container< C >.
Reimplemented in GiNaC::clifford.
Definition at line 146 of file indexed.h.
Referenced by print_indexed().
| bool GiNaC::indexed::info | ( | unsigned | inf | ) | const [virtual] |
Information about the object.
Reimplemented from GiNaC::container< C >.
Definition at line 239 of file indexed.cpp.
References GiNaC::info_flags::has_indices, GiNaC::info_flags::indexed, and GiNaC::container_storage< C >::seq.
Referenced by imag_part(), and real_part().
| ex GiNaC::indexed::eval | ( | int | level = 0 | ) | const [virtual] |
Perform automatic non-interruptive term rewriting rules.
Reimplemented from GiNaC::container< C >.
Definition at line 268 of file indexed.cpp.
References GiNaC::_ex0, GiNaC::canonicalize(), GiNaC::basic::eval_indexed(), GiNaC::container< C >::evalchildren(), GiNaC::basic::ex, GINAC_ASSERT, indexed(), GiNaC::ex::is_zero(), GiNaC::ex::nops(), GiNaC::ex::op(), GiNaC::container_storage< C >::seq, symtree, and thiscontainer().
| ex GiNaC::indexed::real_part | ( | ) | const [virtual] |
Reimplemented from GiNaC::container< C >.
Definition at line 308 of file indexed.cpp.
References info(), GiNaC::container< C >::op(), and GiNaC::info_flags::real.
| ex GiNaC::indexed::imag_part | ( | ) | const [virtual] |
Reimplemented from GiNaC::container< C >.
Definition at line 315 of file indexed.cpp.
References info(), GiNaC::container< C >::op(), and GiNaC::info_flags::real.
| exvector GiNaC::indexed::get_free_indices | ( | ) | const [virtual] |
Return a vector containing the free indices of an expression.
Reimplemented from GiNaC::basic.
Definition at line 466 of file indexed.cpp.
References GiNaC::find_free_and_dummy(), and GiNaC::container_storage< C >::seq.
Referenced by get_dummy_indices().
| void GiNaC::indexed::archive | ( | archive_node & | n | ) | const [virtual] |
Save (a.k.a.
serialize) indexed object into archive.
Reimplemented from GiNaC::container< C >.
Reimplemented in GiNaC::clifford, and GiNaC::color.
Definition at line 155 of file indexed.cpp.
References GiNaC::archive_node::add_ex(), and symtree.
| void GiNaC::indexed::read_archive | ( | const archive_node & | n, |
| lst & | syms | ||
| ) | [virtual] |
Read (a.k.a.
deserialize) indexed object from archive.
Reimplemented from GiNaC::container< C >.
Reimplemented in GiNaC::clifford, and GiNaC::color.
Definition at line 132 of file indexed.cpp.
References GiNaC::archive_node::find_ex(), GiNaC::archive_node::find_unsigned(), GiNaC::not_symmetric(), GiNaC::container_storage< C >::seq, GiNaC::sy_anti(), GiNaC::sy_symm(), GiNaC::symm(), symtree, and GiNaC::symmetry::validate().
Implementation of ex::diff() for an indexed object always returns 0.
Reimplemented from GiNaC::basic.
Definition at line 397 of file indexed.cpp.
References GiNaC::_ex0.
Reimplemented in GiNaC::clifford, and GiNaC::color.
Definition at line 322 of file indexed.cpp.
Reimplemented in GiNaC::clifford, and GiNaC::color.
Definition at line 327 of file indexed.cpp.
| unsigned GiNaC::indexed::return_type | ( | ) | const [protected, virtual] |
Reimplemented from GiNaC::basic.
Reimplemented in GiNaC::clifford, and GiNaC::color.
Definition at line 332 of file indexed.cpp.
References GiNaC::return_types::commutative, GiNaC::container< C >::op(), and GiNaC::ex::return_type().
| return_type_t GiNaC::indexed::return_type_tinfo | ( | ) | const [inline, protected, virtual] |
Reimplemented from GiNaC::basic.
Reimplemented in GiNaC::clifford, and GiNaC::color.
Definition at line 162 of file indexed.h.
References GiNaC::container< C >::op(), and GiNaC::ex::return_type_tinfo().
| ex GiNaC::indexed::expand | ( | unsigned | options = 0 | ) | const [protected, virtual] |
Expand expression, i.e.
multiply it out and return the result as a new expression.
Reimplemented from GiNaC::basic.
Definition at line 340 of file indexed.cpp.
References GiNaC::_ex0, GiNaC::are_ex_trivially_equal(), GiNaC::ex::expand(), GiNaC::expand(), GiNaC::expand_options::expand_indexed, GINAC_ASSERT, GiNaC::ex::nops(), GiNaC::ex::op(), GiNaC::container_storage< C >::seq, and thiscontainer().
| bool GiNaC::indexed::all_index_values_are | ( | unsigned | inf | ) | const |
Check whether all index values have a certain property.
Definition at line 252 of file indexed.cpp.
References GiNaC::container_storage< C >::seq.
| exvector GiNaC::indexed::get_indices | ( | ) | const |
Return a vector containing the object's indices.
Definition at line 432 of file indexed.cpp.
References GINAC_ASSERT, and GiNaC::container_storage< C >::seq.
| exvector GiNaC::indexed::get_dummy_indices | ( | ) | const |
Return a vector containing the dummy indices of the object, if any.
Definition at line 438 of file indexed.cpp.
References GiNaC::find_free_and_dummy(), and GiNaC::container_storage< C >::seq.
Return a vector containing the dummy indices in the contraction with another indexed object.
This is symmetric: a.get_dummy_indices(b) == b.get_dummy_indices(a)
Definition at line 445 of file indexed.cpp.
References GiNaC::find_dummy_indices(), and get_free_indices().
| bool GiNaC::indexed::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.
Definition at line 455 of file indexed.cpp.
References GiNaC::is_dummy_pair(), and GiNaC::container_storage< C >::seq.
| ex GiNaC::indexed::get_symmetry | ( | ) | const [inline] |
Return symmetry properties.
Definition at line 190 of file indexed.h.
References symtree.
Referenced by GiNaC::clifford::get_metric().
| void GiNaC::indexed::printindices | ( | const print_context & | c, |
| unsigned | level | ||
| ) | const [protected] |
Definition at line 165 of file indexed.cpp.
References GiNaC::print_context::s, and GiNaC::container_storage< C >::seq.
Referenced by GiNaC::clifford::do_print_dflt(), do_print_tree(), and print_indexed().
| void GiNaC::indexed::print_indexed | ( | const print_context & | c, |
| const char * | openbrace, | ||
| const char * | closebrace, | ||
| unsigned | level | ||
| ) | const [protected] |
Definition at line 207 of file indexed.cpp.
References precedence(), printindices(), GiNaC::print_context::s, and GiNaC::container_storage< C >::seq.
Referenced by do_print(), and do_print_latex().
| void GiNaC::indexed::do_print | ( | const print_context & | c, |
| unsigned | level | ||
| ) | const [protected] |
Default output to stream.
Reimplemented from GiNaC::container< C >.
Definition at line 219 of file indexed.cpp.
References print_indexed().
| void GiNaC::indexed::do_print_latex | ( | const print_latex & | c, |
| unsigned | level | ||
| ) | const [protected] |
Reimplemented in GiNaC::clifford.
Definition at line 224 of file indexed.cpp.
References print_indexed().
| void GiNaC::indexed::do_print_tree | ( | const print_tree & | c, |
| unsigned | level | ||
| ) | const [protected] |
Tree output to stream.
Reimplemented from GiNaC::container< C >.
Definition at line 229 of file indexed.cpp.
References GiNaC::print_tree::delta_indent, GiNaC::basic::flags, GiNaC::basic::hashvalue, printindices(), GiNaC::print_context::s, GiNaC::container_storage< C >::seq, and symtree.
| void GiNaC::indexed::validate | ( | ) | const [protected] |
Check whether all indices are of class idx and validate the symmetry tree.
This function is used internally to make sure that all constructed indexed objects really carry indices and not some other classes.
Definition at line 377 of file indexed.cpp.
References GINAC_ASSERT, GiNaC::ex::is_zero(), GiNaC::container_storage< C >::seq, symtree, and GiNaC::symmetry::validate().
Referenced by indexed().
| ex simplify_indexed | ( | const ex & | e, |
| exvector & | free_indices, | ||
| exvector & | dummy_indices, | ||
| const scalar_products & | sp | ||
| ) | [friend] |
Simplify indexed expression, return list of free indices.
Referenced by GiNaC::clifford::get_metric(), and GiNaC::clifford::same_metric().
| ex simplify_indexed_product | ( | const ex & | e, |
| exvector & | free_indices, | ||
| exvector & | dummy_indices, | ||
| const scalar_products & | sp | ||
| ) | [friend] |
Simplify product of indexed expressions (commutative, noncommutative and simple squares), return list of free indices.
Definition at line 788 of file indexed.cpp.
| bool reposition_dummy_indices | ( | ex & | e, |
| exvector & | variant_dummy_indices, | ||
| exvector & | moved_indices | ||
| ) | [friend] |
Raise/lower dummy indices in a single indexed objects to canonicalize their variance.
| e | Object to work on |
| variant_dummy_indices | The set of indices that might need repositioning (will be changed by this function) |
| moved_indices | The set of indices that have been repositioned (will be changed by this function) |
Definition at line 625 of file indexed.cpp.
ex GiNaC::indexed::symtree [protected] |
Index symmetry (tree of symmetry objects)
Definition at line 202 of file indexed.h.
Referenced by archive(), do_print_tree(), eval(), get_symmetry(), read_archive(), thiscontainer(), and validate().