r/QuantumComputing • u/Remarkable_Piano_582 • Jul 13 '26
Question Question
"Can you give me a practical example of a simple algorithm where a quantum computer is more efficient? I struggle to understand the usual ones, like the maze-solving example, which aren't very clear to me. They always seem too theoretical. Can someone provide a more concrete and intuitive example, please?"
14
Upvotes
5
u/SeniorLoan647 In Grad School for Quantum Jul 13 '26
There are none (yet). Compare it to AI in the 70s and 80s, theory, hardware and software are not developed enough to be competitive with optimized classical algorithms.
18
u/NeitherAd9824 Jul 13 '26
If you have some mathematical background try watching an explanation of Grover's algorithm by 3blue1brown on YouTube, if you are looking to get an intuitive understanding of why and how quantum computing is more efficient in some cases. It also touches for which cases quantum is more efficient over classical computing.
11
u/ponyo_x1 Jul 13 '26
first of all, the maze-solving example is complete bullshit don't even pay attention to that
there are really only two "useful" things that we know quantum computers can do better than classical computers. those are (1) simulating quantum systems, and (2) factoring big numbers. the reason why these algorithms work is because quantum gates manipulate a quantum state in Hilbert space which is enormous. A quantum algorithm is like doing exponentially large linear algebra, and these two examples have structure that are amenable to this type of thing.
Simulating quantum systems is probably the easiest to understand. Suppose you have some Hamiltonian H that describes your system and you want to compute e^(i*t*H) applied to an initial state. The Hamiltonian might be easy to describe as a sum of Pauli terms, but computing the matrix exponential is classically intractable because H is exponentially large (i.e. if k-local Hamiltonian H describes a 10x10 lattice, the matrix is (2^100)x(2^100) entries even if it is described as a sum of O(100) Pauli terms). However, on a quantum computer you can naturally do operations to encode H and then embed the matrix exponential in your system.
Factoring is similar. You can prove that the periodicity of the modular exponential function f(x)=a^x(mod n) has a close relationship to the factors of a big number. Finding the period of this thing classically would require you to store an exponentially large number of these terms, and this is not even how people classically factor anyways. However, on a quantum computer you can store the modular exponential function as a quantum state very efficiently (because the quantum computer is a big linear algebra machine) and then hit it with an even more efficient quantum Fourier transform to extract the period which you are after.
Most introductory sources say that superposition and entanglement are what allow you to do classically intractable computations efficiently on a QC, but as someone who writes quantum algorithms I've never liked that explanation even if it's technically true. imo it is much more intuitive to express QC as big linear algebra
2
u/Valuable_Day_3375 Jul 13 '26
simple example is searching for one specific item in a huge unsorted collection, like finding a single misplaced key among millions of identical keys. A normal computer might have to check almost every one, while a quantum computer can use a clever quantum search algorithm to find it in far fewer steps.
2
u/StageVirtual5626 Jul 14 '26
finding prime factors of a number, shor's algo .
1
u/NoNameSwitzerland Jul 15 '26
What a quantum computer could do very well is sum over all pathes for so problem, because that is more or less what quantum mechanics does. And then you can quantum fourier transform these value into a digital register that you only have to read once instead of statistical sampling. (That is part of the Shores algorithm for factoring numbers)
1
u/Qubit_and_Neuron Jul 22 '26
The simplest ever is the following. Imagine a black box that outputs 0 or 1. The input is also 0 or 1. It has two possibilities only, either it is constant, that means irrespective of your input it always gives you the same output. Second possibility is that it gives you 50-50 means you get exactly one time 0 and one time 1 when you input 1 and 0 but don't know what is the output for a specific input. First is called constant, second is balanced. Now the question is given a black box like this, use it only one time and tell if it is balanced or constant black box. You cannot! Using quantum computer you can. Deutsch-Jozsa algorithm. If you want more, look at my blog: https://qubit-and-neuron.beehiiv.com/
-7
u/zhidzhid Jul 13 '26
This isn't ChatGPT.
-2
u/Salt-Discussion-9707 Jul 13 '26
The one problem which quantum computers can solve better than classical computers is simulating themselves as a specific model of a noisy quantum computer. However classical computers are also very good at that.