Write it once.Run it on quantum or classical computers.

Describe an optimization problem as constraints, and run it on anything from your laptop to a quantum computer.

  1. pip install "xquad[quip]"
  2. installedxquad · xqcp · xqsa · xqffi
  3. python portfolio.py
  4. compiledencoder · verifier · decoder
  5. model64 variables · ising
  6. quotedmax 1.002 QUIP · before it runs
  7. submittedjob #4126 · on the Quip Network
  8. solvedenergy −217 · 1.8 s
  9. verifiedvalid · attested

Illustrative session.

Runs on
  • NVIDIA CUDA
  • Apple Metal
  • D-Wave Advantage
  • IBM Quantum
  • IonQ
  • Quip Network
The problem

Every machine needs its own program

Quantum annealers, gate-based quantum computers, and classical solvers each take a different kind of program, so a problem written for one has to be rewritten for the next. The Quip Virtual Machine (QVM) lets you write the problem once and converts it for each machine.

The method

How a job gets solved

You know the most a job can cost before it runs, and the operator running it only gets paid once the answer checks out.

CONSTRAINTSBYTECODEencoderverifierdecoderMODEL · 64 SPINSOPERATOR
price1.002 QUIPquotedpaid
verifiervalid

You write the problem as constraints: which assets to pick, how many to hold, and which combinations carry risk. You don't specify qubits, gates, or the machine that will run it.

The QVM compiles it into three programs of quantum or classical instructions. The encoder builds the model, the verifier checks an answer, and the decoder reads one back out.

Every job is priced in gas, set by how many qubits it needs, how long it runs, and how much entanglement it uses. A job costs a baseline plus an optional tip, and you know the maximum before it runs.

The job runs on quantum computers connected to the Quip Network.

The network cross-checks each answer against a classical simulation, classical providers benchmark it independently, and a cryptographic attestation ties it to the hardware that produced it. Then the operator gets paid, and your decoder turns the answer into a portfolio.

Use cases

Where every choice multiplies the answers

Every stop, shift, asset, or player you add multiplies the possible answers, so no computer can check them all. Quantum computers are built for exactly this kind of optimization, and the QVM lets you run your problem on any of them without rewriting it.

Logistics

Planning the shortest delivery routes

Visit every stop once, in the least total distance.

Operations

Scheduling staff and machines

Cover every shift and job at the lowest cost, around availability, skills, and hours.

Finance

Building and rebalancing portfolios

Pick the mix of assets with the best return for the risk you'll take.

Entertainment

Picking the best fantasy sports lineup

Fill every position for the most points, within your budget.

You'll find runnable code for more example problems on GitHub.

The code

A complete program in one Python file

You don't write any quantum code. You describe the problem in Python, and to run it on a quantum computer instead of your laptop, you only change which solver it uses.

from xquad.cp import Domain, Problem, Typesfrom xquad.vm import VMfrom xquad.sa import SolverDWaveCPUfrom xquad.sa.quip import SolverQuip problem = Problem("portfolio")num_assets = problem.input("num_assets", type=Types.Int)problem.define_model(size=num_assets, domain=Domain.BINARY)# ... returns, risk, and how many assets to hold ...programs = problem.compile()               # encoder, verifier, decoder vm = VM()vm.set_calldata(inputs)                    # your returns, risk, and budgetvm.set_output_slots(1)vm.run(programs.encoder)model = vm.outputs()[0]                    # the compiled model result = SolverDWaveCPU().solve(model)     # your CPU, no networkresult = SolverQuip.for_network("aglais").solve(model)   # the Quip Networkprint(result.sample, result.energy)
What is shipped

What's live, and what's next

XQuad toolchainA constraint language, a compiler, and a VM with two implementations checked against one spec, open source under AGPL-3.0.Live
Local solversCPU simulated annealing, NVIDIA CUDA, Apple Metal, and D-Wave Advantage, all behind one solver interface.Live
Quantum smart contractsDeploy a compiled program to the Quip Network. New users get free compute credits.Testnet
Developer earningsJobs will be priced in QUIP, and a developer who publishes a program will earn each time it runs.Mainnet
Settlement through QuipSwapYou'll be able to pay for jobs through QuipSwap, which keeps the payment quantum-resistant from end to end.Next
Identity on a jobOperators will be able to turn down jobs from requesters who don't have a compliant identity record.In development
Before you start

Common questions

In spirit, it's modeled on the Ethereum Virtual Machine, with one instruction set every program targets, a gas-based cost model, and programs deployed to the network as smart contracts. The EVM runs general computation, while the QVM compiles optimization problems for quantum and classical hardware.

It's a program compiled with XQuad and deployed to the Quip Network. Anyone can request it, it runs on connected quantum computers, and classical machines benchmark and validate the result. On mainnet, a developer who publishes a program will earn each time it runs.

Each job is priced in gas, set by how many qubits it needs, how long it runs, and how much entanglement it uses. You pay a baseline plus an optional tip, see the maximum before it runs, and never face a spend floor or a vendor-specific bill. The Aglais testnet gives new users free compute credits, and on mainnet, jobs will be priced in QUIP.

The network cross-checks every result against a classical simulation, classical providers benchmark it independently, and a cryptographic attestation ties it to the hardware that produced it. The network settles disputes against those recorded benchmarks, so an operator's own word never decides whether its result counts.

No. You write constraints, the compiler produces the instructions, and the solver handles the machine.

D-Wave Advantage, CPU simulated annealing, NVIDIA CUDA, Apple Metal, and the Quip Network testnet. IonQ and IBM Quantum are planned next, and they're expected to run the same programs.

Python 3.13 or newer. Prebuilt wheels cover Linux; on macOS and Windows, pip builds from source, so you also need a Rust toolchain, version 1.85 or newer. GPU, D-Wave, and network support are install extras, and D-Wave needs a Leap account.

Yes. The XQuad toolchain is licensed under AGPL-3.0, hosted on GitHub, and published to PyPI and crates.io. The VM is written to a spec, and a Rust implementation and a Python reference are checked against each other on every change.