The Quantum Oracle
A quantum oracle is a black-box unitary that encodes problem structure; algorithms like Grover's query it in superposition and count the number of queries as the cost.
A black box you can query in superposition
Many quantum algorithms are stated relative to an oracle: a unitary U_f that computes a function f without your knowing its internals. A standard (bit) oracle acts as U_f |x>|q> = |x>|q XOR f(x)>; a phase oracle instead marks solutions with a sign, U_f |x> = (-1)^{f(x)} |x>. Because U_f is a quantum gate, it can be applied to a superposition of all inputs at once.
Query complexity
In the oracle model, cost is measured in the number of oracle calls, not raw gate count. This is how speedups are cleanly stated: Grover's algorithm finds a marked item in O(sqrt(N)) queries versus O(N) classically, and amplitude amplification generalizes the idea.
The honest caveat
Query complexity hides a real cost: someone still has to build U_f from elementary gates. A quadratic query speedup can be erased if the oracle is expensive to implement, or if loading classical data into the oracle dominates. Oracle-model results are a clean theoretical tool, but a claimed end-to-end advantage must also account for constructing and feeding the oracle.