Signatures in the WASM / JavaScript view are TypeScript. Where the JavaScript facade wraps an operation its form is listed first; the other calling forms are the raw wasm-bindgen exports.
Polynomial queries
These take ordinary expressions plus a variable name; the named variable
becomes the main polynomial variable and every other free variable rides
along symbolically in the coefficients. An expression that is not polynomial
in the variable (a transcendental call of it, a non-integer power of it)
makes the query decline — None for degree, an error for the others.
degree#
Raw WebAssembly: Default context
degree(
input_expression: Expression,
variable: string,
): number | undefined
Calling forms
Raw WebAssembly: Explicit context: Context.degree
degree(
input_expression: Expression,
variable: string,
): number | undefined
Degree in variable. None when the expression is not polynomial in
variable or is identically zero (the zero polynomial has no degree
under the core convention).
leading_coefficient#
Not exposed by the WASM / JavaScript bindings. Available as Context.leading_coefficient in Python, UniffiSession.leadingCoefficient in Kotlin, UniffiSession.leadingCoefficient in Swift, api::algebra::Session::leading_coefficient in Rust.
Coefficient of the highest power of variable; may contain the other free
variables. Errors on non-polynomial or zero input.
coefficient#
Raw WebAssembly: Default context
coefficient(
input_expression: Expression,
variable: string,
power: number,
): Expression
Calling forms
Raw WebAssembly: Explicit context: Context.coefficient
coefficient(
input_expression: Expression,
variable: string,
power: number,
): Expression
Coefficient of variable^power; integer 0 when the term is absent. Errors
on non-polynomial input.
polynomial_gcd#
Not exposed by the WASM / JavaScript bindings. Available as Context.polynomial_gcd in Python, UniffiSession.polynomialGcd in Kotlin, UniffiSession.polynomialGcd in Swift, api::algebra::Session::polynomial_gcd in Rust.
Greatest common divisor of the two expressions as polynomials in variable
(primitive, with the core's sign normalisation). Errors when either input is
not polynomial in variable.
resultant#
Raw WebAssembly: Default context
resultant(a: Expression, b: Expression, variable: string): Expression
Calling forms
Raw WebAssembly: Explicit context: Context.resultant
resultant(a: Expression, b: Expression, variable: string): Expression
Resultant with respect to variable; zero exactly when the two polynomials
share a root (over the algebraic closure). Errors on non-polynomial input.
isolate_real_roots#
Raw WebAssembly: Default context
isolateRealRoots(
input_expression: Expression,
variable: string,
): IsolatingInterval[]
Calling forms
Raw WebAssembly: Explicit context: Context.isolateRealRoots
isolateRealRoots(
input_expression: Expression,
variable: string,
): IsolatingInterval[]
One (lower, upper) rational isolating interval per distinct real root,
sorted ascending; a collapsed pair (r, r) marks an exact rational root.
Requires a non-zero univariate polynomial with rational coefficients.
Notes: WASM returns IsolatingInterval objects with lower/upper
getters.
isolating_interval (WASM result class)#
lower#
Raw WebAssembly: IsolatingInterval property
readonly lower: Expression
Lower endpoint of the isolating interval.
upper#
Raw WebAssembly: IsolatingInterval property
readonly upper: Expression
Upper endpoint of the isolating interval.
Gröbner bases and ideals#
These operate over the polynomial ring Q[variables]. Generators are passed
as an expression list; the ring variables are named by a string list; the
monomial order is named by a string ("lexicographic" / "lex",
"degree_lexicographic" / "deglex", or "degree_reverse_lexicographic" /
"degrevlex", the computational default). Any generator that is not a
polynomial over Q in the named variables — a transcendental call, a non-integer
power, an unnamed symbol, or an irrational coefficient — makes the operation
decline cleanly (Python None, WASM null); it never returns a wrong or
partial answer. Within Q[variables] the results are exact and complete: a
returned basis is the canonical reduced Gröbner basis, membership is a genuine
decision, and elimination is exact by the Elimination Theorem.
Performance. The basis is computed by F4 (Faugère's
batched Macaulay-matrix reduction), with a signature-based engine (F5 / GVW)
available internally; the reference Buchberger algorithm is retained as the
differential oracle these are checked against. The choice of engine is an
internal acceleration only: the result is identical to the reference
Buchberger basis for every input, and the monomial-order argument and the whole
binding surface are unchanged. These entry points simply run faster — there is
no new method to call.
groebner_basis#
Not exposed by the WASM / JavaScript bindings. Available as Context.groebner_basis in Python, UniffiSession.groebnerBasis in Kotlin, UniffiSession.groebnerBasis in Swift, api::algebra::Session::groebner_basis in Rust.
The canonical reduced Gröbner basis of the ideal <generators> under the named
monomial order — monic, autoreduced, and sorted, so it is unique for the
(ideal, order) pair. None when any generator is outside Q[variables].
ideal_membership#
Not exposed by the WASM / JavaScript bindings. Available as Context.ideal_membership in Python, UniffiSession.idealMembership in Kotlin, UniffiSession.idealMembership in Swift, api::algebra::Session::ideal_membership in Rust.
Whether element lies in the ideal <generators>, decided by reducing it to
its normal form modulo the Gröbner basis (zero exactly when it is a member).
The verdict is independent of the order. None when the element or a generator
is outside Q[variables].
ideal_sum#
Not exposed by the WASM / JavaScript bindings. Available as Context.ideal_sum in Python, UniffiSession.idealSum in Kotlin, UniffiSession.idealSum in Swift, api::algebra::Session::ideal_sum in Rust.
A Gröbner basis of the ideal sum I + J, the ideal generated by the two
generator lists together. None on a non-Q[variables] generator.
ideal_product#
Not exposed by the WASM / JavaScript bindings. Available as Context.ideal_product in Python, UniffiSession.idealProduct in Kotlin, UniffiSession.idealProduct in Swift, api::algebra::Session::ideal_product in Rust.
A Gröbner basis of the ideal product IJ, generated by all pairwise
products of the two generator lists. None on a non-Q[variables] generator.
ideal_intersection#
Not exposed by the WASM / JavaScript bindings. Available as Context.ideal_intersection in Python, UniffiSession.idealIntersection in Kotlin, UniffiSession.idealIntersection in Swift, api::algebra::Session::ideal_intersection in Rust.
A generating set of the ideal intersection I∩J, computed by the standard
tag-variable elimination construction tI+(1−t)J. None on a
non-Q[variables] generator.
elimination_ideal#
Not exposed by the WASM / JavaScript bindings. Available as Context.elimination_ideal in Python, UniffiSession.eliminationIdeal in Kotlin, UniffiSession.eliminationIdeal in Swift, api::algebra::Session::elimination_ideal in Rust.
A Gröbner basis of the elimination ideal ⟨generators⟩∩Q[surviving variables], projecting away the variables named in eliminate via the
Elimination Theorem (a block order ranks the eliminated variables high and the
generators free of them are kept). Exact: it neither drops nor introduces
components. None on a non-Q[variables] generator. Example: eliminating t
from {x−t2,y−t3} returns the twisted-cubic implicit equation y2−x3.
Order change and implicitisation#
These consume a Gröbner basis rather than compute one from scratch. The order
change runs the standard FGLM algorithm; implicitisation is parameter
elimination with the rational-parametrisation saturation wired in.
change_monomial_order#
Not exposed by the WASM / JavaScript bindings. Available as Context.change_monomial_order in Python, UniffiSession.changeMonomialOrder in Kotlin, UniffiSession.changeMonomialOrder in Swift, api::algebra::Session::change_monomial_order in Rust.
Convert a Gröbner basis of a zero-dimensional ideal from source_order to
target_order by FGLM (Faugère–Gianni–Lazard–Mora) — linear algebra in the
finite-dimensional quotient ring Q[variables]/I, far cheaper than computing
the target basis directly (the msolve route to a lexicographic basis is a cheap
degrevlex basis followed by this conversion). The result is the canonical
reduced Gröbner basis under target_order, identical to a direct
groebner_basis call. None when the ideal is positive-dimensional (the
quotient ring is infinite-dimensional, so FGLM does not apply) or any generator
is outside Q[variables].
implicitize#
Raw WebAssembly: Default context
implicitize(
coordinates: string[],
parameters: string[],
parametric_expressions: Expression[],
): Expression[] | undefined
Calling forms
Raw WebAssembly: Explicit context: Context.implicitize
implicitize(
coordinates: string[],
parameters: string[],
parametric_expressions: Expression[],
): Expression[] | undefined
The implicit ideal of a parametric curve or surface xi=fi(parameters) (the
i-th coordinate paired with the i-th parametric expression), returned as a
generator list over Q[coordinates] — the elimination of the parameters
(Cox–Little–O'Shea ch. 3). A polynomial parametrisation eliminates the
parameters directly; a rational one fi=pi/qi clears denominators and
saturates by the denominator product through a fresh tag variable, so the
eliminant is the true implicit equation rather than a multiple carrying spurious
components. None when a parametric expression is outside Q(parameters) or
there are no parameters. Examples: {x=t2,y=t3} returns y2−x3;
{x=(1−t2)/(1+t2),y=2t/(1+t2)} returns x2+y2−1.
Example#
This family is not part of the recommended JavaScript facade in this release. Call it through the generated symi.raw layer, whose entries are listed with their wasm-bindgen signatures above, and read Migration for the ownership rules that apply there.
Additional API#
Context#
SymiFacade property
Context: ContextConstructor
Public property placement for Context.
Expression#
SymiFacade property
Public property placement for Expression.
Matrix#
SymiFacade property
Public property placement for Matrix.
SymiContextError#
Type
class SymiContextError extends SymiError {}
Public type placement for SymiContextError.
SymiDomainError#
Type
class SymiDomainError extends SymiError {}
Public type placement for SymiDomainError.
SymiError#
Type
class SymiError extends Error
Public type placement for SymiError.
SymiInternalError#
Type
class SymiInternalError extends SymiError {}
Public type placement for SymiInternalError.
SymiResourceError#
Type
class SymiResourceError extends SymiError {}
Public type placement for SymiResourceError.
SymiTypeError#
Type
class SymiTypeError extends SymiError {}
Public type placement for SymiTypeError.
changeMonomialOrder#
Raw WebAssembly: Default context
changeMonomialOrder(
basis: Expression[],
variables: string[],
source_order: string,
target_order: string,
): Expression[] | undefined
Convert a Gröbner basis of a zero-dimensional ideal from source_order to target_order by FGLM (Faugère–Gianni–Lazard–Mora) — linear algebra in the finite-dimensional quotient ring Q[variables]/I, far cheaper than computing the target basis directly (the msolve route to a lexicographic basis is a cheap degrevlex basis followed by this conversion).
Calling forms
Raw WebAssembly: Explicit context: Context.changeMonomialOrder
changeMonomialOrder(
basis: Expression[],
variables: string[],
source_order: string,
target_order: string,
): Expression[] | undefined
eliminationIdeal#
Raw WebAssembly: Default context
eliminationIdeal(
generators: Expression[],
variables: string[],
eliminate: string[],
): Expression[] | undefined
A Gröbner basis of the elimination ideal ⟨generators⟩∩Q[surviving variables], projecting away the variables named in eliminate via the Elimination Theorem (a block order ranks the eliminated variables high and the generators free of them are kept).
Calling forms
Raw WebAssembly: Explicit context: Context.eliminationIdeal
eliminationIdeal(
generators: Expression[],
variables: string[],
eliminate: string[],
): Expression[] | undefined
free#
Expression method
Public method placement for free.
groebnerBasis#
Raw WebAssembly: Default context
groebnerBasis(
generators: Expression[],
variables: string[],
order?: string | null,
): Expression[] | undefined
The canonical reduced Gröbner basis of the ideal <generators> under the named monomial order — monic, autoreduced, and sorted, so it is unique for the (ideal, order) pair. None when any generator is outside Q[variables].
Calling forms
Raw WebAssembly: Explicit context: Context.groebnerBasis
groebnerBasis(
generators: Expression[],
variables: string[],
order?: string | null,
): Expression[] | undefined
idealIntersection#
Raw WebAssembly: Default context
idealIntersection(
generators_left: Expression[],
generators_right: Expression[],
variables: string[],
order?: string | null,
): Expression[] | undefined
A generating set of the ideal intersection I∩J, computed by the standard tag-variable elimination construction tI+(1−t)J.
Calling forms
Raw WebAssembly: Explicit context: Context.idealIntersection
idealIntersection(
generators_left: Expression[],
generators_right: Expression[],
variables: string[],
order?: string | null,
): Expression[] | undefined
idealMembership#
Raw WebAssembly: Default context
idealMembership(
element: Expression,
generators: Expression[],
variables: string[],
order?: string | null,
): boolean | undefined
Whether element lies in the ideal <generators>, decided by reducing it to its normal form modulo the Gröbner basis (zero exactly when it is a member).
Calling forms
Raw WebAssembly: Explicit context: Context.idealMembership
idealMembership(
element: Expression,
generators: Expression[],
variables: string[],
order?: string | null,
): boolean | undefined
idealProduct#
Raw WebAssembly: Default context
idealProduct(
generators_left: Expression[],
generators_right: Expression[],
variables: string[],
order?: string | null,
): Expression[] | undefined
A Gröbner basis of the ideal product IJ, generated by all pairwise products of the two generator lists. None on a non-Q[variables] generator.
Calling forms
Raw WebAssembly: Explicit context: Context.idealProduct
idealProduct(
generators_left: Expression[],
generators_right: Expression[],
variables: string[],
order?: string | null,
): Expression[] | undefined
idealSum#
Raw WebAssembly: Default context
idealSum(
generators_left: Expression[],
generators_right: Expression[],
variables: string[],
order?: string | null,
): Expression[] | undefined
A Gröbner basis of the ideal sum I + J, the ideal generated by the two generator lists together. None on a non-Q[variables] generator.
Calling forms
Raw WebAssembly: Explicit context: Context.idealSum
idealSum(
generators_left: Expression[],
generators_right: Expression[],
variables: string[],
order?: string | null,
): Expression[] | undefined
leadingCoefficient#
Raw WebAssembly: Default context
leadingCoefficient(
input_expression: Expression,
variable: string,
): Expression
Coefficient of the highest power of variable; may contain the other free variables. Errors on non-polynomial or zero input.
Calling forms
Raw WebAssembly: Explicit context: Context.leadingCoefficient
leadingCoefficient(
input_expression: Expression,
variable: string,
): Expression
polynomialGcd#
Raw WebAssembly: Default context
polynomialGcd(
a: Expression,
b: Expression,
variable: string,
): Expression
Greatest common divisor of the two expressions as polynomials in variable (primitive, with the core's sign normalisation).
Calling forms
Raw WebAssembly: Explicit context: Context.polynomialGcd
polynomialGcd(
a: Expression,
b: Expression,
variable: string,
): Expression
raw#
SymiFacade property
Public property placement for raw.
toString#
Expression method
The mathematical text of the expression.
Calling forms
Raw WebAssembly: Expression method: Expression.toString
PiecewiseBranch#
Type
interface PiecewiseBranch
Public type placement for PiecewiseBranch.
PiecewiseBranch.condition#
PiecewiseBranch property
condition: ExpressionLike
Public property placement for condition.
PiecewiseBranch.value#
PiecewiseBranch property
Public property placement for value.