nkdsl.dsl.contextΒΆ

Build-time expression context for symbolic operator DSL callbacks.

Functions

coerce_amplitude_expr(value)

Coerces user values into typed amplitude-expression nodes.

coerce_predicate_expr(value)

Coerces user values into typed predicate-expression nodes.

emitted(label)

Returns a symbolic selector bound to the emitted/connected state x'.

site(label)

Returns a symbolic site selector.

source_index(flat_index)

Returns a static source-configuration read x[flat_index].

symbol(name, *[, default, doc, dtype])

Returns a free symbolic amplitude expression by name.

target_index(flat_index)

Returns a static emitted/target-configuration read x'[flat_index].

Classes

AmplitudeExpr(op[, args])

Typed expression node for operator matrix elements.

Any(*args, **kwargs)

Special type indicating an unconstrained type.

ExpressionContext()

Utility context passed to DSL callables at build time.

PredicateExpr(op[, args])

Typed boolean expression node for operator branch filtering.

SiteSelector(label[, namespace])

Symbolic selector for one Hilbert-space site iterator.