Cadabra
Computer algebra system for field theory problems
|
Base class for all properties, handling argument parsing and defining the interface.
Properties can have arguments. Parsing of these is done in the properties object itself, with the use of some helper functions. Parsing is done by implementing the virtual function property::parse(const Kernel&, keyval_t&). The argument is a container class which represents the arguments passed to the property as key/value pairs keyval_t type.
Properties will be asked to check that they can be associated to a given pattern through the virtual property::validate(const Properties&, const Ex&) function. The FIXME: the above two need to be merged, because parse may need access to the actual pattern tree, and once we are there, we may as well do checking. HOWEVER: in TableauSymmetry.cc: FIXME: we get the wrong pattern in case of a list! We should have been fed each individual item in the list, not the list itself.
This suggests that we should be calling once for every pattern, but that is wasteful in case we are just parsing arguments. Can we really avoid calling parse for every pattern?
{A_{m n}, A_{m n p}, A_{m n p q}}::TableauSymmetry(shape={2,1}, indices={0,1,2}).
leads to a problem, because the property needs to setup its internal structures but also verify that these can match all objects in the same way.
Make all identical properties point to the same property object, so that normal and list properties become pretty much identical.
#include <Props.hh>
Public Types | |
enum | match_t { no_match , id_match , exact_match } |
Public Member Functions | |
property (bool hidden=false) | |
virtual | ~property () |
bool | parse_to_keyvals (const Ex &, keyval_t &) |
virtual bool | parse (Kernel &, keyval_t &keyvals) |
virtual bool | parse (Kernel &, std::shared_ptr< Ex >, keyval_t &keyvals) |
virtual void | validate (const Kernel &, const Ex &) const |
virtual void | latex (std::ostream &) const |
Display the property on the stream. More... | |
virtual std::string | name () const =0 |
virtual std::string | unnamed_argument () const |
virtual match_t | equals (const property *) const |
void | hidden (bool h) |
Properties can be hidden because they only make sense to the system; they will not be printed when the user asks for a list of properties. More... | |
bool | hidden (void) const |
Private Member Functions | |
bool | parse_one_argument (Ex::iterator arg, keyval_t &keyvals) |
Private Attributes | |
bool | hidden_ |
property::property | ( | bool | hidden = false | ) |
|
inlinevirtual |
|
virtual |
Reimplemented in cadabra::Indices, cadabra::SortOrder, and cadabra::CommutingBehaviour.
void property::hidden | ( | bool | h | ) |
Properties can be hidden because they only make sense to the system; they will not be printed when the user asks for a list of properties.
bool property::hidden | ( | void | ) | const |
|
virtual |
Display the property on the stream.
Generate a LaTeX representation of the property, assuming LaTeX is in text mode (so it needs dollar symbols to switch to maths).
Reimplemented in cadabra::ImplicitIndex, cadabra::WeylTensor, cadabra::Trace, cadabra::TableauSymmetry, cadabra::Metric, cadabra::Indices, cadabra::GammaMatrix, and cadabra::Determinant.
|
pure virtual |
Implemented in cadabra::WeylTensor, cadabra::WeightInherit, cadabra::Weight, cadabra::Traceless, cadabra::Trace, cadabra::TableauSymmetry, cadabra::Tableau, cadabra::Symmetric, cadabra::Spinor, cadabra::SelfNonCommuting, cadabra::SelfCommuting, cadabra::SelfAntiCommuting, cadabra::SatisfiesBianchi, cadabra::RiemannTensor, cadabra::Metric, cadabra::LaTeXForm, cadabra::InverseMetric, cadabra::Integer, cadabra::Indices, cadabra::ImplicitIndex, cadabra::ImaginaryI, cadabra::GammaMatrix, cadabra::FilledTableau, cadabra::ExteriorDerivative, cadabra::EpsilonTensor, cadabra::DifferentialForm, cadabra::Determinant, cadabra::DerivativeOp, cadabra::Derivative, cadabra::DependsInherit, cadabra::Depends, cadabra::DAntiSymmetric, cadabra::AntiSymmetric, cadabra::PropertyInherit, cadabra::Inherit< T >, cadabra::Inherit< SelfCommutingBehaviour >, cadabra::Inherit< Spinor >, cadabra::Inherit< SortOrder >, cadabra::InverseVielbein, cadabra::Vielbein, cadabra::TableauInherit, cadabra::TableauBase, cadabra::Symbol, cadabra::SortOrder, cadabra::PartialDerivative, cadabra::NumericalFlat, cadabra::NonCommuting, cadabra::Matrix, cadabra::KroneckerDelta, cadabra::Integral, cadabra::IndexInherit, cadabra::GammaTraceless, cadabra::Distributable, cadabra::DiracBar, cadabra::Diagonal, cadabra::Coordinate, cadabra::CommutingAsSum, cadabra::CommutingAsProduct, cadabra::Commuting, cadabra::AntiCommuting, and cadabra::Accent.
Reimplemented in cadabra::Tableau, cadabra::Spinor, cadabra::Integral, cadabra::Integer, cadabra::GammaMatrix, cadabra::FilledTableau, cadabra::WeylTensor, cadabra::Traceless, cadabra::Trace, cadabra::TableauSymmetry, cadabra::Metric, cadabra::LaTeXForm, cadabra::InverseMetric, cadabra::ImplicitIndex, cadabra::EpsilonTensor, cadabra::DifferentialForm, cadabra::Determinant, and cadabra::Depends.
Reimplemented in cadabra::DerivativeOp, cadabra::Derivative, cadabra::labelled_property, cadabra::WeightInherit, cadabra::Weight, and cadabra::Indices.
|
private |
|
virtual |
|
private |