Open Source · IBM Quantum Validated

Quantum measurements
you can trust

NISQ processors operate as noisy open systems where the Born rule silently fails. modularq detects, quantifies, and corrects nonequilibrium measurement bias — without touching your circuits or hardware.

modularq · live analysis
$from modularq import ModularAnalyzer
$result = analyzer.analyze(rho, counts, p0)

## IBM Quantum · ibm_fez · N=100,000

MIS         : 0.0079
Regime     : KMS_BALANCED
Model      : MODULAR (ΔAIC=4.24)

p(0)       : 0.5000 → 0.5039
p(1)       : 0.5000 → 0.4961

✓ Correction applied automatically
$
8
Layers of diagnostics
3
IBM Quantum backends tested
128
Real hardware measurements
0
Circuit modifications needed
// How it works

Three steps.
Zero circuit changes.

modularq sits between your measurement output and your analysis pipeline. It requires only the reconstructed reduced state — no hardware access, no circuit modifications.

01
🔬

Detect

Compute the modular generator K = −log(ρ) from the reconstructed reduced state. Extract outcome-resolved modular imbalances δK_i that reveal nonequilibrium structure invisible to standard Born pipelines.

02
📊

Quantify

Compute the Modular Imbalance Score (MIS) — a single, dimensionless number that classifies your measurement regime: Born-valid, perturbative nonequilibrium, or non-KMS. Comparable across devices and backends.

03

Correct

Apply a universal, normalization-preserving exponential reweighting of Born probabilities. Selected automatically via AIC model comparison — only applied when the data supports it. Fully falsifiable.

One number.
Full picture.

The MIS is modularq's core diagnostic — a scalar, dimensionless benchmark that tells you exactly how far your measurement process is from KMS equilibrium. Low MIS means Born is valid. High MIS means you need correction.

Validated on real IBM Quantum hardware across ibm_fez, ibm_marrakesh, and ibm_torino. Published data available at Zenodo DOI: 10.5281/zenodo.18066279.

MIS Regime Classifier
KMS BalancedMIS < 0.02
✓ BORN VALID — no correction needed
Perturbative NEQ0.02 – 0.10
⚠ CORRECTION RECOMMENDED
Non-KMSMIS > 0.10
✗ CORRECTION REQUIRED
// Software architecture

8-layer modular stack.

Drop-in augmentation for Qiskit, Cirq, and Braket-compatible workflows. No changes to circuit semantics or hardware control.

L7Inference & ValidationAIC / BIC / Bayes — model selection
L6Software InterfaceAPIs expose diagnostics + corrected stats
L5Modular Control & Mitigationminimize imbalance, optimize windows
L4Effective Measurement Rulep_i ∝ p⁰_i · exp(−δK_i)
L3Regime ClassificationBorn-valid / perturbative / non-KMS
L2⟶ Modular Diagnostics (core)K = −log ρ · δK_i · MIS
L1State Reconstructiontomography / shadows / validated model
L0Quantum Hardwareunitary + GKLS · standard projective readout
// Experimental results

Validated on real hardware.

Analysis of 128 measurements from IBM Quantum processors. modularq correctly identifies nonequilibrium regimes and applies corrections only when statistically warranted.

BackendShots (N)MISRegimeModelΔAICp(0) Born → Modular
ibm_fez100,0000.0079KMS BALANCEDMODULAR+4.240.5000 → 0.5039
ibm_fez100,0000.0040KMS BALANCEDEMPATE−0.430.5000 → 0.5020
ibm_fez2,0000.0611PERTURBATIVEMODULAR+5.450.5000 → 0.5305
ibm_fez2,0000.0350PERTURBATIVEEMPATE+0.450.5000 → 0.5175
ibm_marrakesh2,0000.0280PERTURBATIVEEMPATE−0.430.5000 → 0.4860
// Licensing

Free for research.
Commercial license available.

modularq is open source and free for academic and non-commercial use. Commercial deployments require a license agreement.

Academic / Research
Free
For universities, research labs, and non-commercial projects.
  • Full modularq library
  • IBM Quantum compatible
  • Google Colab notebooks
  • Community support via GitHub
  • Attribution required
Get on GitHub →
Consulting
Custom
Deep integration of modular diagnostics into your quantum workflow.
  • Full stack audit
  • MIS heatmap deployment
  • VQE optimization
  • Team training
  • Ongoing support
✉ Get in touch →

Ready to improve
your measurement pipeline?

Whether you're running VQE, benchmarking backends, or building quantum software — modularq adds a physically grounded diagnostics layer to your existing workflow.


↗ View on GitHub