Miscellaneous API

This page documents various utility functions and constants that don't fit into other categories.

Constants

Symbolics.NAMESPACE_SEPARATORConstant
NAMESPACE_SEPARATOR

Character used to separate nested symbolic names when Symbolics displays a namespace-qualified variable.

The separator is and is used by variable construction and display code.

source

Utility functions

Symbolics.LinearExpanderType
struct LinearExpander

A functor which acts as the workhorse for Symbolics.linear_expansion. The operation linear_expansion(t::Symbolics.SymbolicT, x::Symbolics.SymbolicT) can equivalently be phrased as LinearExpander(x)(t). This functor caches data during processing, and thus several linear_expansion calls with the same x can be rephrased as multiple calls to LinearExpansion(x). This can help avoid repeated computation and allocations.

source
Symbolics._toexpr_metadataFunction
_toexpr_metadata(O, ::Type{Ctx}, val; latexwrapper) -> Union{Nothing, Any}

Hook for customizing Latexify output based on metadata. Return nothing to fall back to the default behavior.

Defined in Symbolics (not in the Latexify extension) so downstream packages can add methods via import Symbolics without reaching into the extension with Base.get_extension. The Latexify extension calls this hook while building LaTeX expressions and provides the _toexpr_plain and default_latex_wrapper helpers for composing output inside a method.

source
Symbolics._toexpr_opFunction
_toexpr_op(op, args; latexwrapper) -> Union{Nothing, Any}

Hook for customizing Latexify output based on the operation of a call. Return nothing to fall back to the default behavior.

Defined in Symbolics (not in the Latexify extension) so downstream packages can add methods via import Symbolics without reaching into the extension with Base.get_extension.

source

Deprecated

These names are still exported so that existing code keeps working, but each one warns on use and will be removed in the next breaking release.

Symbolics.infimumFunction
Symbolics.infimum(d::AbstractInterval)

Deprecated. Use IntervalSets.infimum (also re-exported by DomainSets) instead.

Return the left endpoint of the interval domain d.

This function was added so that an interval with Num endpoints, such as the domain of a PDE variable written x ∈ Interval(a, b), could be queried for its lower bound. That turned out to be unnecessary: IntervalSets.infimum is generic over the endpoint type and already handles Num, so the only effect of a separate Symbolics.infimum is to shadow it whenever both Symbolics and DomainSets are in scope.

Symbolics.infimum now forwards to IntervalSets.infimum and warns; it will be removed in the next breaking release. Callers should switch to

import DomainSets
infimum(d)

See also: Symbolics.supremum.

source
Symbolics.supremumFunction
Symbolics.supremum(d::AbstractInterval)

Deprecated. Use IntervalSets.supremum (also re-exported by DomainSets) instead.

Return the right endpoint of the interval domain d. This is the counterpart of Symbolics.infimum and is deprecated for the same reason: IntervalSets.supremum is generic over the endpoint type and already handles Num, so a separate Symbolics function only shadows it.

Symbolics.supremum now forwards to IntervalSets.supremum and warns; it will be removed in the next breaking release.

source