✨ Allow `stepBackward` past a `measure` and `reset q[i]`
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Inizia in src/backend/dd/DDSimDebug.cpp, soprattutto in ddsimStepForward e nei percorsi di misurazione e reset di q[i]. Traccia come vengono memorizzati e ripristinati previousInstructionStack e lo stato DD, quindi esamina il comportamento esistente del debugger per il passo indietro. Il lavoro è completato quando il passo indietro attraverso entrambe le operazioni ripristina lo stato quantistico e i bit classici interessati, e il comportamento di replay in avanti è risolto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
🤖 AI text below 🤖
Problem statement
Once a measure has been executed, the debugger refuses to step backward past it. ddsimStepForward in src/backend/dd/DDSimDebug.cpp clears previousInstructionStack after a measurement with the comment // after measurements, we can no longer step back.. The user loses access to the pre-measurement state, both the quantum superposition and the previous value of the target classical bit.
The reset q[i] operation (which performs a measurement internally) follows the same pattern and is also un-stepbackable.
Surfaced during the follow-up work on issue #168 (PR #456) and again during the review of PR #463.
Proposed solution
Applying the inverse of a measurement does not restore the pre-collapse superposition. The operation is genuinely irreversible in a physical sense, and the current code acknowledges this by blocking step back after a measure. Snapshot the state instead: before the measurement writes, save the quantum state together with the previous value of every classical bit it is about to touch. On step back, restore the snapshot. In the DD backend this is cheap because decision diagrams share structure through internal tables, so a snapshot is a pointer rather than a full state-vector copy.
Also drop the previousInstructionStack.clear() calls on the measure path and the reset q[i] path so the step-back path is actually reachable.
Open question
After stepping back past a measurement, the next stepForward can either re-sample the measurement (probabilistic: the operation runs again on the restored superposition and may give a different outcome) or force the previous outcome (deterministic replay: reproduces the original run bit-for-bit, at the cost of storing the outcome and/or the random-number generator state alongside the snapshot).
My preference would be probabilistic: it matches the simulator's natural semantics, requires no extra state beyond the snapshot already needed, and lines up with what a user would see on real hardware. Deterministic replay reads more like a separate feature (a "record-and-replay" mode) than an inherent part of step-back.
Final call is yours; happy to go the other way if you prefer.
Out of scope
- Broader changes to the debugger's history model (call/return stacks, breakpoint state, etc.).
- Persisting classical bit values across code reloads.
- Restoring classical bits after non-measurement operations that write to them (there are currently none in the debugger's front-end).
- Lingua principale
- C++
- Stelle
- 21
- Fork
- 8
- Merge medio
- 5h 17m
- PR unite (30g)
- 21
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di munich-quantum-toolkit/debugger
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 84/100
munich-quantum-toolkit/debugger#469 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 66/100
munich-quantum-toolkit/debugger#468 ·
I maintainer di solito rispondono entro 1 giorno
-
✨ Improve CLI UX: line editing, function-key shortcuts, and help barForse già presa @rturrado l’ha presa 31 giorni fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
munich-quantum-toolkit/debugger#467 ·
I maintainer di solito rispondono entro 1 giorno
-
c++ enhancement help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
munich-quantum-toolkit/debugger#168 ·
I maintainer di solito rispondono entro 1 giorno
-
Dependency DashboardApertadependencies
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
munich-quantum-toolkit/debugger#55 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di munich-quantum-toolkit/debugger
Issue simili
-
[Cleanup] Include the public header in work_split.cppForse già presa @blozano-tt l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
tenstorrent/tt-metal#60850 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
beehive-lab/TornadoVM#1248 ·
I maintainer di solito rispondono entro 1 giorno
-
core: RAC_LLM_OPTIONS_DEFAULT.min_p disagrees with the IDL's annotated defaultForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug core p3
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
RunanywhereAI/runanywhere-sdks#1083 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
tesseract-ocr/tesseract#4653 ·
I maintainer di solito rispondono entro 1 giorno
-
area: docs eco: cpp good first issue help wanted lane: free-agent roadmap size: XS type: docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
arminazimi/evergreen#475 ·
I maintainer di solito rispondono entro 1 giorno