Kernel: Python 3
expression
.constant_term()
Compute the "constant term" of an expression, i.e., the weight associated with the empty word.
Preconditions:
The expression is valid
Algorithm:
Based on a simple bottom-up traversal of the tree of the expression: ParseError: KaTeX parse error: \newcommand{\bra} attempting to redefine \bra; use \renewcommand
See also:
Examples
The following function allows to display nicely expressions and their constant term.
In [1]:
In [2]: