E

Symbolica documentation for getting started, symbolic expressions, numerical evaluation, pattern matching, and APIs in Python and Rust.

E

E(
    input: str,
    mode: ParseMode = ParseMode.Symbolica,
    default_namespace: str | None = None,
) -> Expression

Parse a Symbolica expression from a string.

Examples

e = E('x^2+y+y*4')
print(e) # x^2+5*y

Parse a Mathematica expression:

e = E('Cos[test`x] (2 + 3 I)', mode=ParseMode.Mathematica)
print(e) # cos(test::x)(2+3i)

Parameters

  • input (str) An input string. UTF-8 characters are allowed.
  • mode (ParseMode) The parsing mode. Use ParseMode.Mathematica to parse Mathematica expressions.
  • default_namespace (str | None) The namespace assumed for unqualified symbols during parsing.

Raises

  • ValueError: If the input is not a valid expression.