Miscellaneous API
This page documents various utility functions and constants that don't fit into other categories.
Constants
Symbolics.NAMESPACE_SEPARATOR — Constant
NAMESPACE_SEPARATORCharacter 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.
Utility functions
Symbolics.linear_expansion — Function
(a, b, islinear) = linear_expansion(t, x)When islinear, return a and b such that a * x + b == t. Instead of calling linear_expansion multiple times with the same x, prefer using Symbolics.LinearExpander.
Symbolics.LinearExpander — Type
struct LinearExpanderA 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.
Symbolics._toexpr_metadata — Function
_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.
Symbolics._toexpr_op — Function
_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.
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.infimum — Function
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.
Symbolics.supremum — Function
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.