neuralqx.experimental.operators.symbolic.ir package¶
Symbolic operator intermediate representation (IR).
- class AmplitudeExpr(op, args=<factory>)¶
Bases:
objectTyped 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.
- class EmissionSpec(update_program, amplitude, branch_tag=None)¶
Bases:
objectOne output branch (connected state + matrix element) of a term.
A single iterator evaluation can produce multiple branches, one per
EmissionSpecin the parent term’semissionstuple. This allows a plaquette term, for example, to emit both+and-connected states from the same site-tuple without splitting into two separate terms.- update_program¶
Site-update program mapping
x -> x'.
- amplitude¶
Matrix-element expression evaluated in the source environment.
- branch_tag¶
Optional diagnostic tag for this emission slot.
- class KBodyIteratorSpec(labels, index_sets)¶
Bases:
objectStatic K-body iterator over a pre-computed list of site-index tuples.
This iterator evaluates a term kernel once per entry in index_sets. Each entry is a K-tuple of integer site indices that are bound to the corresponding element of labels inside the evaluation environment.
For a single-site iterator over all N sites, use
KBodyIteratorSpec(labels=("i",), index_sets=tuple((k,) for k in range(N))). For a static triplet iterator, provide the explicit list of(e1, e2, e3)triplets. For a global (one-branch) term, useKBodyIteratorSpec(labels=(), index_sets=((),)).- labels¶
Ordered tuple of K label strings bound per iteration.
- index_sets¶
M-tuple of K-tuples of int site indices.
- class PredicateExpr(op, args=<factory>)¶
Bases:
objectTyped boolean expression node for operator branch filtering.
- op¶
Predicate operation name.
- args¶
Ordered operation arguments.
- coerce_predicate_expr(value)¶
Coerces user values into typed predicate-expression nodes.
- class SymbolicIRTerm(name, iterator, predicate, update_program, amplitude, branch_tag=None, metadata=<factory>, fanout_hint=None, emissions=None)¶
Bases:
objectOne primitive declarative symbolic operator term.
- name¶
Term name.
- iterator¶
Iterator descriptor (
KBodyIteratorSpec).
- predicate¶
Branch-selection predicate.
- update_program¶
Matrix-element update program.
- amplitude¶
Matrix-element expression.
- branch_tag¶
Optional branch tag for diagnostics.
- metadata¶
Optional stable term metadata tuple.
- fanout_hint¶
Optional static upper-bound hint on the number of connected states this term produces per input configuration.
- emissions¶
Optional multi-emission tuple that, when present, supersedes update_program and amplitude. Each entry is an
EmissionSpecrepresenting one output branch per iterator evaluation.
- class SymbolicOperatorIR(operator_name, mode, hilbert_size, dtype_str, is_hermitian, terms=<factory>, metadata=<factory>)¶
Bases:
objectImmutable symbolic operator IR container.
- operator_name¶
Name of the operator this IR represents.
- mode¶
IR mode (
symbolicfor DSL-built operators,jax_kernelfor direct JAX-kernel operators).
- hilbert_size¶
Size of the Hilbert space (number of sites).
- dtype_str¶
String representation of the matrix-element dtype.
- is_hermitian¶
Whether the source operator is declared Hermitian.
- terms¶
Declarative term tuple for
symbolicmode.
- metadata¶
Optional stable metadata tuple.
- class UpdateOp(kind, params=<factory>)¶
Bases:
objectOne primitive site-update operation.
- kind¶
Update operation kind (see
_UPDATE_OP_KINDS).
- params¶
Deterministic parameter tuple
((key, value), ...). Values areAmplitudeExprnodes, plain integers, or nested structures depending onkind.
- class UpdateProgram(ops=<factory>)¶
Bases:
objectOrdered immutable sequence of site-update operations.
- ops¶
Ordered update-operation tuple.
- validate_symbolic_ir(ir)¶
Validates a SymbolicOperatorIR structurally and semantically.
- Parameters:
ir (
SymbolicOperatorIR) – Operator IR to validate.- Return type:
- Returns:
Validation summary dictionary.
- Raises:
ValueError – If the IR is structurally invalid.
Submodules¶
- neuralqx.experimental.operators.symbolic.ir.expressions module
- neuralqx.experimental.operators.symbolic.ir.predicates module
- neuralqx.experimental.operators.symbolic.ir.program module
- neuralqx.experimental.operators.symbolic.ir.term module
- neuralqx.experimental.operators.symbolic.ir.update module
- neuralqx.experimental.operators.symbolic.ir.validate module