cached#

Handy aliases for working with cached SymPy expressions and lambdification.

lambdify(expr: Expr, *, backend: str = 'jax') PositionalArgumentFunction[source]#
lambdify(expr: Expr, parameters: Mapping[Symbol, ParameterValue], *, backend: str = 'jax') ParametrizedBackendFunction

Lambdify a SymPy Expr and cache the result to disk.

The cached result is fetched from disk if the hash of the expression is the same as the hash embedded in the filename.

Parameters:
simplify(expr: Expr, *args, **kwargs) Expr[source]#

Perform simplify() and cache the result to disk.

Added in version 0.15.7.

subs(expr: Expr, substitutions: Mapping[Basic, Basic]) Expr[source]#

Call subs() and cache the result to disk.

trigsimp(expr: Expr, *args, **kwargs) Expr[source]#

Perform trigsimp() and cache the result to disk.

Added in version 0.15.7.

unfold(obj: Expr | Model, substitutions: Mapping[Basic, Basic] | None = None) Expr[source]#

Efficiently perform both substitutions and doit().

xreplace(expr: Expr, substitutions: Mapping[Basic, Basic]) Expr[source]#

Call xreplace() and cache the result to disk.