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
1module hello_quantum;2fn main() {3 test "balanced qubit" {4 let q = qreg[1];5 H(q[0]);6 assert probability(|0>) > 0.45;7 assert probability(|1>) > 0.45;8 }9 return 0;10}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
1module debug_bell;2fn main() {3 let q = qreg[2];4 H(q[0]);5 CNOT(q[0], q[1]);6 return q;7}.vscode/launch.json
1{2 "version": "0.2.0",3 "configurations": [4 {5 "type": "nm",6 "request": "launch",7 "name": "N/M",8 "program": "${file}",9 "stopOnEntry": true10 }11 ]12}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.classicalFunctionsnm.experimental.typedClassicalValuesnm.experimental.functionResultsnm.experimental.moduleVisibilitynm.experimental.parameterGroupsnm.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 ↗