nkdsl.compiler.diagnostics.rules.connectivity_rulesΒΆ

Connectivity diagnostics rules based on lowered term-runner execution.

Functions

build_hilbert_support_lookup(hilbert, *, ...)

Builds exact Hilbert support lookup for membership checks.

evaluate_constraint_accepts_state(hilbert, state)

Evaluates one Hilbert constraint predicate for a candidate state.

illegal_local_state_positions(state, ...)

Finds indices with values outside the Hilbert local-state basis.

infer_shift_mod_spec_from_hilbert(hilbert)

Infers wrapped shift/mod metadata from one Hilbert space.

make_kbody_runner(term, hilbert_size, ...[, ...])

Builds one executable runner for a single K-body IR term.

sample_source_states(hilbert, *, max_samples)

Samples source states used by dynamic connectivity diagnostics.

state_to_tuple(state)

Converts one state vector to a hashable tuple.

Classes

AbstractDiagnosticRule()

Abstract base class for one diagnostics rule.

Any(*args, **kwargs)

Special type indicating an unconstrained type.

DSLDiagnostic(code, severity, message, ...)

One DSL lint/diagnostic finding produced by compiler diagnostics.

DiagnosticRuleContext(operator, ir, options)

Immutable context passed to diagnostics rules.

GeneratedConnectivityValidityRule()

Reports invalid generated connected states from sampled runner execution.