Expression

class pqp.expression.Expression

Bases: object

Base class for all expressions.

The primary use of Expression is to represent the results of identification. However, Expressions can be constructed from Variables and other Expressions. Using the infix / and * operators.

Examples

>>> from pqp.variable import make_vars
>>> x, y = make_vars("xy")
>>> x / y
Quotient(Variable(x), Variable(y))
>>> x * y
Product([Variable(x), Variable(y)])
Expressions can be represented in a number of different ways.
  • __repr__ returns an unambiguous representation of the expression

  • __str__ returns a human-readable (ascii, symbolic) representation

  • to_latex returns a Latex representation of the expression

Methods Summary

display()

Renders an expression as Latex using IPython.display

to_latex()

Returns the Latex representation of an expression.

Methods Documentation

display()

Renders an expression as Latex using IPython.display

to_latex()

Returns the Latex representation of an expression.