3.9.3. qupulse.utils.sympy

Functions

_cached_sympify(expr, **kwargs)

_float_arr_to_int_arr(float_arr)

Try to cast array to int64.

_floor_to_int(input_value)

_parse_broadcast_index(idx, user)

_parse_broadcast_shape(shape, user)

_recursive_substitution(expression, ...)

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

alias of qupulse.utils.sympy.Len

Exceptions

UnsupportedBroadcastArgumentWarning

qupulse.utils.sympy.evaluate_lambdified(expression: Union[sympy.core.expr.Expr, numpy.ndarray], variables: Sequence[str], parameters: Dict[str, Union[numpy.ndarray, numbers.Number]], lambdified: Optional[Callable]) Tuple[Any, Any][source]
qupulse.utils.sympy.get_free_symbols(expression: sympy.core.expr.Expr) Sequence[sympy.core.symbol.Symbol][source]
qupulse.utils.sympy.get_most_simple_representation(expression: sympy.core.expr.Expr) Union[str, int, float][source]
qupulse.utils.sympy.get_variables(expression: sympy.core.expr.Expr) Sequence[str][source]
qupulse.utils.sympy.recursive_substitution(expression: sympy.core.expr.Expr, substitutions: Dict[str, Union[sympy.core.expr.Expr, numpy.ndarray, str]]) sympy.core.expr.Expr[source]
qupulse.utils.sympy.substitute_with_eval(expression: sympy.core.expr.Expr, substitutions: Dict[str, Union[sympy.core.expr.Expr, numpy.ndarray, str]]) sympy.core.expr.Expr[source]

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

qupulse.utils.sympy.sympify(expr: Union[str, numbers.Number, sympy.core.expr.Expr, numpy.str_], **kwargs) sympy.core.expr.Expr[source]
qupulse.utils.sympy.to_numpy(sympy_array: sympy.tensor.array.ndim_array.NDimArray) numpy.ndarray[source]