Skip to content

Fix: reset on a qubit with weight on |1> discards the relative phase of the rest of the register - #219

Merged
davidbakker123 merged 1 commit into
developfrom
fix-issue-217
Oct 21, 2026
Merged

davidbakker123 merged 1 commit into
developfrom
fix-issue-217

Conversation

@davidbakker123

@davidbakker123 davidbakker123 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Closes #217
Verified by running this program

version 3.0

qubit[3] q

X q[2]
H q[0]
CNOT q[0], q[1]
S q[1]
reset q[2]

Which outputs (as expected):

===============================================================================================
      _______     _    __
     /  ___   \  | |  / /      ____   ____   __  ___  __  __   __    ___  ______  ____    ___
    /  /   /  |  \ |_/ /      / __/  /  _/  /  |/  / / / / /  / /   / _ |/_  __/ / __ \  / _ \
   /  /___/  /   / / | \     _\ \   _/ /   / /|_/ / / /_/ /  / /__ / __ | / /   / /_/ / / , _/
   \______/\__\ /_/  |_|    /___/  /___/  /_/  /_/  \____/  /____//_/ |_|/_/    \____/ /_/|_|

                     <   QuTech - TU Delft   |   Version 0.10.0 (2025)   >
===============================================================================================

Executing 1000 times the file 'test.cq'...

Shots requested: 1000
Shots done: 1000
State:
        value='000', amplitude='0.70710678 + 0.00000000i', norm='0.50000000'
        value='011', amplitude='0.00000000 + 0.70710678i', norm='0.50000000'
Measurements:
        state='000', count='1000'
Bit measurements:

Qubit register:
        { q: [0..2] }
Bit register:
        {  }

@davidbakker123 davidbakker123 self-assigned this Oct 21, 2026
@davidbakker123
davidbakker123 merged commit 1cce30e into develop Oct 21, 2026
24 checks passed
@elenbaasc
elenbaasc deleted the fix-issue-217 branch October 23, 2026 14:53
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.

reset on a qubit with weight on |1> discards the relative phase of the rest of the register

2 participants