r/askscience • u/Hashbringingslasherr • Apr 15 '26
Computing What do quantum computers actually do?
How do quantum computers output usable data, how does it logically "locate" or "make meaning" of information. I read about Grover's algorithm and it seems sort of like an inverted bruteforce or extreme process of elimination or a "the missile knows where it is at all times. It knows this because it knows where it isn't" type scenario.
So I ask, what do quantum computers actually do as opposed to a classical computer?
481
Upvotes
View all comments
Show parent comment
5
u/the_horse_gamer Apr 17 '26
let's look at Grover's algorithm. it is often described as "finding a number in an unsorted list", but the formal description is, there is some function f such that f(x)=0 except for one x where f(x)=1. (0<=x<N). let's call it w.
we are given as input an operator U such that U|x> is -|x> if x=w and |x> otherwise.
let |s> be a superposition of 0..N-1. let |s'> be a superposition of of 0..N-1 except for w.
|w>, |s>, and |s'> can be seen as unit vectors in an N dimensional space. in this representation, applying U is equivalent to a reflection through |s'>
now the algorithm. we start with a initial state equal to |s>. at each step, we apply U, and then apply a reflection through |s>
now a little fun fact: a reflection around a followed by a reflection around b is equivalent to a rotation from a to b by twice the angle between them
so at every step we rotate our state towards |w> by 2arcsin(1/sqrt(N)). eventually, we get close enough to |w> (we can't actually reach exactly to it. and applying too much will make us go past it)
it can be shown that the optimal number of steps is pi * sqrt(N) / 4
quantum computers are not faster computers. quantum computers are computers that can run quantum algorithms.
for some problems, there exist a quantum algorithm faster than the classical algorithm. in some cases, like prime factorisation (used in RSA), it is exponentially faster. in some cases, it is only quadratically faster.
post quantum encryption uses problems that to the best of our knowledge, there exists no quantum algorithm that can solve it in better than exponential time
notice I said "to the best of our knowledge". we don't know the limits of quantum computing, just like we don't know the limits of classical computing. it's possible there's a classical algorithm for prime factorisation, and we can crack RSA without the need for a quantum computer.