Start with a project you can check
N/M 0.6.0 brings complete project templates, workspace auto-import and three numerical improvements into the same toolchain. This guide starts with a Bell workspace, then runs a small numerical program whose answer you can check independently. Everything here runs locally.
The package release is 0.6.0; the N/M language contract remains 0.2.0 Preview. Publishing a package does not promote every experimental capability to stable. The distribution record checked on 27 October 2026 separates the channels:
| Component | Verified release and use |
|---|---|
| Core, CLI, Language Server and MCP on npm | 0.6.0 on latest; pin @0.6.0 for this guide |
| VS Code extension on Open VSX | 0.6.0 on the regular release channel |
| VS Code extension on Marketplace | Regular 0.6.0; the public download matches the verified VSIX archive |
| Python/Jupyter adapter | Included with the CLI package; no separate PyPI publication |
See the release record for the component histories. Free personal, educational and commercial use follows the license included in each installed package; modification and redistribution of package code require separate permission.
Create, run and test a Bell workspace
Install Node.js 20 or newer, then run these commands from a directory where bell-project does not exist, or is an empty real directory:
npm install --global @nm-lang/cli@0.6.0
nm --version --json
nm init bell-project --template bell --name bell-project --locale en
cd bell-project
nm check src/main.nm
nm run src/main.nm --json
nm test tests/main.test.nm --jsonCheck the version report before continuing. The generator creates src/main.nm, shared src/helper.nm, tests/main.test.nm, nm-workspace.json and an English README.md. Use --locale tr for a Turkish README; the program is shared across both languages. Creating the files does not execute them.
The main program imports workspace.project_helper, prepares a Bell pair and samples 256 measurements with seed 7. Its ideal computational-basis probabilities are one half for 00 and one half for 11. Sample counts can vary from a 128/128 split; the generated test checks the underlying probabilities before measurement. That test passing establishes the stated local circuit behavior, not a hardware experiment or an entanglement certification from a single histogram.
Read the manifest and helper alongside the entry file. The manifest indexes both src and tests; carrying only src/main.nm elsewhere loses its dependency. To explore another template, run nm init from the parent directory with a different destination and --template parametric-training or --template numerics. The generated README supplies that template's commands and any required flags. The generator preserves occupied directories rather than overwriting existing projects.
Follow the same workflow in VS Code
With extension 0.6.0 installed from its verified channel, open the Command Palette and run N/M: Create Project. Choose the template, a parent folder and then the project name. A name such as bell-project creates that child folder inside the selected parent; the child destination must be new or empty. README language follows the editor interface language. Open the generated folder and follow its README steps; the extension guide describes the editor commands. Its terminal commands use the separately installed CLI; the bundled language server does not add nm to your terminal.
For larger workspaces, completion can offer public functions, records and enums from another workspace module and insert the required use workspace.… statement. Private symbols are excluded; alias, visibility and cycle checks still apply. Open-buffer suggestions remain available while disk indexing is pending. Auto-import changes source, so inspect the inserted import after accepting it. It does not enable a disabled language feature or replace workspace trust.
Follow the public helper example to add src/math.nm and src/import-demo.nm to the generated project. The following check makes its classical-function, typed-value and public-visibility permissions explicit. A fresh CLI 0.6.0 enables these defaults already; saved or supplied false settings remain separate choices and auto-import does not change them:
nm check src/import-demo.nm --experimental-classical-functions --experimental-typed-classical-values --experimental-module-visibilityCheck a numerical result independently
Save this standalone program as numerics.nm. It uses a diagonal linear system and a small least-squares fit, so the expected answers are easy to derive:
module blog_numerics;
fn main() {
let q = qreg[1];
let a: Matrix<Float, 2, 2> = matrix(2, 2, [2.0, 0.0, 0.0, 4.0]);
let b: Array<Float, 2> = [2.0, 8.0];
let solution: Array<Float, 2> = solve(a, b);
let basis: Matrix<Float, 2, 2> = eigvecsh(a);
let design: Matrix<Float, 3, 2> = matrix(3, 2, [1.0, 0.0, 1.0, 1.0, 1.0, 2.0]);
let observations: Array<Float, 3> = [1.0, 2.0, 2.0];
let fit: Array<Float, 2> = lstsq(design, observations);
let answer: Float = solution[0] + fit[1];
return answer;
}Enable both experimental capabilities explicitly for these commands:
nm check numerics.nm --experimental-classical-functions --experimental-typed-classical-values
nm run numerics.nm --json --experimental-classical-functions --experimental-typed-classical-valuessolve gives [1, 2]. The fit minimizes squared residuals for the three points (0,1), (1,2) and (2,2), yielding intercept 7/6 and slope 1/2. Inspect classicalValues in the JSON report: answer is therefore 1.5, within floating-point tolerance. eigvecsh returns column eigenvectors in the same order as eigvalsh; for this diagonal matrix the columns correspond to eigenvalues 2 and 4. An eigenvector's overall sign or complex phase is not unique, nor is the choice of basis inside a degenerate eigenspace.
The 0.6.0 numerical changes have specific bounds:
eigvecshaccepts supported Float or Complex Hermitian matrices. Parameter-dependent analytic eigenvector derivatives are unsupported.- Real
solve(A,b)supports first-order analytic differentiation throughA·dx = db − dA·x, reusing the call's pivoted factorization. This does not add Complex solve derivatives or second derivatives. lstsq(A,b)uses column-pivoted QR for square or tall, full-column-rank Float systems. Wide or rank-deficient systems and parameter-dependent analytic derivatives are unsupported.
Dimensions remain bounded to 1–16 with at most 256 matrix elements, and operations share the existing work budgets. A valid shape does not guarantee that a long sequence of operations fits the budget. The matrix guide covers types, derivatives and diagnostics.
Bring the CLI into a notebook deliberately
For Python, install @nm-lang/cli@0.6.0 locally in the notebook project and follow the Python/Jupyter guide. The standard-library bridge uses Python 3.10+ and a trusted Node.js/CLI command. Optional %%nm cells require the documented IPython environment and an explicit %load_ext nm_jupyter; no global kernel or automatic startup is installed. The local wheel identifies itself as 0.0.0.dev0 and is not a PyPI release. The adapter is not bundled in the VSIX.
Checking source, running it and training are separate explicit operations. The extension's test and recorded-debugger workflows do not start the separate finite-shot training host; follow the CLI training guide for that workflow. Preserve source, package version, experimental settings, seed and shot budgets when comparing results, and retain the original producer metadata on saved artifacts.
Sources and next steps
- Published CLI 0.6.0 on npm: installation and package usage.
- N/M extension on Open VSX: the independently distributed editor extension.
- CLI 0.6.0 guide: project templates and adapter setup.
- Capabilities and RFC archive: distinguish implemented support and its maturity from recorded design proposals.
These examples establish small local simulator and numerical results. They do not demonstrate physical QPU access or a general quantum advantage.