cached#
import ampform_dpd.io.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:
expr – A
sympy.Expr
on which to callcreate_function()
orcreate_parametrized_function()
.parameters – Specify this argument in order to create a
ParametrizedBackendFunction
instead of aPositionalArgumentFunction
.backend – The choice of backend for the created numerical function. WARNING: this function has only been tested for
backend="jax"
!
See also
- 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.