nqch / sg-grand-challenge
Publicnqch/sg-grand-challenge
In a randomized-measurement experiment every shot is measured in a randomly
chosen basis, and many properties of the state are then estimated from the same
data. Here the random choice is made inside the Guppy program, on the device:
in every shot the program draws a basis with the runtime random-number
generator, rotates into it, measures, and records the basis next to the outcome.
One compiled program covers every basis, so a whole randomized-measurement
experiment is one job. Decoding and estimation are separate steps that need
only the job's results.
rng_measurement = LocalShadow().rng_measurement # or GlobalShadow(), CustomBasisMeasurements([...])
@guppy
def program() -> None:
rng = shot_rng(1729) # a fresh random stream in every shot
qs = array(qubit() for _ in range(3))
ghz(qs) # any state preparation
rng_measurement(qs, rng) # draw a basis on the device, rotate, measure, record
rng.discard()
data = decode(results) # later, from the results alone
estimate(data, ["ZZI", "XXX"]); fidelity(data, target)
evidence/.
showcase.py | Start here. The primitive on GHZ and Bell states with known answers: local and global shadows, custom random bases, several registers per shot, a controlled phase sweep, decoding later from saved results. Runs on the local Selene emulator in about a minute. |
deliverables/ | One-page summary, written report and slides (PDF). |
evidence/ | Execution evidence: SUMMARY.md (every estimate against its exact value, per platform), jobs.json (job IDs and inputs), raw results and decoded data. |
run_emulators.py | Runs the showcase locally or through Aqora, stage by stage, and writes evidence/. |
applications/ | Two proposed uses of the primitive, executed locally: cluster-state diagnostics from one local-shadow dataset, and H₂ energy with measurement groups chosen on the device. |
guppy_shadows_h2/ | The package (≈ 1,100 lines of Guppy and numpy): LocalShadow, GlobalShadow, CustomBasisMeasurements, decode, estimate, fidelity, purity. |
COST_ANALYSIS.md | What drawing bases on the device saves on H2, against one job per basis and circuit stitching. |
README.md | Details: how the H2 version differs, tests, reproducing every number. |
| Stage | Platform | Jobs | Done |
|---|---|---|---|
| 0 | nexus:H2-2SC | 12 | 12 |
| 1 | nexus:Selene | 10 | 10 |
| 2 | nexus:H2-2E | 2 | 2 |
| 3 | nexus:H2-2E | 5 | 5 |
| Experiment | Platform | Shots | Job ID |
|---|---|---|---|
| ghz_local | nexus:H2-2SC | 1000 | AFByb3ZpZGVySm9iAaE4gSvBfLOfHU05L9KBCA |
| ghz_local | nexus:H2-2SC | 1000 | AFByb3ZpZGVySm9iAaE4gXIxf1Oxv0UhG2T_vg |
| ghz_global | nexus:H2-2SC | 1000 | AFByb3ZpZGVySm9iAaE4gXwjf1GdJyi1lSv3Dg |
| ghz_biased | nexus:H2-2SC | 1000 | AFByb3ZpZGVySm9iAaE4gYmleOOv16KCqH54cg |
| bell_register | nexus:H2-2SC | 500 | AFByb3ZpZGVySm9iAaE4gZK-fsC6eCUOiPf6mA |
| bell_copies | nexus:H2-2SC | 500 | AFByb3ZpZGVySm9iAaE4gZv0f0CDYNavYqEG3A |
| ghz_local | nexus:Selene | 1000 | AFByb3ZpZGVySm9iAaE4gl_3dMC8F8j2eOR1ng |
| ghz_global | nexus:Selene | 1000 | AFByb3ZpZGVySm9iAaE4gmt1fhCor4xC2zKQSw |
| ghz_biased | nexus:Selene | 1000 | AFByb3ZpZGVySm9iAaE4gnw1eVK-P35H-VGiwg |
| bell_register | nexus:Selene | 500 | AFByb3ZpZGVySm9iAaE4goYKcQOHpQ8Z_EvFDg |
| bell_copies | nexus:Selene | 500 | AFByb3ZpZGVySm9iAaE4gpJBeIOGYlneofUJAA |
| phase_0 | nexus:Selene | 1000 | AFByb3ZpZGVySm9iAaE4gpzccLOEOWYKG3HWlw |
| phase_1 | nexus:Selene | 1000 | AFByb3ZpZGVySm9iAaE4gqd_fgOx5KZqD1mqkA |
| phase_2 | nexus:Selene | 1000 | AFByb3ZpZGVySm9iAaE4grGrfcCPKE5L1NJtGg |
| phase_3 | nexus:Selene | 1000 | AFByb3ZpZGVySm9iAaE4gr2ufnCCqRMfPkw4bw |
| phase_4 | nexus:Selene | 1000 | AFByb3ZpZGVySm9iAaE4gsheexGceAF6PqG9dg |
| ghz_local | nexus:H2-2SC | 1000 | AFByb3ZpZGVySm9iAaE4jKEzfjO7kuQycNo7Xw |
| smoke | nexus:H2-2E | 200 | AFByb3ZpZGVySm9iAaE4n19qfkCrKHw2GtgB9g |
| ghz_local | nexus:H2-2SC | 1000 | AFByb3ZpZGVySm9iAaE5vZxAc_CKUmv575WlrQ |
| ghz_global | nexus:H2-2SC | 1000 | AFByb3ZpZGVySm9iAaE5vaqDdcC1Fkp_XJr7Mw |
| ghz_biased | nexus:H2-2SC | 1000 | AFByb3ZpZGVySm9iAaE5vbVPcpO84227wUBEzQ |
| bell_register | nexus:H2-2SC | 500 | AFByb3ZpZGVySm9iAaE5vb83dPG7s7OMs4iClQ |
| bell_copies | nexus:H2-2SC | 500 | AFByb3ZpZGVySm9iAaE5vclWeoGEhfIOK-YoPw |
| smoke | nexus:H2-2E | 200 | AFByb3ZpZGVySm9iAaE5v0WnefKZX2sDByZoXQ |
| ghz_local | nexus:H2-2E | 1000 | AFByb3ZpZGVySm9iAaE5v3iNe5KtHcICyeN2wQ |
| ghz_global | nexus:H2-2E | 1000 | AFByb3ZpZGVySm9iAaE5v4NIebCAStDfsza33Q |
| ghz_biased | nexus:H2-2E | 1000 | AFByb3ZpZGVySm9iAaE5v448e2OFLXHIfr3oCQ |
| bell_register | nexus:H2-2E | 500 | AFByb3ZpZGVySm9iAaE5v5eUflO4LlMD734PuQ |
| bell_copies | nexus:H2-2E | 500 | AFByb3ZpZGVySm9iAaE5v6GaewOBBsuOmmdmXA |
showcase.py and run all cells. Everything runs on
the local Selene emulator and costs nothing.[CREDENTIALS] in
aqora_config.py and set SUBMIT = True, then
python run_emulators.py plan (the stages and their cost), then
submit <stage> --yes and fetch. Remote submission is off by default, so
opening the notebooks never spends credits.pyproject.toml (guppylang ≥ 1.1, hugr-qir ≥ 0.3, aqora ≥ 0.31,
numpy, matplotlib).