I Question about Grover's algorithm

  • Thread starter Thread starter Malamala
  • Start date Start date
  • Tags Tags
    Algorithm
Click For Summary
Grover's algorithm is a quantum computing technique used to search unsorted databases with a quadratic speedup over classical algorithms. The oracle in Grover's algorithm is a crucial component that encodes the specific problem by inverting the phase of the correct solution. To implement Grover's algorithm practically, one must design a problem-specific oracle that identifies the correct solutions without prior knowledge of them. For instance, when searching for large prime numbers, the oracle would manipulate the bits representing potential primes. Ultimately, Grover's algorithm increases the probability of finding a solution efficiently, but the oracle's design is essential for its practical application.
Malamala
Messages
348
Reaction score
28
Hello! I am just getting started learning about quantum computing so I apologize if this questions is trivial, but I am a bit confused about the Grover's algorithm. As far as I understand (I read it from here), assuming there is just one solution, you start with N qubits, you put them in an equal superposition (using Hadamard gates), you pass them thorough an oracle that inverts the phase of the right solution, then you have a diffuser operator that reflects this new vector relative to the original one and doing this ##\sqrt{N}## times you get a high probability of measuring the right solution. I think I understand the math behind it and the geometrical interpretation, but I don't understand how it is used in practice. What is that oracle? In both examples given on that page, in order to build the oracle i.e. to make sure that the right solution gets a minus sign, you need to know the right solution beforehand. But if you know it, you don't need an algorithm to find it. Can someone help me understand this? What is the oracle in a real problem and how can I implement it in practice without knowing the answer to my question beforehand? Thank you!
 
Physics news on Phys.org
Malamala said:
I don't understand how it is used in practice. What is that oracle? In both examples given on that page, in order to build the oracle i.e. to make sure that the right solution gets a minus sign, you need to know the right solution beforehand. But if you know it, you don't need an algorithm to find it. Can someone help me understand this? What is the oracle in a real problem and how can I implement it in practice without knowing the answer to my question beforehand? Thank you!
First, I'm not sure that it is used in practice.

The "oracle" is part of the Quantum Circuitry that determines exactly what problem is to be solved.
So in order to use Grover's algorithm, you need to write another algorithm that is specific to the problem you are attacking.

For example, let's say that you are looking for a large prime number - say greater that 2^1024. So your oracle might take 1024 bits that represent the last 1024 position of a 1025-bit number - the first bit in that number being a "1".

The oracle will now flip all 1024-bit codes that when combined with that initial "1" code for a prime number.

The key here is that the oracle does not flip a bit, it flips the phase of a full code. So with 1024 bits, you may have many billions of correct answers - and about 2^1024 incorrect ones.

When you apply Grovers algorithm, there is a good chance that you will get one of those primes - but, of course, you would check the result.
 
For the quantum state ##|l,m\rangle= |2,0\rangle## the z-component of angular momentum is zero and ##|L^2|=6 \hbar^2##. According to uncertainty it is impossible to determine the values of ##L_x, L_y, L_z## simultaneously. However, we know that ##L_x## and ## L_y##, like ##L_z##, get the values ##(-2,-1,0,1,2) \hbar##. In other words, for the state ##|2,0\rangle## we have ##\vec{L}=(L_x, L_y,0)## with ##L_x## and ## L_y## one of the values ##(-2,-1,0,1,2) \hbar##. But none of these...

Similar threads

  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K