Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible typo on page 96? #41

Open
joshuaguerin opened this issue Jun 30, 2021 · 1 comment
Open

Possible typo on page 96? #41

joshuaguerin opened this issue Jun 30, 2021 · 1 comment

Comments

@joshuaguerin
Copy link

In the explanation of Fig 5-11 on page 96, we have:

Note that for some values of a, subtracting 3 from a will cause its lowest-weight qubit to be set. We can use this top bit as a condition for our increment operation.

Emphasis mine.

I'm reading this as referring to the nots in the if (a<0) then b++ block being conditioned over 0x4 (for a). Should this be the most significant qubit?

@dyordan1
Copy link

Agreed. Further, the result of the program (and the QCEngine implementation) agree with the most significant interpretation - note the 0x4 line being conditioned in the CNOTs below.
image

This may just be a terminology clarification since the exact wording used is "lowest-weight" not "least significant".

It is also not very clear that the net result is if(a >= -1 && a < 3) b++. It took me quite a long time to understand that -1-3 = -4 (duh). Perhaps a-4 would be more clear? Or maybe even just, don't modify a for this example and setup "negative" a states from the beginning and skip the a-3 / a+3. I felt like a bit too much was thrown into it at once and made it pretty dense to work through.

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

No branches or pull requests

2 participants