Skip to content

v0.2.9 -- Preview Mode

Choose a tag to compare

@FedorShind FedorShind released this 30 Mar 11:27
· 63 commits to main since this release

What's New

Preview mode -- EMRG can now simulate your circuit with noise and show the before/after effect of its recommended mitigation, before you spend real hardware shots.

CLI

emrg generate circuit.qasm --preview
emrg generate circuit.qasm --preview --noise-level 0.03 --observable ZZ
emrg generate circuit.qasm --preview --technique pec --noise-model

Python API

result = generate_recipe(qc, preview=True, noise_level=0.01)
print(result.preview.error_reduction)  # e.g. 77.5

How it works

Preview runs a Cirq DensityMatrixSimulator with per-gate depolarizing noise. It computes ideal, noisy, and mitigated expectation values using the actual recipe EMRG generated (ZNE factory + scaling method, or PEC with depolarizing representations). Results are displayed in a comparison box in the terminal.

Limitations

  • Density matrix simulation caps at 10 qubits. Larger circuits skip with a warning.
  • Wide circuits (8-10 qubits) have gate-count budgets to keep simulation under 30 seconds.
  • PEC preview uses 200 samples for speed. Results are approximate.
  • Requires cirq-core. Install with pip install emrg[preview]. Base package works without it.

Other changes

  • --noise-level flag validated to range 0 < p <= 0.5
  • run_preview() and PreviewResult exported from public API
  • preview parameter added to generate_recipe()
  • [preview] optional dependency group in pyproject.toml
  • 319 tests, zero lint warnings