3.8.3. qupulse.utils.sympy

Functions

almost_equal(lhs, rhs[, epsilon])

Returns True (or False) if the two expressions are almost equal (or not).

evaluate_compiled(expression, parameters[, ...])

evaluate_lambdified(expression, variables, ...)

evaluate_lamdified_exact_rational(...)

Evaluates Rational as TimeType.

get_free_symbols(expression)

get_free_symbols_cache(expression)

get_most_simple_representation(expression)

get_subscripted_symbols(expression)

get_variables(expression)

numpy_compatible_add(*args)

numpy_compatible_ceiling(input_value)

numpy_compatible_mul(*args)

recursive_substitution(expression, substitutions)

substitute_with_eval(expression, substitutions)

Substitutes only sympy.Symbols.

sympify(expr, **kwargs)

sympify_cache(value)

Cache sympify result for all hashable types

to_numpy(sympy_array)

Classes

Broadcast(x, shape)

Broadcast x to the specified shape using numpy.broadcast_to.

HighPrecPrinter([settings])

Custom printer that translates sympy.Rational into TimeType

IndexedBasedFinder()

Acts as a symbol lookup and determines which symbols in an expression a subscripted.

IndexedBroadcast(x, shape, idx)

Broadcast x to the specified shape using numpy.broadcast_to and index in the result.

Len

Exceptions

UnsupportedBroadcastArgumentWarning

evaluate_lambdified(expression: Expr | ndarray, variables: Sequence[str], parameters: Dict[str, ndarray | Number], lambdified: Callable | None) Tuple[Any, Any][source]
get_free_symbols(expression: Expr) Sequence[Symbol][source]
get_most_simple_representation(expression: Expr) str | int | float[source]
get_variables(expression: Expr) Sequence[str][source]
recursive_substitution(expression: Expr, substitutions: Dict[str, Expr | ndarray | str]) Expr[source]
substitute_with_eval(expression: Expr, substitutions: Dict[str, Expr | ndarray | str]) Expr[source]

Substitutes only sympy.Symbols. Workaround for numpy like array behaviour. ~Factor 3 slower compared to subs

sympify(expr: str | Number | Expr | str_, **kwargs) Expr[source]
to_numpy(sympy_array: NDimArray) ndarray[source]