MBQuIDE Documentation
Source code: github.com/mnm-team/mbquide
MBQuIDE (Measurement-Based Quantum Interactive Development Environment) is an interactive graphical editor for measurement-based quantum computing (MBQC). It consists of a C++ REST API backend — which exposes the MBQC graph, ZX-calculus, and simulation engine over HTTP — and a React/TypeScript web frontend that renders and interacts with it.
This site is primarily a backend developer reference (architecture, build system, REST/C++ API, examples), with one dedicated page covering the frontend: its tech stack, project layout, and how to use the editor itself.
The backend is built on Crow for HTTP routing, nlohmann/json for request/response serialization, Eigen for linear algebra, and the Boost Graph Library for graph algorithms. It maintains one MBQC graph, ZX-graph, flow, and simulator per browser session, and serves the compiled frontend as static files. The frontend is a Vite + React 19 + TypeScript single-page app that talks to the backend over that REST API.
Getting Started
Frontend
REST API
C++ API
- Graph & Flow
MBQC_GraphMBQC_Graph()MBQC_Graph()addEdge()setMeasurement()setOutputAdjustment()getAllEdges()getNeighbors()oddNeighborhood()getAdjacencyMatrix()getSize()getOutputAdjustments()getOutputAdjustment()getOutputAdjustment()getMeasurement()printGraph()stateHash()clone()isInput()isOutput()getOutputs()getInputs()getNonOutputs()getNonInputs()mvertices()localComplementation()pivot()ZInsertion()ZDeletion()ZDeletion()relabel()relabelPlanar()relabelPlanar()mergeYZ()YZUnfusion()simplify()mergeAllYZNodes()greedyOptimizeEdges()canOptimizeEdges()toJson()exportToPYZXJsonFile()fromJson()importFromPYZXJsonFile()
PauliFlowResultfindPauliFlow()focus()GraphRewriteStepGraphRewriteRuleType
- ZX-Calculus & Conversion
- Quantum Circuits & QASM
- Simulation
SimulatorSimulator()Simulator()getStatevectorBraKet()getStatevectorSimulator()getTensorNetworkSimulator()getBackendType()getCurrentQubitCount()getStoredAmplitudeCount()toJson()tracedOutQubit()isReady()getReadyNodes()isDone()isMeasured()isActive()wasDeactivated()isEdgeActive()activateNode()activateEdge()activateAll()activateAllNecessary()initStatevector()step()writeOutAdjToStatevec()reorderQubitsCanonically()writeAllOutAdjToStatevec()isComplete()simulateAll()runAndGetOutput()getOutcomes()getCorrections()
SimulatorBackendHandleSimulatorBackendTypeStatevectorSimulatorcplxVectorCMatrix2CStatevectorSimulator()StatevectorSimulator()get_statevector()get_num_qubits()reset()getStatevectorBraKet()toJson()setState()setStateSubsystem()add_qubit_plus()reorderQubits()apply_single_qubit_gate()X()Y()Z()S()Sdg()H()CZ()measure()measure_qubit_in_basis()measure_in_basis_vectors()parseBraKet()isEqual()isEqualUpToGlobalPhase()
TensorNetworkSimulatorcplxVectorCMatrix2CMatrix4CMatrixCTensorNetworkSimulator()TensorNetworkSimulator()get_num_qubits()getMaxBondDim()setMaxBondDim()getFidelityEstimate()get_statevector()getBlockStructure()getBlockId()getSingularValueSpectrum()getStoredAmplitudeCount()reset()getStatevectorBraKet()toJson()setState()setStateSubsystem()add_qubit_plus()reorderQubits()apply_single_qubit_gate()X()Y()Z()S()Sdg()H()CZ()measure()measure_qubit_in_basis()measure_in_basis_vectors()parseBraKet()computeP0()isEqual()isEqualUpToGlobalPhase()
- Output Adjustments & Utilities
OutputAdjustmentMapMeasurementBasisfAlmostEqual()cAlmostEqual()normalize_radians()radiansToString()parseAngle()parseMathValue()basis_to_t()basisToString()parseBasis()printVector()printMatrix()stdMatrixToEigen()eigenToDoubleMatrix()getInverse()computeTransitiveClosure()gf2Eye()gf2Zeros()gf2Mul()gf2Hcat()gf2Vcat()gf2ColSlice()gf2XorRowInto()gf2RREF()gf2RightInvAndKernel()gf2IsDAG()
Troubleshooting