Grover’s Algorithm: How Can an Oracle Mark an Unknown Answer?

3Blue1Brown clarifies verification, quantum linearity and the practical limits of a quadratic search speedup.

チャンネル
3Blue1Brown
公開日
2025年5月4日
動画
16:23
読了時間
3 分
原文
英語
YouTube で開く
スクロールすると動画は右下に小さくなって再生を続けます。字幕は閲覧言語に合わせて切り替わります。
閲覧言語2 言語で読めます
この記事はまだ日本語に翻訳されていないため、英語の原文を表示しています。
要約

30 秒でわかる

This follow-up explains why constructing a quantum marking operation does not require knowing the solution to the search problem. A Sudoku verifier illustrates the distinction, followed by superposition, linearity and the limits of Grover’s speedup.

  1. 1Checking is not solvingA Sudoku verifier can recognize a solution without knowing it beforehand.
  2. 2Marking through an oracleA quantum implementation changes the sign of marked states using the verifier’s logic.
  3. 3LinearityA transformation of a superposition can be analyzed by its effect on each basis vector.
  4. 4Quadratic is not magicEven a square-root reduction can leave an enormous search.

ポイント

  1. Knowing how to verify a candidate does not mean knowing the solution.
  2. A quantum oracle can implement a verifier’s marking behavior without naming the answer.
  3. Linearity explains how an operation acts on a superposition.
  4. The two-dimensional plane used for visualization is not supplied to the computer as an answer.
  5. Quadratic query speedup can still leave an infeasible search, especially after implementation costs.
全文

チャプターごとに整えた全文を読む

文字起こしのみ
01

The apparent paradox

In a follow-up to a quantum-computing lesson, the 3Blue1Brown narrator addresses a common confusion: does Grover’s algorithm require knowing the answer before it can mark the answer? The answer is no.

In a follow-up to a quantum-computing lesson, the 3Blue1Brown narrator addresses a common confusion: does Grover’s algorithm require knowing the answer before it can mark the answer? The answer is no.

The earlier visualization showed a high-dimensional state vector and a sign flip along the direction corresponding to the desired input. Viewers reasonably asked how one could perform that operation without already knowing the direction.

02

A verifier without a known answer

A Sudoku checker gives a more concrete analogy. It can test whether a proposed grid satisfies the rules without revealing the solution; implementing the rules is different from discovering a valid input.

A Sudoku checker gives a more concrete analogy. It can test whether a proposed grid satisfies the rules without revealing the solution; implementing the rules is different from discovering a valid input.

The narrator also uses a cryptographic hash as an example of an efficiently checkable output whose corresponding input is believed hard to find. The desired input is not simply a secret number written inside the verifier.

Grover’s algorithm applies a suitable quantum version of a verifier to search an unstructured set with a quadratic query improvement over classical exhaustive search. The cost of building and running the verifier still matters.

03

From logic to an oracle

One can express the classical verification procedure as logic gates taking a binary candidate and returning true or false. The gate network encodes the rules; it does not need to contain the solution explicitly.

One can express the classical verification procedure as logic gates taking a binary candidate and returning true or false. The gate network encodes the rules; it does not need to contain the solution explicitly.

For k qubits, the computational basis has 2^k possible bit strings, each represented by a basis vector. A quantum operation transforms a state vector in this space rather than returning a classical Boolean value directly.

The quantum oracle is constructed so a valid candidate’s basis component changes sign and an invalid candidate’s does not. The construction uses the verifier’s logic; it does not require the solution to be known in advance.

The narrator acknowledges that the previous video did not show the translation in detail. Classical operations need an appropriate reversible quantum implementation; the follow-up focuses on the conceptual distinction between checking and knowing.

He also corrects his earlier framing: a toy function that simply checks whether the input equals a displayed number made the answer look hidden in the code. A Sudoku verifier better illustrates why checking can be easier than searching.

The verifier is treated as a black box by the search procedure in the sense that the procedure uses its input-output behavior. Constructing the quantum oracle, however, requires implementing the verifier rather than assuming an unknown classical box automatically becomes quantum.

04

Superposition and linearity

A state can be a superposition: a weighted sum of basis vectors for different bit strings. When measured, it yields one result, with probability given by the squared magnitude of that result’s amplitude.

A state can be a superposition: a weighted sum of basis vectors for different bit strings. When measured, it yields one result, with probability given by the squared magnitude of that result’s amplitude.

Quantum operations are linear: applying one to a weighted sum gives the same weighted sum of the transformed basis vectors. A Z gate provides a small example, leaving the zero basis state unchanged and changing the sign of the one state.

Applied to a superposition of Sudoku candidates, the oracle leaves invalid candidates’ amplitudes unchanged and flips the sign associated with a valid candidate. Linearity describes the result without requiring the solution to be named in advance.

The narrator cautions against treating “all possibilities at once” as a complete explanation. A rotation of a northeast vector can be analyzed through north and east components without requiring two separate hikers.

05

The algorithm and its visualization

Grover’s procedure alternates the marking oracle with another operation to amplify the chance of measuring a marked answer. The useful visualization follows the state in a two-dimensional plane, but choosing that plane is not an instruction the computer needs.

Grover’s procedure alternates the marking oracle with another operation to amplify the chance of measuring a marked answer. The useful visualization follows the state in a two-dimensional plane, but choosing that plane is not an instruction the computer needs.

06

Practical limits

The narrator questions practical utility for huge search spaces. A quadratic speedup turns an illustrative 9^60 brute-force search into roughly 9^30 oracle-scale steps, which can still be enormous.

The narrator questions practical utility for huge search spaces. A quadratic speedup turns an illustrative 9^60 brute-force search into roughly 9^30 oracle-scale steps, which can still be enormous.

For an idealized 256-bit hash preimage search, the analogous query scale falls from about 2^256 to 2^128. Real costs depend on assumptions, the oracle implementation and fault-tolerant hardware.

He distinguishes this quadratic search improvement from quantum algorithms with stronger speedups for specific problems, including the factoring problem relevant to RSA. Quantum computing does not imply that every cryptographic problem becomes easy.

同じチャンネルの記事

スライド 20 枚40:44EN
3Blue1Brown· 2026年10月16日Grant Sanderson: There's never been a better time to go into mathGrant Sanderson, Constantin Kogler · 3Blue1BrownStudents fear AI has solved mathematics. Grant Sanderson argues the opposite: even if machines prove theorems better than we do, the institution of math stays valuable—and this is a rare moment when newcomers can reshape it.MathematicsAI for scienceHuman-AI Collaboration+2
スライド 29 枚51:55EN
3Blue1Brown· 2026年9月18日The last IMO problem AI could not solveGrant Sanderson · 3Blue1BrownGrant Sanderson walks through IMO 2025 Problem 6 — a tiling puzzle that frontier models missed — and the visual patience it takes to prove a construction is optimal.MathematicsAI researchReasoning & test-time compute+2
0:55EN
3Blue1Brown· 2026年7月24日The 64 Sugar Cubes Puzzle: Six Equal DistancesA 4×4×4 block has three colors; prove that six same-colored pairs share a distance.MathematicsEducation
33:51EN
3Blue1Brown· 2026年7月16日What Cross-Entropy Connects: Compression, Language Models and KL DivergenceGrant Sanderson · 3Blue1BrownGrant Sanderson builds cross-entropy from code lengths and uses it to explain next-token training and distillation.MathematicsMachine LearningFoundation Models+1
スライド2:25EN
3Blue1Brown· 2026年6月12日How Shannon Measured the Entropy of EnglishA guessing game helped Claude Shannon estimate how much information English text contains, and why prediction is central to compression.MathematicsAI History
スライド1:02EN
3Blue1Brown· 2026年6月10日A Robot Walk and the Puzzle of Optimal Binary EncodingHow few bits does it take to send directions that occur with unequal frequencies?MathematicsScience Communication