The query model of computation
Die Seide is noch nich ibersetzt worn. Se guggen de englsche Originalversion.
When we model computations in mathematical terms, we typically have in mind the sort of process represented by the following figure, where information is provided as input, a computation takes place, and output is produced.
While it is true that the computers we use today continuously receive input and produce output, essentially interacting with both us and with other computers in a way not reflected by the figure, the intention is not to represent the ongoing operation of computers. Rather, it is to create a simple abstraction of computation, focusing on isolated computational tasks. For example, the input might encode a number, a vector, a matrix, a graph, a description of a molecule, or something more complicated, while the output encodes a solution to the computational task we have in mind.
The key point is that the input is provided to the computation, usually in the form of a binary string, with no part of it being hidden.
Description of the model
In the query model of computation, the entire input is not provided to the computation like in a more standard model suggested above. Rather, the input is made available in the form of a function, which the computation accesses by making queries. Alternatively, we may view computations in the query model as having random access to bits (or segments of bits) of the input.
We often refer to the input as being provided by an oracle or black box in the context of the query model. Both terms suggest that a complete description of the input is hidden from the computation, with the only way to access it being to ask questions. It is as if we're consulting the Oracle at Delphi about the input: she won't tell us everything she knows, she only answers specific questions. The term black box makes sense especially when we think about the input as being represented by a function; we cannot look inside the function and understand how it works, we can only evaluate it on arguments we select.
We're going to be working exclusively with binary strings in this lesson, as opposed to strings containing different symbols, so let's write hereafter to refer to the binary alphabet for convenience. We'll be thinking about different computational problems, with some simple examples described shortly, but for all of them the input will be represented by a function taking the form
for two positive integers and Naturally, we could choose a different name in place of but we'll stick with throughout the lesson.
To say that a computation makes a query means that some string is selected, and then the string is made available to the computation by the oracle. The precise way that this works for quantum algorithms will be discussed shortly — we need to make sure that this is possible to do with a unitary quantum operation allowing queries to be made in superposition — but for now we can think about it intuitively at a high level.
Finally, the way that we'll measure efficiency of query algorithms is simple: we'll count the number of queries they require. This is related to the time required to perform a computation, but it's not exactly the same because we're ignoring the time for operations other than the queries, and we're also treating the queries as if they each have unit cost. We can take the operations besides the queries into account if we wish (and this is sometimes done), but restricting our attention just to the number of queries helps to keep things simple.
Examples of query problems
Here are a few simple examples of query problems.
-
OR. The input function takes the form (so for this problem). The task is to output if there exists a string for which and to output if there is no such string. If we think about the function as representing a sequence of bits to which we have random access, the problem is to compute the OR of these bits.
-
Parity. The input function again takes the form The task is to determine whether the number of strings for which is even or odd. To be precise, the required output is if the set has an even number of elements and if it has an odd number of elements. If we think about the function as representing a sequence of bits to which we have random access, the problem is to compute the parity (or exclusive-OR) of these bits.
-
Minimum. The input function takes the form