Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Reload a lost qubit on Reset in the GPU simulator - #4352

Open
Andrew Casey (amcasey) wants to merge 1 commit into
mainfrom
amcasey/gh4250
Open

Andrew Casey (amcasey) wants to merge 1 commit into
mainfrom
amcasey/gh4250

Conversation

@amcasey

@amcasey Andrew Casey (amcasey) commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

The GPU shader's prep_measure_reset returned early for a Reset of a lost qubit without clearing its loss marker, so the qubit stayed lost and later gates on it were skipped, unlike on the CPU and stabilizer simulators. The reset branch now marks the qubit as not lost, as the measuring branch already does; a lost qubit was already collapsed and reset to |0> when it was lost, so its state needs no update. Regression tests cover the Adaptive and Base paths, with the same expectation checked on the CPU simulators.

Fixes #4250

The GPU shader's prep_measure_reset returned early for a Reset of a lost
qubit without clearing its loss marker, so the qubit stayed lost and
later gates on it were skipped, unlike on the CPU and stabilizer
simulators. The reset branch now marks the qubit as not lost, as the
measuring branch already does; a lost qubit was already collapsed and
reset to |0> when it was lost, so its state needs no update. Regression
tests cover the Adaptive and Base paths, with the same expectation
checked on the CPU simulators.
Not run on a GPU: none was available where this was written.

Fixes #4250

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the GPU reset fix restoring lost-qubit reuse.

No open issues 🎉

What changed in this PR

Fixes #4250 by making GPU Reset reload lost qubits, matching CPU and stabilizer simulator behavior.

Changes:

  • Clear the qubit’s loss marker when resetting a lost qubit.
  • Add Base and Adaptive regression tests verifying that subsequent gates execute after reset.
File Description
source/​simulators/​src/​gpu_full_state_simulator/​gpu_statevector_shaders.wgsl Clear the loss marker on reset.
source/​qdk_package/​tests/​test_simulators_gates_noisy.py Test reset and qubit reuse through Base QIR.
source/​qdk_package/​tests/​test_adaptive_gpu_noise.py Add Adaptive GPU regression coverage.
source/​qdk_package/​tests/​test_adaptive_cpu_noise.py Verify matching Adaptive CPU behavior.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GPU: Reset does not reload a lost qubit

2 participants