Cadabra
Computer algebra system for field theory problems
Classes | Functions
Notebooks and packages

Module Description

Graphical notebook interface and Cadabra packages.

Functionality to store and manipulate Cadabra notebooks and use them as packages inside other notebooks or scripts.

Classes

class  cadabra::DataCell
 DataCells are the basic building blocks for a document. More...
 

Functions

std::string cadabra::cdb2python (const std::string &, bool display)
 Convert a block of Cadabra notation into pure Python. More...
 
std::string cadabra::convert_line (const std::string &, std::string &lhs, std::string &rhs, std::string &op, std::string &indent, bool display)
 As above, but for a single line; for private use only. More...
 
std::string cadabra::cnb2python (const std::string &, bool for_standalone)
 Convert a Cadabra notebook file to pure Python. More...
 
void cadabra::compile_package (const std::string &in_name, const std::string &out_name)
 Convert a Cadabra notebook file to a python package which can be imported using standard 'import' notation. More...
 

Function Documentation

◆ cdb2python()

std::string cadabra::cdb2python ( const std::string &  in_name,
bool  display 
)

Convert a block of Cadabra notation into pure Python.

Mimics the functionality in the python script 'cadabra2' If display is false, this will not make ';' characters generate 'display' statements (used in the conversion of notebooks to python packages).

◆ cnb2python()

std::string cadabra::cnb2python ( const std::string &  in_name,
bool  for_standalone 
)

Convert a Cadabra notebook file to pure Python.

This gets called on-the-fly when importing Cadabra notebooks written by users, and at install time for all system-supplied packages. If for_standalone is false, this will not make ';' characters generate 'display' statements (used in the conversion of notebooks to python packages), and it will not convert any cells which have their ignore_on_import flag set.

◆ compile_package()

void cadabra::compile_package ( const std::string &  in_name,
const std::string &  out_name 
)

Convert a Cadabra notebook file to a python package which can be imported using standard 'import' notation.

Doing this will ignore all cells which are labelled ignore_on_import.

◆ convert_line()

std::string cadabra::convert_line ( const std::string &  line,
std::string &  lhs,
std::string &  rhs,
std::string &  op,
std::string &  indent,
bool  display 
)

As above, but for a single line; for private use only.

If display is false, this will not make ';' characters generate 'display' statements (used in the conversion of notebooks to python packages).