Skip to main content
Language v0.2.0 · Preview

N/M diagnostic code explorer

Search stable parser, type, semantic, runtime, assertion, workspace, calibration, and compiler diagnostic codes with actionable fixes.

183 diagnostics

NM-PARSE-002

Missing module declaration

The file must start with a module declaration such as module bell_state;

Suggested fix

Add a module name before fn main().

NM-PARSE-003

Missing fn main

The playground executes a single fn main() entry point.

Suggested fix

Add fn main() { ... } around executable statements.

NM-TYPE-002

Invalid qubit reference

A gate or measurement points to a qreg index that was not allocated.

Suggested fix

Keep indexes inside the declared qreg size, for example q[0] and q[1] for QReg<2>.

NM-TYPE-005

QReg size mismatch

The type size and allocation size disagree.

Suggested fix

Use matching syntax such as let q: QReg<2> = qreg[2];

NM-TYPE-006

Invalid rotation angle

Ry/Rz/CRy/CRz/CP received an angle expression that could not be evaluated.

Suggested fix

Use a number, PI, a declared constant, or arithmetic such as Ry(q[0], PI / 2);

NM-SEM-001

Duplicate qubit operand

A multi-qubit gate uses the same physical qubit more than once.

Suggested fix

Use distinct qubits for every operand, for example CNOT(q[0], q[1]) instead of CNOT(q[0], q[0]).

NM-SEM-002

Gate after measurement

A gate touches a qubit after direct measurement collapsed it.

Suggested fix

Use reset before more quantum gates, move the measurement later, or add @semantics("strict"); if this should block execution.

NM-SEM-003

Unused qubit

A qreg allocation contains a qubit that no gate, measurement, expectation, reset, or encode step uses.

Suggested fix

Remove the spare qubit or include it in the intended circuit.

NM-TYPE-008

Assertion state width mismatch

An assert probability state has a different bit width than the register.

Suggested fix

Match the register width, for example assert probability(|00>) for QReg<2>.

NM-TYPE-009

Unknown classical bit

An if conditional guards on a bit that was never produced by a measurement or Bit expression.

Suggested fix

Measure or derive a Bit first: let parity: Bit = a xor b; if (parity == 1) { ... }

NM-PARSE-012

Invalid Bit expression

A classical Bit assignment could not be parsed.

Suggested fix

Use measured bits with not/and/xor/or, for example let parity: Bit = a xor b.

NM-TYPE-010

Duplicate Bit binding

A measurement or classical expression reused an existing Bit name.

Suggested fix

Use a fresh Bit name for every measurement and derived Bit.

NM-TYPE-011

Unknown Bit expression input

A classical Bit expression referenced a bit that has not been produced yet.

Suggested fix

Only reference measured or earlier derived bits.

NM-PARSE-013

Invalid syndrome measurement

A syndrome statement is not a clean Pauli string.

Suggested fix

Use a form such as let s: Bit = syndrome Z(q[0]) Z(q[1]);

NM-TYPE-012

Duplicate syndrome qubit

A syndrome Pauli string referenced the same qubit more than once.

Suggested fix

Use each qubit at most once in a syndrome measurement.

NM-PARSE-014

Unknown adjoint circuit

An adjoint or inverse call references a circuit template that was not defined.

Suggested fix

Define the circuit before calling adjoint qft(q); or inverse qft(q);

NM-TYPE-013

Non-unitary adjoint body

A circuit used with adjoint contains a non-unitary statement such as measurement, reset, assert, or return.

Suggested fix

Keep adjoint circuit templates unitary and move non-unitary operations outside.

NM-TYPE-014

Adjoint argument mismatch

A circuit call or adjoint call received the wrong number of angle arguments.

Suggested fix

Pass the register followed by exactly the circuit's declared Angle arguments.

NM-PARSE-015

Invalid controlled block

A controlled block does not use the supported single-control syntax.

Suggested fix

Use controlled q[0] { X(q[1]); } with one control qubit.

NM-TYPE-015

Unsupported controlled operation

A controlled block contains an operation that cannot be mapped to a supported controlled gate.

Suggested fix

Use X, Y, Z, H, Ry, or Rz inside the controlled block.

NM-TYPE-016

Controlled target is control

A controlled block tries to use the control qubit as a target.

Suggested fix

Use a different target qubit in the controlled block body.

NM-TYPE-017

Nested controlled block

Nested controlled blocks are not supported in the first playground implementation.

Suggested fix

Keep one controlled block level or use explicit controlled gates.

NM-PARSE-016

Unterminated observable block

A Hamiltonian observable block was opened but not closed with };.

Suggested fix

Close the block after the final term, for example observable H = { Z(q[0]), };

NM-PARSE-017

Empty observable block

A Hamiltonian observable block did not contain any Pauli or identity terms.

Suggested fix

Add at least one term such as -1.0 * I or 0.5 * Z(q[0]).

NM-PARSE-018

Unknown std import

A use std.* statement referenced a standard library entry that does not exist.

Suggested fix

Use a registered import such as std.bell, algorithms.grover2, qec.repetition3, chemistry.h2_minimal, or optimization.maxcut2.

NM-PARSE-020

Invalid metric expression

A metric statement was not a supported probability or expectation observation.

Suggested fix

Use metric bell = probability(|00>); or metric energy = expect H;.

NM-PARSE-021

Unterminated observe block

An observe report block was opened but not closed.

Suggested fix

Close the block with } after the final metric, expectation, or assertion.

NM-PARSE-022

Invalid observe syntax

An observe statement did not use the named block form.

Suggested fix

Use observe report_name { metric p00 = probability(|00>); }.

NM-PARSE-043

Invalid test block

A test block did not use the named block form or was not closed.

Suggested fix

Use test "bell behavior" { assert probability(|00>) > 0.45; }.

NM-PARSE-044

Invalid property block

A property/forall block did not use the supported single-range form or contains unsupported declarations.

Suggested fix

Use property "bounded" { forall theta in 0 .. PI step PI / 2 { assert expectation Z(q[0]) <= 1; } }.

NM-PARSE-045

Invalid snapshot block

A snapshot block did not use the named block form or was not closed.

Suggested fix

Use snapshot "bell golden" { H(q[0]); assert probability(|0>) > 0.4; }.

NM-PARSE-046

Invalid show statement

A show statement used an unsupported subject.

Suggested fix

Use show state; to print the current state vector in Dirac notation.

NM-PARSE-047

Invalid estimate annotation

An @estimate annotation could not be parsed.

Suggested fix

Use @estimate(code: "surface", distance: 7, target_error: 1e-3); near the top of the program.

NM-PARSE-048

Invalid language annotation

An @dil annotation requested an unsupported language or malformed syntax.

Suggested fix

Use @dil("tr"); for Turkish keyword aliases or @dil("en"); for canonical N/M.

NM-PARSE-023

Invalid explain annotation

An @explain annotation could not be parsed.

Suggested fix

Use @explain("Describe this step."); before the statement you want to document.

NM-PARSE-024

Invalid goal annotation

A @goal annotation could not be parsed.

Suggested fix

Use @goal("Describe the lab objective."); near the top of the program.

NM-PARSE-029

Invalid outcome annotation

An @outcome annotation could not be parsed.

Suggested fix

Use @outcome("Explain why H creates a balanced state."); near the top of the program.

NM-PARSE-030

Invalid rubric annotation

An @rubric annotation could not be parsed.

Suggested fix

Use @rubric("Explain the probability distribution.", weight: 0.5); near the top of the program.

NM-PARSE-031

Invalid misconception annotation

An @misconception annotation could not be parsed.

Suggested fix

Use @misconception("H is not a random classical coin flip."); near the top of the program.

NM-PARSE-032

Invalid quiz annotation

An @quiz annotation could not be parsed.

Suggested fix

Use @quiz("What are the final probabilities?", answer: "50% for |0> and 50% for |1>."); near the top of the program.

NM-PARSE-033

Invalid lab annotation

An @lab annotation could not be parsed.

Suggested fix

Use @lab("bell-basics", minutes: 10); near the top of the program.

NM-PARSE-041

Invalid challenge annotation

An @challenge annotation could not be parsed.

Suggested fix

Use @challenge("bell-from-scratch", difficulty: "beginner"); near the top of the program.

NM-PARSE-034

Invalid dataset annotation

An @dataset annotation could not be parsed.

Suggested fix

Use @dataset("bell-balanced", split: "train"); near the top of the program.

NM-PARSE-035

Invalid checkpoint annotation

An @checkpoint annotation could not be parsed.

Suggested fix

Use @checkpoint("Predict before running.", kind: "predict"); near the top of the program.

NM-PARSE-025

Invalid hint annotation

A @hint annotation could not be parsed.

Suggested fix

Use @hint("Try changing the rotation angle."); near the top of the program.

NM-PARSE-026

Invalid concept annotation

A @concept annotation could not be parsed.

Suggested fix

Use @concept("superposition"); near the top of the program.

NM-PARSE-027

Invalid level annotation

A @level annotation could not be parsed.

Suggested fix

Use @level("beginner");, @level("intermediate");, or @level("advanced"); near the top of the program.

NM-PARSE-028

Invalid prereq annotation

A @prereq annotation could not be parsed.

Suggested fix

Use @prereq("basic-gates"); near the top of the program.

NM-TYPE-018

Std circuit name collision

An imported standard circuit and a user circuit exported the same name.

Suggested fix

Rename the user circuit or choose a std import with a different exported circuit name.

NM-TYPE-019

Std observable name collision

An imported standard observable and a user observable exported the same name.

Suggested fix

Rename the user observable or choose a standard-library Hamiltonian with a different exported name.

NM-TYPE-020

Std helper qubit requirement

A standard-library circuit helper was called with a register smaller than its minQubits metadata.

Suggested fix

Allocate a larger qreg or choose a helper with a smaller minQubits requirement.

NM-TYPE-021

Unsupported observe statement

An observe block contains a state-changing or unsupported statement.

Suggested fix

Keep observe blocks to metric, expect, assert probability, assert expectation, assert entangled, and assert equivalent statements.

NM-TYPE-022

Std observable qubit requirement

A standard-library observable was used with a register smaller than its minQubits metadata.

Suggested fix

Allocate a larger qreg before using the imported Hamiltonian observable.

NM-PARSE-042

Invalid until block

An until retry block did not use the bounded classical-bit guard form.

Suggested fix

Use until (flag == 1) max 10 { ... } with max between 1 and 32.

NM-PARSE-006

Unsupported conditional

The if statement is not a simple classical-bit guard.

Suggested fix

Use the form if (m == 1) { X(q[1]); } with == or != on a measured bit.

NM-PARSE-007

Invalid constant expression

A const value could not be parsed as a numeric/PI expression.

Suggested fix

Use numbers, PI, earlier constants and + - * /, e.g. const theta: Angle = PI / 4;

NM-RUNTIME-001

Unsupported gate

The operation is not part of the current browser runtime gate set.

Suggested fix

Use H, X, Y, Z, S, T, CNOT, CZ, SWAP, CCNOT, Ry, Rz, CRy, CRz, CP, or mark the example as spec preview.

NM-RUNTIME-005

Unsupported noise model

An @noise annotation requested a model the runtime does not implement.

Suggested fix

Use @noise("depolarizing", p), @noise("pauli", p), @noise("readout", p), @noise("amplitude_damping", p), or @noise("phase_damping", p) with p between 0 and 1.

NM-RUNTIME-002

Too many qubits

The browser simulator protects performance with a small qubit limit.

Suggested fix

Keep playground examples at 5 qubits or fewer.

NM-RUNTIME-003

Spec-preview syntax

The code uses future N/M syntax that is documented but not executable here.

Suggested fix

Use the supported runtime subset or keep the example as documentation preview.

NM-RUNTIME-004

Repeat capped

A repeat block exceeded the playground expansion limit.

Suggested fix

Use repeat counts of 32 or fewer in browser examples.

NM-RUNTIME-009

Unknown target profile

An @target annotation references a profile the analyzer does not know.

Suggested fix

Use @target("browser-statevector"), @target("ion-trap"), @target("superconducting"), or @target("neutral-atom").

NM-RUNTIME-010

Non-native target gate

A gate is supported by the playground but not native for the selected hardware profile.

Suggested fix

Treat this as a capability warning; future compiler passes may decompose non-native gates.

NM-RUNTIME-011

Target depth recommendation

The estimated circuit depth exceeds the selected target profile recommendation.

Suggested fix

Reduce repeat counts, simplify the ansatz, or split the algorithm into shallower stages.

NM-RUNTIME-012

Two-qubit gate budget

The circuit uses more two-qubit gates than the selected target profile recommends.

Suggested fix

Reduce entangling gates where possible; they usually dominate hardware error.

NM-RUNTIME-013

Connectivity warning

A line-connectivity target detected a non-adjacent two-qubit operation.

Suggested fix

Read the SWAP routing sketch in the diagnostic hint, then decide whether to route, remap, or choose an all-to-all profile.

NM-RUNTIME-014

Target qubit recommendation

The program uses more qubits than the selected target profile recommends.

Suggested fix

Reduce register size or choose a target profile with a larger educational qubit budget.

NM-RUNTIME-015

Invalid constraints annotation

A @constraints annotation could not be parsed.

Suggested fix

Use @constraints(maxDepth: 8, maxTwoQubit: 4, connectivity: "line").

NM-RUNTIME-016

Constraint qubit budget

The circuit exceeds its declared @constraints qubit budget.

Suggested fix

Reduce register size or relax maxQubits for this experiment.

NM-RUNTIME-017

Constraint depth budget

The circuit exceeds its declared @constraints depth budget.

Suggested fix

Shorten sequential gate chains, split the circuit, or raise maxDepth.

NM-RUNTIME-018

Constraint two-qubit budget

The circuit exceeds its declared @constraints two-qubit gate budget.

Suggested fix

Reduce entangling operations or decompose the algorithm into a smaller budget.

NM-RUNTIME-019

Constraint connectivity

A line-connectivity constraint detected a non-adjacent two-qubit operation.

Suggested fix

Read the SWAP routing sketch in the diagnostic hint, then decide whether to route, remap, or relax the connectivity constraint.

NM-RUNTIME-020

Invalid compiler annotation

An @compiler annotation could not be parsed.

Suggested fix

Use @compiler(trace: true) to show compiler steps in the Trace tab.

NM-RUNTIME-028

Invalid mitigation annotation

An @mitigation annotation could not be parsed or requested an unsupported model.

Suggested fix

Use @mitigation("readout") for readout noise or @mitigation("zne") for zero-noise extrapolation with a sample block.

NM-RUNTIME-029

Stabilizer runtime selected

The browser-stabilizer target accepted the bounded Clifford program.

Suggested fix

No action is required; this informational diagnostic confirms tableau execution.

NM-RUNTIME-030

Stabilizer fallback required

The requested program contains a gate or statement outside the stabilizer-native contract.

Suggested fix

Remove the unsupported feature or use browser-statevector with at most five qubits.

NM-RUNTIME-031

Sample shots capped

A sample block exceeded the bounded local shot budget.

Suggested fix

Use 4,096 shots or fewer for local statevector and stabilizer execution.

NM-COLLECT-001

Typed collection disabled

collect<K> was used without explicit NM-RFC-0012 negotiation.

Suggested fix

Enable experimental.typedCollection or pass --experimental-typed-collection.

NM-COLLECT-002

Duplicate typed collection

A program declared more than one collect<K> block.

Suggested fix

Use one bounded collection artifact per program.

NM-COLLECT-003

Typed collection budget

The compile-time K is outside the 1..4,096 result budget.

Suggested fix

Reduce K; it is never silently capped because K is part of the result type.

NM-COLLECT-004

Collection mode conflict

sample and collect were combined in one program.

Suggested fix

Choose a histogram with sample or an ordered artifact with collect<K>.

NM-COLLECT-005

Invalid collection result

The collection body does not end in exactly one resolved measure_all binding.

Suggested fix

End with one let result: BitVec<N> = measure_all(q[start..end]); binding.

NM-COLLECT-006

Collection seed required

The ordered typed result has no explicit deterministic seed.

Suggested fix

Add @seed(<unsigned integer>); before fn main.

NM-COLLECT-007

Unsupported collection runtime

Typed collection 0.1 was combined with noise or mitigation.

Suggested fix

Remove @noise/@mitigation or use sample for an aggregate noisy histogram.

NM-STABILIZER-001

Stabilizer limit violation

A low-level tableau request is outside the 1–100 qubit contract.

Suggested fix

Create a tableau with an integer qubit count from 1 through 100.

NM-STABILIZER-002

Invalid stabilizer qubit

A stabilizer operation references an unresolved or out-of-range qubit.

Suggested fix

Resolve every target to an index inside the allocated tableau.

NM-STABILIZER-003

Unsupported stabilizer gate

A low-level gate request is outside the frozen Clifford/global-phase set.

Suggested fix

Use the documented native gate set or route the program to statevector execution.

NM-STABILIZER-004

Invalid stabilizer shot budget

A low-level histogram request is outside the 1–4,096 shot contract.

Suggested fix

Request an integer number of shots from 1 through 4,096.

NM-LOWERING-001

Missing or unknown lowering target

Target-native lowering requires a published target profile.

Suggested fix

Pass --target with one of the target ids published by the N/M spec catalog.

NM-LOWERING-002

Invalid lowering source

Parser or semantic errors prevent target-native lowering.

Suggested fix

Run nm check and resolve blocking diagnostics before transpiling.

NM-LOWERING-003

Unsupported target lowering

No complete target-native decomposition exists for a remaining gate.

Suggested fix

Choose another target, remove the gate, or wait for an additive lowering rule.

NM-LOWERING-004

Lowering verification failed

The lowered circuit changed the statevector beyond the frozen tolerance.

Suggested fix

Treat the output as unusable and inspect the lowering trace; do not execute it as equivalent code.

NM-LOWERING-005

Non-native output invariant

A lowering result emitted a non-native gate without declaring it unsupported.

Suggested fix

Treat the result as failed and report the target, gate, and trace as a compiler defect.

NM-CAL-001

Invalid calibration id

The calibration id is empty or outside the frozen length contract.

Suggested fix

Provide a non-empty id of at most 128 characters.

NM-CAL-002

Invalid physical qubit

A physical qubit id is negative, non-integer, or duplicated.

Suggested fix

Use unique non-negative integer physical qubit ids.

NM-CAL-003

Invalid calibration value

A timestamp, error rate, duration, target, or typed field is malformed.

Suggested fix

Use canonical UTC timestamps, error rates in [0,1], positive durations, and the documented field types.

NM-CAL-004

Insufficient calibration capacity

The calibration exposes fewer enabled physical qubits than the logical program requires.

Suggested fix

Enable enough physical qubits or reduce the logical register.

NM-CAL-005

Invalid coupling graph

A coupling is duplicated, self-referential, or references an unknown physical qubit.

Suggested fix

Declare each undirected edge once between two distinct declared qubits.

NM-CAL-006

Disconnected placement graph

No enabled connected component can hold the complete logical register.

Suggested fix

Provide a connected physical subset large enough for the workload or choose an all-to-all target.

NM-CAL-007

Calibration input limit

The JSON, id, logical count, qubit list, or coupling list exceeds the 0.1 bounds.

Suggested fix

Stay within 512 KiB JSON, 128 id characters, 256 qubits, and 4,096 couplings.

NM-SCHEDULE-001

Invalid schedule placement

A gate has no unique logical-to-physical placement.

Suggested fix

Provide every logical qubit exactly once and use distinct non-negative physical ids.

NM-SCHEDULE-002

Invalid schedule duration

An operation duration is not a positive safe-integer nanosecond value.

Suggested fix

Declare every gate and coupling duration as a positive integer within JavaScript's safe integer range.

NM-SCHEDULE-003

Schedule dependency violation

An operation does not start at the deterministic ASAP boundary of its physical resources.

Suggested fix

Start the operation at the maximum prior end time of all physical qubits it uses.

NM-SCHEDULE-004

Schedule limit violation

The operation count or accumulated nanosecond timeline exceeds the frozen safe boundary.

Suggested fix

Use at most 100,000 operations and keep all accumulated times within the safe integer range.

NM-SCHEDULE-005

Schedule invariant violation

Operation ids, source order, placement, time arithmetic, or total duration drifted.

Suggested fix

Reject the schedule and regenerate it with the checked target scheduling API.

NM-QASM3-EXPORT-001

Invalid QASM3 export source

Parser or semantic diagnostics prevent OpenQASM 3 export.

Suggested fix

Run nm check and resolve blocking source diagnostics before export.

NM-QASM3-EXPORT-002

Missing trained parameters

A train block cannot be exported without completed final parameter values.

Suggested fix

Complete training or provide final trained parameters before QASM3 export.

NM-QASM3-EXPORT-003

Empty QASM3 carrier

The source allocates no qubits to export.

Suggested fix

Declare a non-empty qreg before exporting.

NM-QASM3-EXPORT-004

Strict QASM3 lowering failed

An operation could not be lowered into the frozen stdgates target.

Suggested fix

Remove the unsupported operation or use preview mode with an explicit extension boundary.

NM-QASM3-EXPORT-005

QASM3 export invariant failed

The lowered carrier no longer satisfies the parser/export invariant.

Suggested fix

Reject the carrier and report the source and lowering trace as a compiler defect.

NM-QASM3-SIDECAR-PARSE-001

Malformed QASM3 sidecar JSON

The sidecar JSON cannot be parsed.

Suggested fix

Provide valid UTF-8 JSON produced by the versioned exporter.

NM-QASM3-SIDECAR-TYPE-001

Invalid QASM3 sidecar type

A required sidecar or embedded IR value has the wrong type.

Suggested fix

Validate the sidecar against the documented 0.1, 0.2, or 0.3 reader contract.

NM-QASM3-SIDECAR-FORMAT-001

Invalid QASM3 sidecar format

The sidecar format, carrier, or embedded IR identity is invalid.

Suggested fix

Use nm-qasm3-sidecar@0.3 with nm-json-ir@0.1; legacy 0.1 and 0.2 remain readable.

NM-QASM3-SIDECAR-VERSION-001

Unsupported QASM3 sidecar version

No permanent reader or lossless migration exists for this version.

Suggested fix

Use sidecar version 0.1, 0.2, or 0.3, or publish an explicit lossless migrator first.

NM-QASM3-SIDECAR-UNKNOWN-001

Unknown QASM3 sidecar extension

The sidecar contains an unknown field or IR statement kind.

Suggested fix

Remove unknown extensions or introduce them in a new versioned contract.

NM-QASM3-SIDECAR-LIMIT-001

QASM3 sidecar limit

The JSON or recursive IR statement count exceeds the bounded reader contract.

Suggested fix

Stay within 40 MiB JSON and 100,000 IR statements.

NM-QASM3-SIDECAR-INTEGRITY-001

QASM3 sidecar projection mismatch

Module or native-statement projections differ from the embedded IR.

Suggested fix

Reject the sidecar and regenerate all projections from one canonical IR.

NM-QML-101

Train block has no parameters

A train block requires at least one trainable param declaration.

Suggested fix

Declare param theta: Angle = 0.1; before the circuit uses it.

NM-QML-102

Unknown training objective

The objective target is not a bound expectation in the same main body.

Suggested fix

Bind a cost first with let cost = expect Z(q[0]); and target cost.

NM-QML-103

Duplicate train block

A program may contain only one train block in fn main.

Suggested fix

Merge all directives into one train block.

NM-QML-104

Invalid train directive

A train directive, optimizer, step count, or learning rate is outside the supported contract.

Suggested fix

Use 1..100 steps and an lr in (0, 5] with gd, momentum, or adam.

NM-QML-105

Training combination not supported

The parser recognized a reserved training feature whose runtime work package is not enabled yet.

Suggested fix

Remove dataset or qng until its advertised capability is enabled.

NM-QML-106

Unknown training dataset

The train block names an id outside the embedded dataset registry.

Suggested fix

Choose an id from the versioned embedded dataset catalog.

NM-QML-107

Dataset training has no encoding

Supervised train blocks require an encode statement that consumes each row.

Suggested fix

Add encode(sample_row(), q, method: "angle"); before the objective.

NM-QML-TRAIN-001

Invalid training input

The direct training API received an unsupported optimizer, objective, gradient method, or step budget.

Suggested fix

Use a supported method and an integer step count from 1 through 100.

NM-QML-TRAIN-002

Invalid training learning rate

The learning rate is non-finite, non-positive, or above the frozen limit.

Suggested fix

Use a finite learningRate in (0, 5].

NM-QML-TRAIN-003

Invalid training objective

The objective binding is not a bounded identifier.

Suggested fix

Use the name of an expectation binding, up to 128 identifier characters.

NM-QML-TRAIN-004

Training cost failed

The objective is missing, execution failed, or the cost is non-finite.

Suggested fix

Bind a finite expectation cost and resolve runtime diagnostics.

NM-QML-TRAIN-005

Training gradient failed

Gradient evaluation failed or produced a non-finite value.

Suggested fix

Use a supported differentiable circuit and finite parameter values.

NM-QML-TRAIN-006

Training numeric invariant failed

A parameter or optimizer update became non-finite.

Suggested fix

Reject the run and reduce the learning rate or correct invalid numeric inputs.

NM-QML-LOSS-001

Unknown QML loss

The checked loss API received an unsupported loss kind.

Suggested fix

Use mse, hinge, or cross_entropy.

NM-QML-LOSS-002

Invalid QML loss input

Prediction is outside [-1, 1] or the binary label is not exactly -1 or 1.

Suggested fix

Provide a finite expectation prediction and a normalized binary label.

NM-QML-LOSS-003

QML loss invariant failed

Loss or analytic gradient evaluation produced a non-finite result.

Suggested fix

Reject the result and report the bounded input as a numerical defect.

NM-QML-SPSA-001

Invalid SPSA workload

Parameter values, step index, total steps, or descent direction violate the bounded contract.

Suggested fix

Use 1..8 finite parameters, 1..100 steps, and descentSign -1 or 1.

NM-QML-SPSA-002

Invalid SPSA gain option

A gain schedule option is non-finite or outside its supported interval.

Suggested fix

Use a/c > 0, alpha/gamma in (0, 1], and stability >= 0.

NM-QML-SPSA-003

Invalid SPSA random source

The random source threw or returned a value outside [0, 1).

Suggested fix

Use a deterministic seeded source returning finite samples in [0, 1).

NM-QML-SPSA-004

SPSA objective evaluation failed

A perturbed objective threw, was missing, or returned a non-finite cost.

Suggested fix

Ensure both perturbed candidates return finite costs.

NM-QML-SPSA-005

SPSA numeric invariant failed

The gain, perturbation, midpoint, scale, or parameter update became non-finite.

Suggested fix

Reject the update and correct the numeric workload or gain schedule.

NM-QML-ADJOINT-001

Invalid adjoint input

Parameter values or objective binding violate the bounded direct API contract.

Suggested fix

Use at most eight finite known parameters and a bounded objective identifier.

NM-QML-ADJOINT-002

Unsupported adjoint program

The program includes a statement or parameterized gate outside the adjoint subset.

Suggested fix

Use the documented noiseless unitary subset or fall back to parameter-shift.

NM-QML-ADJOINT-003

Adjoint numeric invariant failed

A forward, observable, reverse, or gradient value became non-finite.

Suggested fix

Reject the result and report the circuit as a numerical defect.

NM-QML-DATASET-001

Invalid embedded dataset identity

The embedded dataset format, version, or id is outside contract 0.1.

Suggested fix

Use a registered nm-embedded-dataset@0.1 id.

NM-QML-DATASET-002

Invalid embedded dataset shape

Rows, features, labels, or evaluation values violate the bounded numeric schema.

Suggested fix

Use 1..8 aligned finite features, -1/+1 labels, and no more than 80 rows.

NM-QML-DATASET-003

Invalid embedded dataset split

Train, validation, and test indices are empty, overlapping, out of range, or incomplete.

Suggested fix

Publish non-empty disjoint splits that cover each row exactly once and retain both labels in train.

NM-QML-DATASET-004

Malformed embedded dataset JSON

The dataset JSON cannot be parsed.

Suggested fix

Provide valid UTF-8 JSON produced by the versioned serializer.

NM-QML-DATASET-005

Unknown embedded dataset field

The dataset or one of its rows/splits contains an unknown property.

Suggested fix

Remove unknown fields or publish a new versioned contract first.

NM-QML-DATASET-006

Embedded dataset limit

The JSON byte size, row count, or another bounded collection exceeds contract 0.1.

Suggested fix

Stay within 256 KiB JSON, 80 rows, and eight features.

NM-QML-DATASET-007

Unsupported embedded dataset version

No permanent reader or explicit lossless migration exists for this version.

Suggested fix

Use version 0.1 or publish and test a lossless migrator.

NM-QML-201

Amplitude encoding is not first

Amplitude encoding must initialize its register before gates or another encoding use it.

Suggested fix

Move encode(... method: "amplitude") before every operation on that register.

NM-QML-202

Encoding feature overflow

The dataset row has more features than the selected amplitude capacity or IQP register size.

Suggested fix

Use a larger register or reduce the feature vector.

NM-QML-203

Zero amplitude vector

An all-zero feature vector cannot be L2-normalized for amplitude encoding.

Suggested fix

Provide at least one non-zero feature.

NM-QML-204

Invalid feature encoding input

The state, qubit indices, method, or feature vector violates the bounded finite-input contract.

Suggested fix

Use a normalized finite 1–8 qubit state, unique in-range indices, and 1–8 finite features.

NM-QML-205

Feature encoding invariant failed

The encoding operation produced a non-finite state amplitude.

Suggested fix

Reject the result and report the bounded input as a numerical defect.

NM-QML-301

Barren plateau risk

A wide, deep parameterized ansatz may have vanishing gradient variance.

Suggested fix

Use fewer layers, layer-wise training, or identity-block initialization.

NM-QML-401

Quantum kernel guardrail

Quantum kernels require 1..32 finite labeled rows, 1..5 integer qubits, angle/IQP encoding, and a finite positive ridge/model/query contract.

Suggested fix

Validate row features and -1/+1 labels, qubit/encoding options, ridge, model identity, and query values before kernel work.

NM-QML-402

QAOA graph guardrail

QAOA requires a bounded unique weighted graph, 1..3 layers, 1..100 steps, a valid seed, and GD or SPSA.

Suggested fix

Remove invalid or duplicate edges and use finite bounded weights, layers, steps, optimizer, and seed values.

NM-PARSE-062

Typed classical values are not negotiated

Int, Float, or bounded Array declarations were used while the NM-RFC-0005 feature remained disabled.

Suggested fix

Enable experimental.typedClassicalValues explicitly on the active Core, CLI, LSP, VS Code, Worker, or Playground surface.

NM-PARSE-063

Invalid typed classical declaration

A typed declaration, helper expression, or fixed array bound could not be parsed.

Suggested fix

Use let n: Int = 1; or let bits: Array<Bit, 2> = [a, b]; within the published bounds.

NM-TYPE-023

Typed classical type mismatch

The declared Int, Float, or array type differs from the expression type.

Suggested fix

Use explicit bit_to_int or int_to_float conversion and keep array element types uniform.

NM-TYPE-024

Invalid classical reference or bound

A declaration references an unavailable value, duplicates a binding, or indexes outside a fixed array.

Suggested fix

Reference an earlier value once and keep literal indexes inside 0..N-1.

NM-RUNTIME-032

Typed classical runtime contract failed

Evaluation produced division by zero, a non-finite or unsafe number, a missing value, or an invalid bounded array.

Suggested fix

Reject the run and keep every intermediate value finite, initialized, and inside its declared type bound.

NM-PARSE-064

Target capabilities are not negotiated

@target_capabilities was used while NM-RFC-0006 remained disabled.

Suggested fix

Enable experimental.targetCapabilityConstraints explicitly on the active Core, CLI, LSP, VS Code, Worker, or Playground surface.

NM-PARSE-065

Invalid target capability declaration

The profile, gate_set, connectivity, max_error, field uniqueness, or source bound is invalid.

Suggested fix

Use one bounded @target_capabilities annotation with a profile and at least one valid constraint.

NM-TARGET-040

Target profile mismatch

The declared capability profile is unknown or differs from the active @target profile.

Suggested fix

Select one registered profile consistently across both annotations.

NM-TARGET-041

Native gate-set mismatch

The program uses an undeclared or non-native source gate.

Suggested fix

Declare every source gate and choose only gates native to the selected profile.

NM-TARGET-042

Connectivity mismatch

The requested topology does not exactly match the selected target profile.

Suggested fix

Use the profile connectivity exactly; topology subsumption is intentionally disabled.

NM-TARGET-043

Reference error budget failed

A bounded reference error is unavailable or exceeds max_error.

Suggested fix

Choose a profile with a published reference model or increase the bounded error budget.

NM-PARSE-066

Function results are not negotiated

A typed main result signature was used while NM-RFC-0007 remained disabled.

Suggested fix

Enable experimental.functionResults explicitly on the active Core, CLI, LSP, VS Code, Worker, or Playground surface.

NM-PARSE-067

Invalid function result declaration

The Result<T, Error> signature, typed return, result type, or symbolic error code is malformed or out of bounds.

Suggested fix

Use one final return ok(value); or return error("UPPER_SNAKE_CODE"); matching a bounded declared T.

NM-TYPE-025

Function result type mismatch

The ok(...) expression does not exactly match the T declared by Result<T, Error>.

Suggested fix

Return the declared scalar or fixed array type and use explicit conversions instead of implicit coercion.

NM-TYPE-026

Invalid function result control flow

A typed main return is missing, duplicated, non-final, or nested in unsupported control flow.

Suggested fix

Compute the result first and end main with exactly one top-level ok(...) or error(...) return.

NM-RUNTIME-033

Function result runtime contract failed

A validated typed result expression could not be evaluated or no longer matched its declared type.

Suggested fix

Reject the engine execution without fabricating a user-program error result, then correct the referenced runtime value.

NM-NOISE-PROFILE-001

Composed noise is not negotiated

A noise profile declaration or activation was used while NM-RFC-0017 remained disabled.

Suggested fix

Enable experimental.composedNoise explicitly on the active Core, CLI, LSP, VS Code, Worker, or Playground surface.

NM-NOISE-PROFILE-002

Invalid noise profile declaration

The profile name, activation, block shape, or declaration count is outside the closed grammar.

Suggested fix

Declare one through four uniquely named profiles and activate exactly one declared name.

NM-NOISE-PROFILE-003

Invalid composed-noise channel

A channel placement, gate, model, probability, Pauli word, or statement shape is unsupported.

Suggested fix

Use one published local, correlated_pauli, or readout channel with a literal probability in 0..0.25.

NM-NOISE-PROFILE-004

Composed-noise budget exceeded

The source exceeds the profile, channel, qubit, shot, or probability bound.

Suggested fix

Stay within four profiles, eight channels per profile, five statevector qubits, 4,096 shots, and probability 0.25.

NM-NOISE-PROFILE-005

Invalid composed-noise scope

A register view is unknown, reversed, out of range, empty, or dynamically sized.

Suggested fix

Use an exact compile-time qreg index or contiguous slice from the current program.

NM-NOISE-PROFILE-006

Invalid correlated Pauli channel

The Pauli word is unsupported, all identity, or differs from the resolved scope width.

Suggested fix

Use a 2..5-character I/X/Y/Z word with at least one non-identity character and exact scope width.

NM-NOISE-PROFILE-007

Missing deterministic sampling context

A composed profile lacks an explicit seed, sample block, or supported browser-statevector target.

Suggested fix

Provide @seed, one bounded sample block, and @target("browser-statevector").

NM-NOISE-PROFILE-008

Incompatible noise feature

Composed noise was mixed with stable @noise, @mitigation, QEC experiments, or another incompatible runtime mode.

Suggested fix

Run the composed profile by itself and keep mitigation or QEC experiments in a separate program.

NM-NOISE-PROFILE-009

Unmatched composed-noise channel

A channel gate or measurement scope cannot match any operation in the monomorphized circuit.

Suggested fix

Correct the exact gate and register view or remove the no-op channel.

NM-NOISE-PROFILE-010

Composed-noise integrity or export failure

The resolved carrier is malformed, tampered, or cannot be represented losslessly by the selected exporter.

Suggested fix

Recompile from source and use JSON IR until a versioned target carrier preserves channel scope and ordering.

NM-ASSERT-001

Probability assertion failed

The measured state-vector probability did not satisfy the assertion.

Suggested fix

Place assertions before measurement or adjust the expected threshold.