 So the topic of today's lecture is going to be about the adversary method, the general adversary method. It will be the last method that we will see. But before that, I would like to finish the proof that we started last time about this recording technique. So let me go back to the last slide of last lecture. So if you remember, the goal was to obtain a lower bound on the quantum query complexity of the search problem. And for that, we defined this quantum recording framework. And at the end, we had this projector pi, which projects onto a basis state that have recorded a 1. And we wanted to bound the progress measured delta t, which was the probability of observing a 1 if we measure this state in the quantum recording model. So initially, the progress was equal to 0. And the proof that we started was about showing that it cannot increase faster than about 1 over square root n. So we already show that the increase was, at most, the norm of this particular quantity that we have to bound. So it was what we want to prove. So the claim that we still have to show is that if you take a state after t query, so psi-req-t, and if you project onto the basis state for which you haven't found a 1 yet, and if you do an extra query, then the probability of observing a 1 is going to be at most square root t over n. So this was the last missing piece. So we will actually show something stronger, which is the claim which I wrote at the bottom of the slide, which is actually a stronger claim is that for all state psi, which is in the kernel of the projector pi. So being in the kernel means you haven't recorded a 1. So for all such states, what you'll get is that if you do one extra recording query, the probability of observing a 1 is going to be at most square root t over n times the norm of psi. So if you just plug identity minus pi times psi-req-t into this claim, you get the result that you want to show. So how to prove this claim? So let's take an arbitrary state psi in the kernel. So let's take psi being in the kernel of the projector. And we'll just write down this state as being a sum over all x i b. You have some amplitude alpha x i b. Then you have x containing the record, answered with i b containing the query index and the output register. And if it is in the kernel of pi, it means that the value 1 is not in x. So this is like an arbitrary state in the kernel. And now we will further decompose this state into n plus 2 mutually orthogonal quantum state. So we decompose psi as follows. So the first state is going to be what I denote by psi id. So this just keeps the amplitude for which b is equal to 0. So it's going to be all the x i b such that b is equal to 0. This is the first one. The second one is noted psi empty. So this one is going to be all x i b such that b is not equal to 0. And x i is equal to the empty symbol. And the last n states are going to be indexed by a value y. So for each y being between 0 and n minus 1 and n, we define psi y as being the same except that x i has to be equal to y. So b is non-zero. And x i is equal to y. So the support of these joints, and if you take a summation over all of them, you just recover the state psi. So what we want to do is to bound this quantity here for each of those states. And then we just apply a triangle inequality. So let's start with the first one. So what is the norm when we start with psi i d? Apply a recording query and then project. Does someone have the answer? So psi i d, it was defined as having b equal to 0. So if you remember last time, when b is equal to 0, nothing happened if you apply this recording query. So this is just going to be equal to 0. So I can remind you how this recording query was behaving for each basis state. So when b is equal to 0, nothing happened. So second case, what happened if this is applied on psi 1? On psi 1, let's say psi 1. This is also 0 because psi 1 is equal to 0 by definition. So psi 1 has no support for the projector that we are considering. So those two cases are easy. Then third case is what happened if this is applied on psi with x psi being equal to the empty symbol. So this is an interesting case. So for that, what we will do is we'll just use the first equation, which tells us what happened if we apply error on a position where there is the empty symbol. So this is what we want to compute. So let's do the computation for that case. So what we know is for any state x i b, which is in the support of psi empty, we have the following result. So if we apply a recording query on that state, what will happen by the first equation is that all the coordinates will remain the same, except the highest input coordinate, which will be replaced by the quantity in red. So this is going to be, so let's use this notation x with an i, i b, where it means that this new input at position i, it is equal to 1. And at a position which is not i, it is unchanged. Just a single coordinate is modified in this basis state. So this was for a single basis state. So now, what if we apply that on the full state psi empty? What we'll get is, so when we apply on the full state, OK, so here what I computed is not error. It's like the projection. I just kept the coordinates for which x i i was equal to 1. And you have a 1 over a square root n. So we take a basis state. We apply the operator error defined on the top. And then we project only on the component for which there is a 1 in the support. So if you have the superposition in red, there is just a single term that will be kept. And this is the one for which you have y is equal to 1. And you will have a phase, which is going to be omega to the b. So now, if you apply that on the superposition, you just get a summation over all x i b of omega b over a square root n alpha x i b x. So this is the effect of doing a recording query and then projecting. Now, if you just look at the norm of that state, what you'll get is that this is equal to 1 over a square root n times the norm of the original state. So making one query, just the effect of doing a query is that we have a new amplitude that appears, which is omega to the b over a square root n. So this is how we get this equality. And finally, the last case. So this is for those states psi y when y is not equal to 1. So I'm not going to do the computation. This is similar to what I did. You just have to use a single equation, a second line. What you will show is that this is at most 3 over square root n times the norm of psi y. So in the second case, we have a factor 3 because of this error term in blue that we have when we apply a recording query in this case. So how we conclude the proof? Well, we have all the ingredients. We just have to apply the triangle inequality. So this quantity that we wanted to bound by triangle inequality is going to be, at most, 1 over square root n times the norm of psi mt plus a summation over all y of 3 over square root n times the norm of psi y. And if you apply Cauchy-Schwarz, so this is triangle inequality, and if you apply Cauchy-Schwarz on this quantity, what you get is exactly square root 10 over n times the norm of psi. Is there any question on this proof? OK, so this is all I wanted to say about this quantum recording technique. There are still some subtleties in the proof that I didn't mention. And they will be studied during the problem session. But most of the argument are here. OK, so let's move to the next topic. This is the last method that I would like to show you. This is this generalized adversary method. So today, we'll see the lower one part. And tomorrow, we'll see how this method can give you also quantum algorithms. So this adversary method has some advantages over other method that we showed previously. The first one is that this is always optimal. In some sense, it will always give you the optimal lower bound on the query complexity that you are looking for. As we will show tomorrow, it can actually be turned into an algorithm. On the other hand, it is often harder to apply than other method that I showed you, such as the recording technique. So it is a kind of a generalization of the hybrid method. And also, it is strongly related to the recording technique. So you will see some ideas that we mentioned before to be used again in this method. I guess before describing the method, let me start with two reminders of a result that we already saw in previous lectures. The first one, which we show in the first lecture, was this distinguishing lemma, which tells you that if you want to distinguish between two quantum states produced by the algorithm on two input x and y, then in some sense, you have to have those states being orthogonal to each other, or almost orthogonal. So if the algorithm succeeds, then it means that if you look at the output state, when f of x is different from f of y, then there must be almost orthogonal. The second idea that we saw when we talk about this recording technique was the purification viewpoint, in which when we have a distribution on the input, let's say distribution px, for the recording technique, it was a uniform distribution. Then we can, as well, put this distribution into a quantum state that encoded this distribution into the amplitudes, and then control everything, control the query, unto the value contained into this purification register. And if you trace out this register, you just recover the usual framework that we studied before. So we will use those two ideas in defining the quantum adversary method in a slightly different way. OK, so let's first look at the construction, and we'll see an application at the end of the lecture. So the first step of the construction for the quantum adversary method will be to kind of generalize this purification viewpoint, where instead of having non-negative real numbers for the purification register, we can just take complex numbers in the amplitude. So what we have as input is like a quantum state of unit norm with complex vector. And as before, we just do the same thing, so controlled on the value contained into the purification register, we apply the oracle ox. So this is the same as having sampled the input from the distribution where x is obtained probability squared of the amplitude. OK, on this side, this is a joint state of the purification register, the input, and the state of the algorithm. OK, so we can choose any AX, but you'll see that a particular choice is done in this quantum adversary method. So the second step is to look at the following gram matrix obtained by tracing out the input register. So this is a matrix which is indexed by all possible inputs. And in the entry x, y, what you have is the inner product between the state of the algorithm at time t, when the input is x or y, times the amplitude of those input under the input distribution. Because it kind of encodes all the possible inner product between all the possible state of the algorithm memory. And finally, the last step is to choose and to place some weights denoted by gamma x, y on all pairs of inputs. And those weights, you want to choose them to be important when the pairs of input that you consider, x, y, is supposed to be hard to distinguish. So the way those weights are chosen is part of the application of the method. So two conditions, which seem to be quite natural about choosing those weights. The first one is you expect them to be symmetric. So in some sense, you have the same weight on the entry x, y, under entry y, x. And secondly, when two inputs give the same output, you just take weight equal to 0. In some sense, you don't have to distinguish those input because they give the same output. So this is what we call an adversary matrix. Just saying it again, this is a real matrix, which is both symmetric. And when f of x is equal to f of y, the entry has to be equal to 0. Now, this is how we choose the adversary distribution, given a particular adversary matrix gamma, we choose a to be the principal eigenvector of gamma, normalized to be of unit norm. So this is, in some sense, our input distribution, our hard input distribution. And we will also define the following object, which will be important in the method. So I call them punctured matrices. There is one such matrix for each possible index i between 1 and m. And this is the same as the adversary matrix, except that you remove the inputs, the entries, for which xi is equal to yi. So imagine you are doing a query on index i. Then this matrix is only giving you information about the pairs of input for which you would observe different outcomes for the query. So those are the three important definitions that we will have to manipulate. And now this is how we define a progress measure in case of the adversary method. So it's going to behave quite similarly to the progress measure that we saw in the recording technique and the hybrid method, but slightly more complicated to bound. So this progress measure is, again, defined at time t, so after having done t quantum query. And there are two equivalent definitions. One is obtained by taking this joint state psi t of the input and the state of the algorithm. And the other one is by taking this entry-wise product between the adversary matrix gamma and the gram matrix that is displayed here. So the two definitions are equivalent. So far so good. So now we can prove some results about this framework. So those are the three most important statement about the adversary method, which tells you how the progress evolve when you make quantum queries. So as before, you will have an initial condition. So initially, the progress is equal to a certain quantity. Here it's going to be the spectral norm of the adversary matrix. Then you have a final condition, which is implied by the algorithm being correct with probability at least 2 third. Here it will be that at the end, it must be smaller than the spectral norm by a factor of, let's say, 0.95. And finally, the last lemma is how much can you decrease this progress measure by doing one query. And this will be related to the spectral norm of those gamma i matrices. Because if you have those three results together, it tells you something about how many steps, how many queries you have to do in order to solve the problem that you are considering. Okay, so let's prove each of those three results separately. So once again, it doesn't tell you how to choose the adversary matrix gamma. It just tells you that once you have chosen a particular matrix gamma, adversary matrix gamma, you can obtain such types of inequality. But of course, finding the right gamma is one important part of the problem. Like it will depend on which function you want to solve. Okay, so let's start with the first lemma. This is the easiest one. So let's just look at the definition of delta 0. So this is the initial state psi 0 that we have to compute in this inner product. So psi 0, by definition, this is the joint state of the input on the algorithm. So for the input, we have taken the adversary distribution A, which corresponds to the quantum state that encodes A into the amplitude. And the initial state of the algorithm is just the whole zero state. Okay, so delta 0 is just equal to A times 0, 0. Then we have gamma times third identity. And then again, we have A times 0, 0. Okay, so this is also A gamma A. And because A was chosen as being the principal eigenvector of gamma, this is a spectral norm of gamma. So this is why choosing A being the principal eigenvector was important. This is the choice that maximizes the initial progress. Okay, second step is about proving that at the end, delta T, the final progress, has to be sufficiently small if you want the algorithm to be able to succeed, with probability at least two-thirds. Okay, so let's define first the projector that can be used to characterize the success probability. So projector pi success. So given psi T, I want to project onto the space that characterize the success, the algorithm having succeeded. So what I do is I take a summation over all inputs, X, okay? Then I have identity, because the success does not depend on what is in the index register. And finally, in the last register, on input X, what I want to have is f of X. Okay, so you succeed if you manage to have f of X in the last register when the input is X. Okay, so the success condition. So what does it mean that an algorithm succeeds probability at least two-thirds? The success condition means that if you apply this projector on your final state, so psi T after T quantum queries, it has to be at least two-thirds, so the squared norm. Okay, so this is what we can use in doing the proof. What we will use. So, okay, so having that in mind, let's try to upper bound the final progress. So delta capital T. Okay, so first just to recall the definition, this is psi T, gamma-transferred identity psi T. Okay, so what we will do first is we will decompose this into four quantities as follows. So what we will do is we will split, we will add the projection by success and identity minus pi success in between psi T, the inner operator and psi T again. Okay, so this is what I mean by that. So we'll have psi T, pi success, then gamma identity, pi success, psi T. So this is the first term and then we just have to add all the possible other terms. So the second term is going to be the same, but here we have identity minus pi success. Okay, gamma identity, then identity minus pi success. This is the second term. And then we have the cross-terms. So the third term is going to be identity minus pi success and here I have just pi success. Okay, and then I do the same thing but the other way around. So here I have pi success and finally identity minus pi success. Okay, so I also apply the triangle inequality to do this decomposition. Is it clear to everyone why we have such an inequality? Okay, so we want to bound each of those four terms separately, so there are two easy cases which are when we have pi success on both hands or identity minus pi success. So those two terms are equal to zero because... So this is equal to zero and this is equal to zero. Okay, and this is because we have this constraint that gamma xy is equal to zero when f of x is equal to f of y. Okay, so in some sense only the cross-term will matter. Okay, so this is the result for which the first two term are equal to zero. Okay, so we just have to focus on those terms. So let's continue the proof from this step. So delta t. So by applying Cauchy-Schwarz inequality we can split each quantity into two parts. And what we'll have is two times the spectral norm of gamma and sub-identity, then the projector pi success apply on psi t times the projector identity minus pi success apply on psi t. Okay, I just use Cauchy-Schwarz inequality on each of those two quantities. And in both cases I obtain the same thing. So this is why I have a factor two and this is what I get at the end. Okay, so we are done because we can write this as follows. So the spectral norm of gamma turns out identity is just a spectral norm of gamma. So this is two times the spectral norm of gamma times this pi success apply on psi t. And then identity minus pi success, this is also one minus pi success apply on psi t. Square might take a square root. It's just writing it differently. Okay, so now we can just conclude by applying the success condition which tells us that this success probability is at least two-third. So if we apply it on this last term, it tells us that this is going to be at most two times spectral norm of gamma times square root two over three. Okay, so this is the proof of the second lemma. And finally, the last part of the proof is to show the increase condition, okay, which is that when you do one query, the increase, the decrease is at most two times the largest spectral norm over all the gamma i. Okay, so let's prove this last result. So this is the lemma three. Okay, so what we want to bound is the progress at a time t minus the progress at a time t plus one. This is what we want to upper bound. So we might as well take the absolute value of this quantity, which by definition is going to be psi t, gamma identity, psi t. So I just upper bound the difference by the absolute value of the difference. Okay, so psi t plus one, how do you obtain this state? Well, you first apply a query and then you apply the unitary ut plus one. But ut plus one and gamma times identity commute, so you can just remove this ut plus one. And so this is equal to psi t, gamma, and solid identity psi t minus psi t. Then you apply just one query, gamma, and solid identity, a query again, and you have psi t. Okay, so if I just expand the definition of psi t and gamma, this is also equal to a summation over all x, y. Then I have gamma x, y. I have ax, ay dagger. And then I have psi x, t. Let me write it on the other board. Again, just expanding the definition of gamma and psi t. So this last term is equal to a summation over all x, y of the x, y entry of the adversary matrix times the x and y entry of the adversary distribution. And then you just have the state of the algorithm on input t, on input x, times identity minus o x, o y. So the oracle corresponding to input x and y. And then again, the state of the algorithm on input y. Okay, so a claim. So we want to understand what this operator, identity minus o x, o y is doing. So my claim is the following. So identity minus o x, o y is actually equal to a summation over all index, all query index such that xi is not equal to yi of a projection on index i, turns out identity minus the not gate. So this is kind of reminiscent to what we saw in one of the proof for the polynomial method. Okay, so this, it is just supported over indices for which the query is giving you, is giving you a different outcome. And then you have identity minus x. Okay, so, okay, I'm not gonna prove this claim. You can just do it in a case-by-case analysis. It's very simple exercise. Okay, so let's use this claim to continue the proof of the upper bound on the difference. Okay, so now I can replace this identity minus o x, o y by this summation. So it means that now I have a summation over three quantities, so x, y, but also a summation over all possible query indices i. Okay, and then, so the summation is only be supported over i such that xi is not equal to yi. Okay, because this operator otherwise is equal to zero. So equivalently, I could just take a summation over all x, yi, but instead of having the gamma matrix, I could have the gamma i matrix. So this is where the gamma i matrices appear, okay? Because gamma i is zero when xi is equal to yi. Okay, so this is why we had to introduce those gamma i matrices. So I have the same summation as before, except that gamma x, y has been replaced with punctured matrix. Okay, so then again, x, a, x, i, y, dagger, then xi, x, t, then i, i, minus x, and then xi, y, t. Okay, so we are almost done. So what we want to do is we want to apply again a Cauchy-Schwarz inequality on this term. So, okay, it's not immediately obvious how we should apply it. So let's just express this quantity in a different way, which is gonna be more convenient to manipulate. So this is equal to, or this is at most, okay? Let's put the summation over i outside the absolute value. So this is at most summation over i, here then absolute value. And then we have xi, t, so the joint state of the input and the algorithm memory. Okay, on which we apply this i, i projector, transferred a square root of the node gate. Okay, then we have gamma i, transferred identity. Okay, then I again apply i, i, square root x, psi, t. So this is for the x part, and I also have to take into account, I think I'm missing a factor two in the equation, so I think we should have a factor two. Yeah, yeah, so I have an identity missing somewhere, I guess. Let me see. Oh, I see what I'm missing. So I have that plus the same thing, but instead of x, I have identity. So I have that, plus the same thing, but instead of x, I have identity. Okay, so I just apply Cauchy-Schwarz on each term independently, so I will have two times. So the square root x will vanish in the process, so we have two times. Then summation over all i of the spectral norm of projection on i, transferred identity apply on psi, t, square. Okay, multiply by gamma i, which is inside the, okay, so I can just pull out this spectral norm of gamma i by taking a maximum. So this is two times the largest spectral norm of the gamma i, maximum over i, times summation over all i of projection on having i, i in the first index, psi, t, square. Okay, I just upper bound each individual spectral norm by the maximum to put it outside. Then it just remain a summation over all i of those projectors. And now this quantity is exactly equal to one. Okay, so this is equal to one. Okay, so what remains at the end is just two times the largest spectral norm. Okay, any question on this proof? Okay, so let's move to the next part. So if you just put those three lemma together, then you arrive immediately at the following result, which is that the quantum quick complexity is always larger than the following quantity. So you take a maximization over all the possible adversary matrices because the proof was done for any adversary matrix. And if you combine those three lemma together, you obtain that this is at least the norm of gamma over some constant time, the largest spectral norm of some puncturn matrix, gamma i. Okay, so you want to choose the best possible adversary matrix that would maximize this right-hand quantity. So of course, the natural question is how to choose this gamma matrix. So there is no general recipe, but there are some property that we can, some property that we can say about certain types of choices. So the first choice would be to only look at adversary matrices that are non-negatives, for which each entry is non-negative. So this is quite close to the hybrid method. And it has been studied, I mean, this is the first type of adversary method being studied. So one advantage of this type of choice is that it has a nice combinatorial interpretation that you will see in the problem session. But on the other hand, having non-negative entries implies some strong limitation on the type of lower bound you can show. So in particular, there are two types of barriers that you cannot break with this type of adversary matrix. One is the so-called certificate complexity barrier. So in some sense, if your function has not a nice certificate complexity, then you won't obtain a good lower bound with this method. An example of such a function is the element distinctness function. So it will not give you optimal lower bound. And the second limitation is the so-called property testing barriers, which tells you that if the input to your problem satisfies some kind of property testing properties, meaning that inputs for which output has to be different that far apart, then again, this method is not gonna give you optimal results. So if you want to kind of break those two types of barriers, you have to move to a more complicated and maybe less intuitive adversary method in which you have to choose certain entries being equal to zero. So this is called the negative weight adversary method. And with this type of choices, it's possible to break those two types of barriers. And actually, you can do even more than that because it has been shown that if you choose negative and positive entries, then there always exists a choice of gamma that will achieve the optimal quantum query complexity. Okay, so not only it is a lower bound, but it is also an upper bound. There is a matrix gamma that will exactly give you the right quantum query complexity. So we'll see some implication of this result in next lecture. And in particular, we will see a constructive proof of this result, meaning that if you give me an optimal adversary matrix, there exists a way of turning it into a quantum query algorithm that matches this complexity. Okay, so it's like a really beautiful result, I think, and this will be the topic of tomorrow's lecture. Okay, so maybe let me just take one minute to give you a very simple application of this adversary method. And you will see other application in the problem session. So this is just for the or function that we already saw in previous lecture. Again, just focusing on the hardest inputs. And in that case, this is what is an optimal choice of adversary matrix. So for the gamma matrix, it is gonna be equal to zero everywhere, except in those entries. So for instance, in the entry indexed by the all zero string on the string containing one at position one, you will have a one in the adversary matrix. Okay, so this is really the most intuitive choice of an adversary matrix. So it is symmetric, and you just put a weight equal to one when you have a pair of hard inputs to distinguish. Okay, and gamma i is represented on the right. It's almost all zero matrix. That is just two entries equal to one. And if you compute the spectral norm, you will see that you will obtain square root n and one. So the theorem implied that the query complexity is at least square root n over some constant. So just to give you a flavor of tomorrow's lecture, how to prove this optimality of the quantum adversary and how to turn it into a quantum algorithm. This will rely on using SDP duality theorem. Okay, so it turns out that this right hand quantity is an SDP. And when you have an SDP, you often want to look at its dual. And by looking at the dual of this SDP, we will be able to both prove the optimality of the method and construct an explicit quantum algorithm. Okay, with that, I conclude the lecture. Thank you.