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

Updates to Shor's algorithm notebook #2167

Closed
wants to merge 0 commits into from
Closed

Conversation

mmvandieren
Copy link
Contributor

Description

fixed and double checked the modular arithmetic circuits to make sure they were written in the big endian convention of CUDA-Q

Copy link

copy-pr-bot bot commented Aug 27, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@sacpis
Copy link
Collaborator

sacpis commented Aug 28, 2024

/ok to test

Command Bot: Processing...

1 similar comment
@sacpis
Copy link
Collaborator

sacpis commented Aug 28, 2024

/ok to test

Command Bot: Processing...

Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

Comment on lines 453 to 456
"Measurement results in big-endian notation: { 00101:200 }\n",
"\n",
"For x =5, 5^x mod 21 = 17\n",
"For x =5,the computed result of the circuit is 17\n"
"For x = 3, 5^x mod 21 = 20\n",
"For x = 3, the computed result of the circuit is 20\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm still little confused by the reference to big endian here. When 00101 is interpreted in big endian (where the MSB is on the left and the LSB is on the right), the result should be 5. The only way to get 20 from 00101 is to treat 00101 as a little endian number.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just to elaborate, I agree that in CUDA-Q, one could say that 00101 corresponds to 20, because we print the bitstrings left to right, lowest index to highest index. So, if the bitstring indices $i$ correspond to the $2^i$ position values, 00101 corresponds to $0 \times 2^0 + 0 \times 2^1 + 1 \times 2^2 + 0 \times 2^3 + 1 \times 2^4 = 20$, I would just call that a little endian notation because we are printing the LSB first, which is what you would expect in a little endian convention.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. Maybe I'll just remove the "endian" terminology altogether and just be more explicit about how things are printed out and stored in qubits

@bmhowe23 bmhowe23 changed the title fixed the modular arithmetic circuits to be in big-endian Updates to Shor's algorithm notebook Aug 28, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants