Skip to content

schubmult.symbolic.functions

SymEngine-first wrappers (expand, symbols, sympify) that fall back to SymPy, plus small helpers.

expand

def expand(obj, **kwargs)

Expand with SymEngine; use SymPy if keyword options are given or SymEngine fails.

symbols

def symbols(*args, **kwargs)

SymEngine symbols.

sympify

def sympify(val)

SymEngine sympify, falling back to SymPy for objects SymEngine cannot convert.

is_of_func_type

def is_of_func_type(elem, typ)

isinstance that also sees through SymEngine PyFunction wrappers around SymPy functions.

expand_seq

def expand_seq(seq, genset)

The monomial genset[1]**seq[0] * genset[2]**seq[1] * ... (1-indexed generators).

efficient_subs

def efficient_subs(expr, subs_dict)

expr.subs restricted to the entries of subs_dict that actually occur in expr.