API reference

This section is generated from the package source with Sphinx autodoc and autosummary.

Top-level exports

nkdsl.SymbolicDiscreteJaxOperator

Fluent builder for declarative symbolic quantum operators.

nkdsl.Update

Immutable, chainable site-update program builder.

nkdsl.ExpressionContext

Utility context passed to DSL callables at build time.

nkdsl.SiteSelector

Symbolic selector for one Hilbert-space site iterator.

nkdsl.site

Returns a symbolic site selector.

nkdsl.emitted

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

nkdsl.symbol

Returns a free symbolic amplitude expression by name.

nkdsl.source_index

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

nkdsl.target_index

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

nkdsl.shift

Returns an Update that shifts site site_ref by delta.

nkdsl.shift_mod

Returns an Update performing a Hilbert-aware wrapped modular shift.

nkdsl.write

Returns an Update that writes value to site site_ref.

nkdsl.swap

Returns an Update that swaps sites site_a and site_b.

nkdsl.permute

Returns an Update performing a cyclic rotation over K sites.

nkdsl.affine

Returns an Update computing x'[i] = scale * x[i] + bias.

nkdsl.scatter

Returns an Update performing bulk writes to static flat indices.

nkdsl.identity

Returns the identity (no-op) Update.

nkdsl.SymbolicOperator

A symbolic operator built via the SymbolicDiscreteJaxOperator DSL.

nkdsl.CompiledOperator

An executable operator produced by lowering a SymbolicOperator.

nkdsl.SymbolicOperatorSum

Additive composition of multiple symbolic operators sharing one Hilbert space.

nkdsl.SymbolicCompiler

Orchestrates the symbolic operator compilation pipeline.

nkdsl.SymbolicCompilerOptions

Static and runtime controls for symbolic compiler execution.

nkdsl.SymbolicCompilationContext

Holds per-compilation mutable state across pipeline stages.

nkdsl.SymbolicCompiledArtifact

Compilation artifact produced by the symbolic compiler pipeline.

nkdsl.SymbolicCompilationSignature

Deterministic compilation signature for cache-key generation.

nkdsl.SymbolicCacheKey

Immutable cache key for compiled symbolic operator artifacts.

nkdsl.SymbolicOperatorIR

Immutable symbolic operator IR container.

nkdsl.SymbolicIRTerm

One primitive declarative symbolic operator term.

nkdsl.KBodyIteratorSpec

Static K-body iterator over a pre-computed list of site-index tuples.

nkdsl.EmissionSpec

One output branch (connected state + matrix element) of a term.

nkdsl.UpdateProgram

Ordered immutable sequence of site-update operations.

nkdsl.UpdateOp

One primitive site-update operation.

nkdsl.AmplitudeExpr

Typed expression node for operator matrix elements.

nkdsl.PredicateExpr

Typed boolean expression node for operator branch filtering.

nkdsl.cfg

Typed, hookable, and singleton configuration manager for nkDSL.

Modules

nkdsl

Symbolic operator subsystem for NetKet.

nkdsl.dsl

User-facing declarative symbolic operator DSL.

nkdsl.dsl.context

Build-time expression context for symbolic operator DSL callbacks.

nkdsl.dsl.operator

Fluent operator builder, the primary entry point to the symbolic DSL.

nkdsl.dsl.rewrite

Fluent immutable update-program builder for the symbolic operator DSL.

nkdsl.dsl.selectors

Symbolic selector helpers for the declarative symbolic operator DSL.

nkdsl.core

Core symbolic operator types.

nkdsl.core.base

Abstract base class for all symbolic operator implementations.

nkdsl.core.operator

Unified symbolic operator type produced by the Operator DSL builder.

nkdsl.core.compiled

Compiled executable operators produced by symbolic lowering.

nkdsl.core.sum

Additive composition of symbolic operators.

nkdsl.compiler

Symbolic operator compiler package.

nkdsl.compiler.compiler

Symbolic operator compiler orchestrator.

nkdsl.compiler.defaults

Default pipeline and registry factories for the symbolic compiler.

nkdsl.compiler.cache.store

Artifact cache stores for the symbolic compiler.

nkdsl.compiler.core.artifact

Compiled symbolic operator artifact structures.

nkdsl.compiler.core.context

Mutable symbolic compilation context shared across passes and lowerers.

nkdsl.compiler.core.options

Symbolic compiler option definitions.

nkdsl.compiler.core.pipeline

Symbolic compiler pass-pipeline abstraction.

nkdsl.compiler.core.pass_report

Compiler pass-report structures.

nkdsl.compiler.core.signature

Compilation-signature helpers for deterministic artifact caching.

nkdsl.compiler.diagnostics

Compiler diagnostics models, rule runners, and formatting helpers.

nkdsl.compiler.diagnostics.collector

Diagnostics collection and filtering orchestration.

nkdsl.compiler.diagnostics.formatting

Formatting helpers for DSL diagnostics.

nkdsl.compiler.diagnostics.models

Typed diagnostic models and severity helpers for DSL linting.

nkdsl.compiler.diagnostics.state_sampling

Hilbert-space sampling and validity helpers for diagnostics.

nkdsl.compiler.diagnostics.traversals

IR traversal helpers used by diagnostic rules.

nkdsl.compiler.diagnostics.rules

Rule registry for DSL diagnostics.

nkdsl.compiler.diagnostics.rules.base

Base abstractions for diagnostics rules.

nkdsl.compiler.diagnostics.rules.connectivity_rules

Connectivity diagnostics rules based on lowered term-runner execution.

nkdsl.compiler.diagnostics.rules.structural_rules

Structural diagnostics rules for symbolic operator terms.

nkdsl.compiler.diagnostics.rules.symbol_rules

Symbol and index-bound diagnostics rules.

nkdsl.compiler.lowering.base

Abstract base class for symbolic operator lowerers.

nkdsl.compiler.lowering.registry

Registry for symbolic compiler lowerers.

nkdsl.compiler.lowering.jax_lowerer

JAX backend symbolic operator lowerer.

nkdsl.compiler.passes.base

Abstract base class for symbolic compiler passes.

nkdsl.compiler.passes.diagnostics

DSL lint/diagnostics compiler pass.

nkdsl.compiler.passes.validation

Symbolic IR validation compiler pass.

nkdsl.compiler.passes.normalization

Symbolic IR normalization compiler pass.

nkdsl.compiler.passes.analysis

Symbolic max-connection-size analysis compiler pass.

nkdsl.compiler.passes.fusion

Symbolic term-fusion planning compiler pass.

nkdsl.ir

Symbolic operator intermediate representation (IR).

nkdsl.ir.expressions

Typed amplitude-expression IR nodes for symbolic operators.

nkdsl.ir.predicates

Typed predicate-expression IR nodes for symbolic operators.

nkdsl.ir.update

Typed site-update IR nodes for symbolic operators.

nkdsl.ir.term

Typed declarative symbolic operator-term IR structures.

nkdsl.ir.program

Top-level symbolic operator IR container.

nkdsl.ir.validate

Structural and semantic validation for symbolic operator IR.

nkdsl.errors

Custom exception types for nkdsl.

nkdsl.errors.exceptions

Custom exception hierarchy for nkdsl.

nkdsl.configs

Configuration management for nkDSL.