Shor, I’ll do it (2007)
scottaaronson.blog
scottaaronson.blog
Mixing together the concepts of modular sequences, periods, and Fourier transforms, plus doing this fast with computers that barely exist in order to find factors or numbers is just an amazing construction.
There's a video featuring Peter Shor about the invention of this algorithm: https://www.youtube.com/watch?v=6qD9XElTpCE
But if you do think of it that way, why not just pick a random number using some quantum process, classically test whether or not it's a divisor of the number you're trying to factor, and kill yourself if it's not? In every universe where you survive (which, for sake of argument, are the only ones you care about) you find a factor on the first try.
Postselection is ridiculously powerful, as you've noted.
In every universe where you survive (which, for sake of argument, are the only ones you care about) you find a factor on the first try.
What’s more likely, randomly guessing a prime factor of a giant number, or miraculously surviving and being permanently incapacitated? Or being interrupted, saved by modern medicine, bitten by a black widow immediately after getting it right…You have to think that the odds really aren’t in your favor there.
(What, did you think this logic is only valid when you're trying to gain godlike powers?)
Also quantum parallel universe is not what you expect parallel universe to be. Universes interact with each other.
I think you may have accidentally discovered the Quantum Bag Holder Paradox.
All universes affect the probability of something occurring in each universe. That is how each universe contributes a bit of the Fourier offset which gives off the period in pretty much all universes.
Because finding the right divisor is so unlikely, you run a high risk of killing yourself in all universes. As Scott emphasizes, quantum computers don’t run possibilities in parallel!
That's the nature of true randomness, if you set up a dice throw a million times they could just as well all come up as six. Incredibly unlikely, but possible.
the entire planet is obliterated except in cases pursuant to their interests, with none the wiser since in those cases, they 'didn't do anything'
The algorithm generates a random permutation of its input using a quantum source of entropy, checks if the list is sorted, and, if it is not, destroys the universe. Assuming that the many-worlds interpretation holds, the use of this algorithm will result in at least one surviving universe where the input was successfully sorted in O(n) time.
Firefox doesn't want to load that due to mixed content (https page loading http), and also doesn't want to follow the 301 redirect to the https version. Chrome appears to follow the 301 redirect (or maybe lazy-images.js does something different) such that the page renders properly.
Cooley-Tukey has two main steps that are repeated recursively: bulk replacing a,b with a+b,a-b along bit boundaries, and applying twiddle factors. The bit-boundary a,b->a+b,a-b part becomes a Hadamard gate and the bit twiddling becomes a set of phase gates. Also there's some re-ordering but that's not the meat.
The actual quantum circuit: [4].
The quantum circuit is simple enough that it's a really solid mnemonic for remembering Cooley-Tukey, if you know how to translate it. There are also various ways to optimize the gate count or gate depth of this circuit, and these optimizations translate into changes to the classical FFT (though they are not always optimizations after translation) [5].
1: https://en.wikipedia.org/wiki/Cooley%E2%80%93Tukey_FFT_algor...
2: https://en.wikipedia.org/wiki/Tensor_network
3: https://en.wikipedia.org/wiki/Hadamard_transform
4: https://algassert.com/quirk#circuit=%7B%22cols%22%3A%5B%5B%2...
According to this paper, one can use 2n+3 qubits to factor an integer with n bits:
https://arxiv.org/abs/quant-ph/0205095
Those would be perfect qubits, if you use noisy qubits you'd need many more (maybe a factor of 1000x more), since quantum error correction imposes a lot of overhead.
Suppose I gave you the power to negate a billion amplitudes of your choosing in the middle of a 2000 bit quantum factoring computation. You might think this could destroy the computation, but a billion is way way way less than 2^2000 so the computation would for all intents and purposes be completely unaffected.
The things the quantum computers operate on are the qubits, not the amplitudes. Noise processes also operate on qubits, not amplitudes. It's the quantity and quality of the qubits that matter.
You can factor 2048 bit RSA integers if you have 20 million qubits each having a 0.1% gate error rate [1].
I am curious to know about these tricks to recover p, q. Does anyone know?
My personal aspirations to this kind of biting wit are futile and vain, but my admiration for it is even greater and some people can bring it off with style to spare, and ever since that uh, thing, Scott is just playing the ten minute guitar solo.
Into to Number Theory with periodicity and modular math might be stretching "nothing more than arithmetic" a bit, but fuck it, this is the best accessible discussion of Shor I've ever read and if there's any justice in the multiverse it will become the go-to link on the topic, which will mean that 10^500 laypeople will roll their eyes at the next 10^500 "quantum computers are the next step after digital computers" Aeon fluff pieces floating by.
https://www.theatlantic.com/politics/archive/2015/01/the-blo...
https://www.newyorker.com/culture/annals-of-inquiry/slate-st...
Edit: users pointed out this is a different Scott. My mistake!
I’m pretty sure they all know/read each other - related communities/ideas.
PBS also has a (now discontinued) YouTube show called infinite series that did a decent overview of the algorithm and showed examples of a lot of the stuff described here.
This article is from 2007
Apparently Scott never gave a fuck. :) Dope.
Also note that this was published in 2007, 4 years after WordPress was originally released, which probably makes Scott a bit of an early adopter.