Skip to main content
Introducing The Quantum Infrastructure Cloud Learn more

DevelopersHiQ

HiQ documentation

HiQ is the SoftQuantus programming language for quantum computers. You write at the level the work needs, from classes down to pulses, and the checker returns every mistake at its line before anything compiles.

These pages are the reference for the four layers, the codes the checker returns, the API and CLI, and every example program.

What works today

Each step of the path from a program to a machine, and what production answers for it today.

  • CheckLive todayEvery error with a stable code, a line and a column, plus qubits, operations and depth. Nothing compiles.softqcos lang check
  • SynthesizeLive todayTurn one C function into a reversible oracle in HiQ Assembly, or get a refusal that says why.softqcos lang synthesize
  • CompileLive todayLower to one IR with control flow, optimise at level 0 to 3 and compile for hardware profiles. A target that cannot take the program is refused by name.softqcos lang compile
  • PublishLive todayPublish a checked program in your workspace, so any key of the workspace can find it by id. Nothing runs.softqcos lang publish
  • RunNot open yetRun on a Softquantus Cloud simulator, with evidence for each run. Not open in production yet, and no HiQ program reaches quantum hardware.softqcos lang run

Quickstart

Check a first program in four steps. You need Python and an API key from your workspace.

  1. Install the client

    Terminal
    pip install softqcos
  2. Set your API key

    Create a key in your workspace on the Softquantus Research Platform. The CLI reads it from QCOS_API_KEY; a direct HTTP request sends it in the X-API-Key header.

    Terminal
    export QCOS_API_KEY=<your key from platform.softquantus.com>
  3. Write a program

    Save this as bell.qcos. It entangles two qubits and measures both; the two bits always agree.

    bell.qcosqcos/0
    // Bell pair: the two measurements always agree.program bellqubits a, bbits m0, m1​h acx a, bmeasure a -> m0measure b -> m1
  4. Check it

    Terminal
    softqcos lang check bell.qcos

    The command exits with 1 when the program has errors, and each error names its code, line and column. For this file the check answers:

    ok
    true
    declared_qubits
    2
    peak_qubits
    2
    expanded_ops
    4
    depth
    3
    gate_counts
    { "h": 1, "cx": 1 }
    diagnostics
    []

From here, compile the program for a hardware profile with softqcos lang compile, or publish it in your workspace with softqcos lang publish. Neither one runs it. See API and CLI for every route and command.

In your editor

QCOS Studio is the SoftQuantus extension for Visual Studio Code (softquantus.qcos-studio). It opens .qcos3 as HiQ Objects, .qcos2 as HiQ Script, .qcos as HiQ Assembly, and .qcosp as HiQ Pulse. Install it from the Visual Studio Marketplace (opens in a new tab), then run QCOS: Set API Key to check and compile from the editor.

With no key and no network

  • Highlighting, outline, folding and completion that fits where the cursor is
  • Hover, signature help, Go to Definition and Find All References
  • Rename, which refuses with the reason when a change would not be safe
  • Snippets for each layer and the example programs, opened as new files

Through the QCOS API, with a key

  • Problems in the editor: each save sends the source to the checker, unless you turn check on save off
  • The circuit and the control flow of the checked program, drawn beside the source
  • Compile for a target, with the circuit drawn for it and its metrics
  • Estimate Resources, before anything is submitted

The four layers

Each source layer lowers to the one below it, and all of them end as a qcos-ir/2 program. The pulse layer describes the schedule below the gates.

Open source

The language itself is being opened under the Apache-2.0 licence: this reference, a grammar in EBNF for each layer, the tutorials, the example programs, editor grammars for syntax highlighting, and an RFC process for changes to the language.

The checker, the synthesiser, the compiler and the runtime are not part of that release. They stay in QCOS and are reached through the API with a key from your workspace.