neuralqx.experimental.operators.symbolic.ir.expressions module

Typed amplitude-expression IR nodes for symbolic operators.

This module defines a compact, hashable expression tree used to represent matrix-element amplitudes in declarative symbolic operators.

class AmplitudeExpr(op, args=<factory>)

Bases: object

Typed expression node for operator matrix elements.

op

Expression operation name.

args

Ordered operation arguments (frozen tuple).

coerce_amplitude_expr(value)

Coerces user values into typed amplitude-expression nodes.

Parameters:

value (Any) – Input expression value.

Return type:

AmplitudeExpr

Returns:

Typed amplitude expression.

Raises:

TypeError – If value cannot be converted.

_collect_free_symbols(expr, result)

Recursively collects free (non-iterator-bound) symbol names from an AmplitudeExpr.

Return type:

None

_render_amplitude(expr)

Renders an AmplitudeExpr as a readable infix string.

Return type:

str