Cadabra
Computer algebra system for field theory problems
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
cadabra::decompose_product Class Reference

Description

Decompose a product of tensors by applying Young projectors.

#include <decompose_product.hh>

Inheritance diagram for cadabra::decompose_product:
cadabra::Algorithm cadabra::IndexClassifier

Public Member Functions

 decompose_product (const Kernel &, Ex &tr)
 
virtual bool can_apply (iterator) override
 
virtual result_t apply (iterator &) override
 
- Public Member Functions inherited from cadabra::Algorithm
 Algorithm (const Kernel &, Ex &)
 Initialise the algorithm with a reference to the expression tree, but do not yet do anything with this tree. More...
 
virtual ~Algorithm ()
 
void set_progress_monitor (ProgressMonitor *)
 Provide the algorithm with a ProgressMonitor object on which to register (nested) progress information, to be reported out-of-band to a client. More...
 
result_t apply_generic (bool deep=true, bool repeat=false, unsigned int depth=0)
 The main entry points for running algorithms, which traverse the tree post-order ('child before parent'). More...
 
result_t apply_generic (iterator &, bool deep, bool repeat, unsigned int depth)
 
result_t apply_pre_order (bool repeat=false)
 Apply algorithm with alternative traversal: starting from the top node, traverse the tree pre-order ('parent before child') and once the algorithm acts at a given node, do not traverse the subtree below anymore. More...
 
bool check_consistency (iterator) const
 Given an expression top node, check index consistency. More...
 
bool check_index_consistency (iterator) const
 
bool check_degree_consistency (iterator) const
 Given an expression top node, check differential form degree consistency. More...
 
void report_progress (const std::string &, int todo, int done, int count=2)
 
index_iterator begin_index (iterator it) const
 
index_iterator end_index (iterator it) const
 
unsigned int number_of_indices (iterator it)
 
std::string get_index_set_name (iterator it) const
 
bool rename_replacement_dummies (iterator, bool still_inside_algo=false)
 Rename the dummies in the sub-tree starting with head at the given iterator. More...
 
- Public Member Functions inherited from cadabra::IndexClassifier
 IndexClassifier (const Kernel &)
 
void fill_index_position_map (Ex::iterator, const index_map_t &, index_position_map_t &) const
 Routines to find and classify all indices in an expression, taking into account sums and products. More...
 
void fill_map (index_map_t &, Ex::sibling_iterator, Ex::sibling_iterator) const
 
void print_classify_indices (std::ostream &, Ex::iterator) const
 
void determine_intersection (index_map_t &one, index_map_t &two, index_map_t &target, bool move_out=false) const
 Determine those indices in 'two' which have a name which is identical to an index name occurring in 'one'. More...
 
void classify_add_index (Ex::iterator it, index_map_t &ind_free, index_map_t &ind_dummy) const
 
void classify_indices_up (Ex::iterator, index_map_t &ind_free, index_map_t &ind_dummy) const
 Classify indices bottom-up, that is, given a node, it goes up the tree to find. More...
 
void classify_indices (Ex::iterator, index_map_t &ind_free, index_map_t &ind_dummy) const
 Classify indices top-down, that is, finds the free indices and all dummy index pairs used in the full subtree below a given node. More...
 
int max_numbered_name_one (const std::string &nm, const index_map_t *one) const
 
int max_numbered_name (const std::string &, const index_map_t *m1, const index_map_t *m2=0, const index_map_t *m3=0, const index_map_t *m4=0, const index_map_t *m5=0) const
 
Ex get_dummy (const list_property *, const index_map_t *m1, const index_map_t *m2=0, const index_map_t *m3=0, const index_map_t *m4=0, const index_map_t *m5=0) const
 
Ex get_dummy (const list_property *, Ex::iterator) const
 
Ex get_dummy (const list_property *, Ex::iterator, Ex::iterator) const
 
bool index_in_set (Ex, const index_map_t *) const
 
void dumpmap (std::ostream &, const index_map_t &) const
 
index_map_t::iterator find_modulo_parent_rel (Ex::iterator it, index_map_t &imap) const
 Find an index in the set, not taking into account index position. More...
 

Private Types

typedef young_project::name_tab_t sibtab_t
 
typedef yngtab::tableaux< sibtab_tsibtabs_t
 
typedef young_project::pos_tab_t numtab_t
 
typedef yngtab::tableaux< numtab_tnumtabs_t
 

Private Member Functions

const Indicesindices_equivalent (iterator it) const
 Test that all indices on the product are equivalent, that is, have the same Indices property attached to them. More...
 
void fill_asym_ranges (TableauBase::tab_t &tab, int offset, combin::range_vector_t &)
 
void project_onto_initial_symmetries (Ex &rep, iterator rr, young_project &yp, const TableauBase *tt, iterator ff, int offset, const TableauBase::tab_t &thetab, bool remove_traces)
 

Private Attributes

iterator f1
 
iterator f2
 
const TableauBaset1
 
const TableauBaset2
 
TableauBase::tab_t t1tab
 
TableauBase::tab_t t2tab
 
const Indicesind1
 
const Indicesind2
 
unsigned int dim
 
yngtab::filled_tableau< iteratornt1
 
yngtab::filled_tableau< iteratornt2
 
combin::range_vector_t asym_ranges
 

Additional Inherited Members

- Public Types inherited from cadabra::Algorithm
typedef Ex::iterator iterator
 
typedef Ex::post_order_iterator post_order_iterator
 
typedef Ex::sibling_iterator sibling_iterator
 
typedef Ex::result_t result_t
 
- Public Types inherited from cadabra::IndexClassifier
typedef std::multimap< Ex, Ex::iterator, tree_exact_less_for_indexmap_objindex_map_t
 A map from a pattern to the position where it occurs in the tree. More...
 
typedef std::map< Ex::iterator, int, Ex::iterator_base_less > index_position_map_t
 A map from the position of each index to the sequential index. More...
 
- Static Public Member Functions inherited from cadabra::Algorithm
static unsigned int number_of_indices (const Properties &, iterator it)
 
static unsigned int number_of_direct_indices (iterator it)
 
static bool is_termlike (iterator)
 Determines whether the indicated node is 'like a term in a sum'. More...
 
static bool is_factorlike (iterator)
 Determines whether the indicated node is 'like a factor in a product'. More...
 
- Public Attributes inherited from cadabra::Algorithm
bool interrupted
 
unsigned int number_of_calls
 
unsigned int number_of_modifications
 
bool suppress_normal_output
 
bool discard_command_node
 
Stopwatch index_sw
 
Stopwatch get_dummy_sw
 
Stopwatch report_progress_stopwatch
 
- Protected Types inherited from cadabra::Algorithm
typedef std::pair< sibling_iterator, sibling_iteratorrange_t
 Finding objects in sets. More...
 
typedef std::vector< range_trange_vector_t
 
- Protected Member Functions inherited from cadabra::Algorithm
int index_parity (iterator) const
 
bool contains (sibling_iterator from, sibling_iterator to, sibling_iterator arg)
 
void find_argument_lists (range_vector_t &, bool only_comma_lists=true) const
 
template<class Iter >
range_vector_t::iterator find_arg_superset (range_vector_t &, Iter st, Iter nd)
 
range_vector_t::iterator find_arg_superset (range_vector_t &, sibling_iterator it)
 
unsigned int locate_single_object (Ex::iterator obj_to_find, Ex::iterator st, Ex::iterator nd, std::vector< unsigned int > &store)
 
bool locate_object_set (const Ex &objs, Ex::iterator st, Ex::iterator nd, std::vector< unsigned int > &store)
 
bool is_single_term (iterator)
 Take a single non-product node in a sum and wrap it in a product node, so it can be handled on the same footing as a proper product. More...
 
bool is_nonprod_factor_in_prod (iterator)
 
bool prod_wrap_single_term (iterator &)
 
bool prod_unwrap_single_term (iterator &)
 
bool sum_wrap_single_term (iterator &)
 
bool sum_unwrap_single_term (iterator &)
 
void force_node_wrap (iterator &, std::string)
 Wrap a term in a product or sum in a node with indicated name, irrespective of its parent (it usually makes more sense to call the safer prod_wrap_single_term or sum_wrap_single_term above). More...
 
bool separated_by_derivative (iterator, iterator, iterator check_dependence) const
 Figure out whether two objects (commonly indices) are separated by a derivative operator, as in. More...
 
void pushup_multiplier (iterator)
 
template<class BinaryPredicate >
unsigned int intersection_number (sibling_iterator, sibling_iterator, sibling_iterator, sibling_iterator, BinaryPredicate) const
 Determine the number of elements in the first range which also occur in the second range. More...
 
void node_zero (iterator)
 
void node_one (iterator)
 
void node_integer (iterator, int)
 
- Static Protected Member Functions inherited from cadabra::Algorithm
static bool less_without_numbers (nset_t::iterator, nset_t::iterator)
 
static bool equal_without_numbers (nset_t::iterator, nset_t::iterator)
 
static bool compare_ (const str_node &, const str_node &)
 
- Protected Attributes inherited from cadabra::Algorithm
Extr
 
ProgressMonitorpm
 
bool traverse_ldots
 
- Protected Attributes inherited from cadabra::IndexClassifier
const Kernelkernel
 

Member Typedef Documentation

◆ numtab_t

◆ numtabs_t

◆ sibtab_t

◆ sibtabs_t

Constructor & Destructor Documentation

◆ decompose_product()

decompose_product::decompose_product ( const Kernel k,
Ex tr 
)

Member Function Documentation

◆ apply()

Algorithm::result_t decompose_product::apply ( iterator it)
overridevirtual

++ntt; ++ntt; ++ntt;

break;

Implements cadabra::Algorithm.

◆ can_apply()

bool decompose_product::can_apply ( iterator  it)
overridevirtual

Implements cadabra::Algorithm.

◆ fill_asym_ranges()

void decompose_product::fill_asym_ranges ( TableauBase::tab_t tab,
int  offset,
combin::range_vector_t ranges 
)
private

◆ indices_equivalent()

const Indices * decompose_product::indices_equivalent ( iterator  it) const
private

Test that all indices on the product are equivalent, that is, have the same Indices property attached to them.

Return this property.

◆ project_onto_initial_symmetries()

void decompose_product::project_onto_initial_symmetries ( Ex rep,
iterator  rr,
young_project yp,
const TableauBase tt,
iterator  ff,
int  offset,
const TableauBase::tab_t thetab,
bool  remove_traces 
)
private

Member Data Documentation

◆ asym_ranges

combin::range_vector_t cadabra::decompose_product::asym_ranges
private

◆ dim

unsigned int cadabra::decompose_product::dim
private

◆ f1

iterator cadabra::decompose_product::f1
private

◆ f2

iterator cadabra::decompose_product::f2
private

◆ ind1

const Indices* cadabra::decompose_product::ind1
private

◆ ind2

const Indices * cadabra::decompose_product::ind2
private

◆ nt1

yngtab::filled_tableau<iterator> cadabra::decompose_product::nt1
private

◆ nt2

yngtab::filled_tableau<iterator> cadabra::decompose_product::nt2
private

◆ t1

const TableauBase* cadabra::decompose_product::t1
private

◆ t1tab

TableauBase::tab_t cadabra::decompose_product::t1tab
private

◆ t2

const TableauBase * cadabra::decompose_product::t2
private

◆ t2tab

TableauBase::tab_t cadabra::decompose_product::t2tab
private

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