Cadabra
Computer algebra system for field theory problems
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions
PythonCdb.hh File Reference
#include <boost/python.hpp>
#include <stdexcept>
#include "Storage.hh"
#include "Kernel.hh"
#include "Algorithm.hh"

Go to the source code of this file.

Classes

class  BaseProperty
 Helper class to ensure that all Python property objects derive from the same base class. More...
 
class  Property< T >
 Property is a templated wrapper around a C++ property object. More...
 

Functions

bool __eq__Ex_Ex (const cadabra::Ex &, const cadabra::Ex &)
 Comparison operator for Ex objects in Python. More...
 
bool __eq__Ex_int (const cadabra::Ex &, int)
 Comparison operator for Ex objects in Python. More...
 
std::shared_ptr< cadabra::Exfetch_from_python (const std::string &nm)
 Fetch an Ex object from the Python side using its Python identifier. More...
 
std::string Ex_str_ (const cadabra::Ex &)
 Generate the Python str() and repr() representation of the Ex object. More...
 
std::string Ex_repr_ (const cadabra::Ex &)
 
std::string Ex_latex_ (const cadabra::Ex &)
 The Python 'print' function always calls the 'str' member on objects to be printed. More...
 
boost::python::object Ex_to_Sympy (const cadabra::Ex &)
 Outputs a Cadabra 'Ex' as a Sympy expression. More...
 
std::string Ex_to_Sympy_string (const cadabra::Ex &)
 Similar to Ex_to_Sympy, but only producing a string which can be parsed by Sympy, instead of a full-fledged Sympy expression. More...
 
cadabra::Ex operator+ (const cadabra::Ex &ex1, const cadabra::Ex &ex2)
 Add two expressions, adding a top-level node if required. More...
 
cadabra::Ex operator- (const cadabra::Ex &ex1, const cadabra::Ex &ex2)
 Subtract two expressions, adding a top-level node if required. More...
 
cadabra::Kernelcreate_scope ()
 Setup of kernels in current scope, callable from Python. More...
 
cadabra::Kernelcreate_scope_from_global ()
 
cadabra::Kernelcreate_empty_scope ()
 
void inject_defaults (cadabra::Kernel *)
 Inject properties directly into the Kernel, even if the kernel is not yet on the Python stack (needed when we create a new local scope: in this case we create the kernel and pass it back to be turned into local cdbkernel by Python, but we want to populate the kernel with defaults before we hand it back). More...
 
cadabra::Kernelget_kernel_from_scope ()
 Get a pointer to the currently visible kernel. More...
 
void call_post_process (cadabra::Kernel &, cadabra::Ex &ex)
 Run the post-process Python function (if defined) on the given expression. More...
 

Function Documentation

cadabra::Kernel* create_empty_scope ( )
cadabra::Kernel* create_scope_from_global ( )
std::string Ex_repr_ ( const cadabra::Ex )
std::string Ex_to_Sympy_string ( const cadabra::Ex )

Similar to Ex_to_Sympy, but only producing a string which can be parsed by Sympy, instead of a full-fledged Sympy expression.

std::shared_ptr<cadabra::Ex> fetch_from_python ( const std::string &  nm)

Fetch an Ex object from the Python side using its Python identifier.