Supported Subset of SymPy#
This page lists the parts of SymPy’s symbolic algebra toolbox that pystencils is able to parse and translate into code. This includes a list of restrictions and caveats.
sympy.core#
Symbols |
Represent untyped variables |
|
Integers |
||
Rational Numbers |
Non-integer rationals are interpreted using the division operation of their context’s data type. |
|
Arbitrary-Precision Floating Point |
Will initially be narrowed to double-precision (aka. the Python |
|
Transcendentals: \(\pi\) and \(e\) |
Only valid in floating-point contexts.
Will be rounded to the nearest number representable in the
respective data type (e.g. |
|
Infinities (\(\pm \infty\)) |
Only valid in floating point contexts. |
|
Arithmetic |
Integer powers up to \(8\) will be expanded by pairwise multiplication.
Negative integer powers will be replaced by divisions.
Square root powers with a numerator \(\le 8\) will be replaced
by (products of) the |
|
Relations ( |
Result has type |
|
(Nested) Tuples |
Tuples of expressions are interpreted as array literals. Tuples that contain further nested tuples must have a uniform, cuboid structure, i.e. represent a proper n-dimensional array, to be parsed as multidimensional array literals; otherwise an error is raised. |
sympy.functions#
Only valid in floating-point contexts |
||
Hyperbolic Functions |
Only valid in floating-point contexts |
|
Exponentials |
Only valid in floating-point contexts |
|
Absolute |
||
Rounding |
Result will have the same data type as the arguments, so in order to
get an integer, a type cast is additionally required (see |
|
Min/Max |
||
Piecewise Functions |
Cases of the piecewise function must be exhaustive; i.e. end with a default case. |
sympy.logic#
sympy.tensor#
Indexed Objects |
Base of the indexed object must have a |