Grovers Algorithm — Programming on Quantum Computers — Coding with Qiskit S2E3

Qiskit · 67K views · 2020 · 18:31

Open on YouTube

Quantum computingAlgorithms & data structurestutorial

Why Quantum Computing Stack Exchange recommends it

Quantum Computing Stack Exchange users link it as a hands-on Qiskit implementation of Grover's algorithm, especially for how the oracle marks the target state.

Recommended by 1 people across 1 different months, 2021 to 2024.

What it is

An 18-minute episode of the Qiskit channel's 'Coding with Qiskit' series in which Jin-Sung Kim explains how some quantum algorithms can beat classical ones and walks through implementing Grover's search algorithm in Qiskit. It covers the oracle and diffusion steps with working code.

What people said

Recommends user206904 · 2021-10 · Quantum Computing Stack Exchange · on “Can Grover's algorithm be used to search in a real database?”

In addition to that link, if you know some programming/python, you might want to check the Qiskit textbook entry for Grover's algorithm. Also not that a database is an organized collection of structured information. So when we say "search in database" we're not necessarily saying search in some oracle/mysql database, but if needed, the algorithm can be implemented to search in a database with some key-value association. could you use Grover's algorithm to search for a match (let's say x='quantumc')? Yes you can. It's done at the oracle step, the oracle will simply answer "yes it's the element we want" or "no it's not". Then my follow up question is would you need 64 logical qubits to make th

Cites Kai-Chun Lin · 2021-11 · Quantum Computing Stack Exchange · on “Confusion about the Grover algorithm”

My understansing of the Grover algorithm is that oracle can detect the element whcih you search and return it with a negative amplitude. Therefore, it doesn't matter which encoding does the element f have. The oracle can be presented as the following: if element == "f": return -|element> // negative amplitude else: return |element> // positive amplitude Via the diffusion operator, the amplitude of the element "f" will be amplified and therefore the oracle can find the element "f". I hope you can understand what I mean. The tutorial from Qiskit is very helpful: here [LINK] and its implementation [this video] .

Cites Colin Benaissa · 2024-07 · Quantum Computing Stack Exchange · on “Applying cz gate in oracle for Grovers Algorithm”

Theoretically say I have a 2 qubit circuit where the solution state is |11>. I was watching a video from qiskit ( [this video] ) on this and in the oracle they only apply a cz gate: oracle.cz(0,1) to mark the solution state. However wouldn't this mark |11> and also mark |10> and make it not work? However, the professor ran the algorithm and it worked - why?