I Question about Grover's algorithm

  • I
  • Thread starter Thread starter Malamala
  • Start date Start date
  • Tags Tags
    Algorithm
Malamala
Messages
342
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.
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. Towards the end of the first lecture for the Qiskit Global Summer School 2025, Foundations of Quantum Mechanics, Olivia Lanes (Global Lead, Content and Education IBM) stated... Source: https://www.physicsforums.com/insights/quantum-entanglement-is-a-kinematic-fact-not-a-dynamical-effect/ by @RUTA
If we release an electron around a positively charged sphere, the initial state of electron is a linear combination of Hydrogen-like states. According to quantum mechanics, evolution of time would not change this initial state because the potential is time independent. However, classically we expect the electron to collide with the sphere. So, it seems that the quantum and classics predict different behaviours!
According to recent podcast between Jacob Barandes and Sean Carroll, Barandes claims that putting a sensitive qubit near one of the slits of a double slit interference experiment is sufficient to break the interference pattern. Here are his words from the official transcript: Is that true? Caveats I see: The qubit is a quantum object, so if the particle was in a superposition of up and down, the qubit can be in a superposition too. Measuring the qubit in an orthogonal direction might...

Similar threads

Back
Top