# Is there an example of Shor's algorithm for the discrete log problem with concrete numbers anywhere?

I understand the problem well enough and I'm trying to understand the algorithm, Shor's version. It's not easy to read the abstract descriptions available everywhere --- Shor's paper, Nielsen's book and many others. I will build a numerical example --- various numerical examples --- if none are available out there, but if you know any that will be a nice start.

If you don't know any, feel free to give me directions on how to build it. For instance, I have already understood that a key step to the algorithm is setting up two registers |a>|b> and then applying a circuit that takes |$$a$$>|$$b$$> to |$$y\oplus g^a x^{-b}$$>, where $$g$$ is a generator and $$x$$ is the number whose logarithm we want to find. (The computation is be reduced mod $$p$$.) (Of course, $$y$$ is to be initialized to zero.)

The next step is to compute the QFT, something I've never done and looks a bit difficult, so I will consider the previous step a mile stone for now. I think that at the previous step I will have a superposition of all possible values of the pair $$(a,b)$$ and so the QFT would only serve to amplify the states that are interesting.

As you can see, more than examples, I'm looking for careful steps and explanations. I'll appreciate any help on this.

• I really liked the approach in "Programming Quantum Computers" book from OReilly - they showed a step-by-step worked example rather than general case formulas. You can run the algorithm with state visualization at oreilly-qc.github.io (chapter 12) Dec 4, 2020 at 20:39
• @user14021 welcome to the quantum computing stack exchange! Dec 4, 2020 at 23:25
• @MariiaMykhailova how is that book you mentioned compare to other related quantum computing textbooks? thinking of getting it :) Dec 4, 2020 at 23:25
• That's good remembering! I know how I can put my hands on that book. @KAJ226, that book is more directed at programmers (say) than mathematicians (say). They're trying to get the math out of quantum computing and computer people (say) how they could use the main quantum routines that have been discovered so far. (They came up with a visual representation for superposition. Kinda like that. I've read the few pages of it.) Dec 4, 2020 at 23:47
• Here's a link to the book on Google Books. Dec 4, 2020 at 23:51