nkdsl.symbol

symbol(name, *, default=_UNSET_SYMBOL_DEFAULT, doc='', dtype=None)[source]

Returns a free symbolic amplitude expression by name.

Free symbols are not bound to any site iterator. They can optionally declare a default value and documentation. When a default is provided, compiled operators can evaluate without external symbol bindings.

Parameters:
  • name (str) – Symbol name.

  • default (Any) – Optional default value.

  • doc (str) – Optional symbol documentation string.

  • dtype (Any | None) – Optional NumPy-compatible dtype declaration. If not provided and default is supplied, dtype is inferred from default.

Returns:

Symbolic amplitude expression.

Return type:

AmplitudeExpr