Skip to main content
Language v0.2.0 · Preview

N/M user guide for VS Code

Install the N/M extension, test your first program, step through the debugger and resolve common problems.

Install the extension

In VS Code Extensions, search for N/M Quantum Language. Check the publisher QuantumSoftware and extension ID quantumsoftware.nm-quantum-language. Use the regular Install button.

Desktop VS Code 1.96 or later is required. The language server and debugger are bundled; no separate Node.js installation is needed. Browser-only VS Code and virtual workspaces are unsupported.

Open Marketplace ↗

Your first program and test

Open a project folder you trust. Open the Command Palette with Ctrl+Shift+P (macOS: Cmd+Shift+P), run N/M: Create Quantum Example and save the file as hello.nm. This is the program generated by the extension.

hello.nm

module hello_quantum;fn main() {  test "balanced qubit" {    let q = qreg[1];    H(q[0]);    assert probability(|0>) > 0.45;    assert probability(|1>) > 0.45;  }  return 0;}

Run N/M: Run Current File Tests to execute balanced qubit. The H gate makes both outcome probabilities 0.5, so both assertions should pass. Tests run in separate processes and can be cancelled.

Debug step by step

Save this circuit as debug.nm and set a breakpoint on its H line. Select the N/M configuration in Run and Debug, or create this .vscode/launch.json and press F5 with debug.nm open.

debug.nm

module debug_bell;fn main() {  let q = qreg[2];  H(q[0]);  CNOT(q[0], q[1]);  return q;}

.vscode/launch.json

{  "version": "0.2.0",  "configurations": [    {      "type": "nm",      "request": "launch",      "name": "N/M",      "program": "${file}",      "stopOnEntry": true    }  ]}

F11 steps into calls, F10 steps over them and Shift+F11 steps out. Variables and the call stack show recorded values. Restart rewinds the same recording; stop and start a new recording after editing the program or its settings.

The debugger records a local simulator execution once. Stepping does not repeat measurements or connect to physical quantum hardware.

Language features and settings

New installations enable these six features. Previously saved false choices remain off. Other nm.experimental.* settings are off by default. Search for N/M in VS Code Settings to change them.

  • nm.experimental.classicalFunctions
  • nm.experimental.typedClassicalValues
  • nm.experimental.functionResults
  • nm.experimental.moduleVisibility
  • nm.experimental.parameterGroups
  • nm.experimental.computeApply

Use N/M: Show Capability Status to check maturity and limits. The regular installation channel does not make every feature stable.

If something goes wrong

The server does not start

Run N/M: Restart Language Server and read Output → N/M Language. A custom nm.languageServer.path must be an existing absolute file path; remove the override to use the bundled server.

Tests or debugging do not run

Save the file with a .nm extension, check that the N/M language is selected and that you trust the project folder. The extension does not execute code in Restricted Mode.

A language feature is rejected

Check its N/M setting. Saved false choices are not enabled by updates. Look up the reported error code in the diagnostics guide.

No release version is available

Select the current regular release. If a pre-release is installed, use Switch to Release Version.

In the contact form, include your VS Code and extension versions, operating system, error code and a small reproducible example. Do not send API keys or private project files.

Report a problem →

Free to use

Personal, educational and commercial use is free. QuantumSoftware retains code and asset rights; modifying or redistributing its source requires separate permission. Your own N/M programs and results remain yours.

Read the distribution license ↗