mqt.core.symbolic
¶
Symbolic expressions and terms.
Module Contents¶
- class Expression(terms: Sequence[Term], constant: float = 0.0)¶
- class Expression(term: Term, constant: float = 0.0)
- class Expression(constant: float = 0.0)
A symbolic expression which consists of a sum of terms and a constant.
The expression is of the form \(constant + term_1 + term_2 + \dots + term_n\).
- Parameters:
terms – The list of terms.
constant – The constant.
Alternatively, an expression can be created with a single term and a constant or just a constant.
- __add__(arg0: Expression) Expression ¶
- __add__(arg0: Term) Expression
- __add__(arg0: float) Expression
- __mul__(arg0: float) Expression ¶
- __radd__(arg0: Term) Expression ¶
- __radd__(arg0: float) Expression
- __rmul__(arg0: float) Expression ¶
- __rsub__(arg0: Term) Expression ¶
- __rsub__(arg0: float) Expression
- __rtruediv__(arg0: float) Expression ¶
- __sub__(arg0: Expression) Expression ¶
- __sub__(arg0: Term) Expression
- __sub__(arg0: float) Expression
- __truediv__(arg0: float) Expression ¶
- class Term(variable: Variable, coefficient: float = 1.0)¶
A symbolic term which consists of a variable with a given coefficient.
- Parameters:
variable – The variable of the term.
coefficient – The coefficient of the term.
- add_coefficient(coeff: float) None ¶
Add a coefficient to the coefficient of this term.
- Parameters:
coeff – The coefficient to add.