 All right. I guess we should start. It will be. We're going to be here just 10 minutes. I just am finishing the first one. And then I'll be across. Thank you. Yeah. So thank you, guys. We're only going to be here a few minutes. I just wanted to finish the last couple minutes of that previous lecture. And then we'll go into the tutorial room to go and do real computing. So where I finished was explaining just sort of listening for you a bunch of NP-complete problems. And let me remind you what an NP-complete problem is. A problem L is NP-complete if it is in NP, which means it's verifiable. And if all problems in NP can be reduced to L. And this is why NP-complete problems are so interesting, because if you could solve any of them, you could solve everything. Solve any one of them, you could solve all of them. So let me now actually go through and tell you what this three satisfiability is. This is sort of the prototypical example and why it's NP-complete. Just briefly, it should take 10 minutes. And then we'll go to the other room. So first I needed to find a few what 3SAT is. I'm going to do it in a physicist language. So here is my 3SAT. Here's the question. Does the, let me emphasize classical. So this is ising spins, but no transverse fields or anything like that. Does the classical energy function or Hamiltonian h equals sum over interactions? So I have some number of interactions that depend on three bodies. So ising is usually two body. This is three body. Actually, I could basically, or this is basically just to make it a little more familiar. This would also be like using i j k, j i, j k, sigma i, sigma j, sigma k. So I can have three body interactions here. No, not with the definition I'm about to give. This was, think of this in your head as three body interactions, but that's not actually what it is exactly. So does the classical energy function this acting on n binary variables or ising variables, just two state variables, where em, each of these terms, is either 0 or 1, a state with energy. So this is called a satisfying state. I've said that all the terms are 0 or 1. So the energy terms all give you either 0 energy or penalize you by 1. And I want to know, is there a state, which is a configuration of all the n spins, such that all of these are 0? It's the only way I can get a zero energy state. We call that state a satisfying state. So that's just language. So this is with energy 0. This is also called satisfying. So just an example to have in your head or help visualize it is maybe I have circles represent the spins or the qubits, sorry, not quantum. Maybe I have four. And then there's an interaction, which is a three body interaction, between sigma 1, sigma 2, sigma 3. So this would be like E1 is a function of these three. And maybe E2 involves those three, 2. And for example, E1 could penalize any state with, say, sigma 2 equals 1 and sigma 3 equals 1. So I can just specify by telling you which states it doesn't like involving the three spins that it touches. That's all. It's very general, actually. And E2 may be something else. Sigma 3 equals 1, and sigma 4 equals 1. So what do we need to show? We need to show that three sat, this problem, is an NP and that everything else can reduce to it. So the first thing that we're going to show is that it's an NP. So three sat is in NP. Why? That's right. So Merlin can come along. And if he can produce a satisfying state, which is a zero energy state, he can give it to the verifier. And the verifier evaluates the energy and checks it's zero. So it's easy to prove that it is satisfying, satisfiable. And that's all we need to show. So just Merlin gives verifier the sigma such that E of sigma equals 0, or h, I wrote, right? H of sigma equals 0, OK? And verifies that's efficient. So then complete. So I need to show that any problem in NP can be reduced to three sat. Now, how can I possibly do that? To show something is true of any problem in NP, I can only use properties that all problems in NP share. So what is the property that all problems in NP share? They have a verifier, right? So every problem in NP has a verification circuit, which takes as input. So what I want, reduction from arbitrary NP to three sat, OK? So what do they have in common? Only thing have in common is a verification circuit, which is of polynomial size, verification circuit of poly size. So let's draw that. My proof is a picture proof. It's the only kind of proof that I like. So what does that look like? It means that I have a circuit. And at one end, I put in a proof. So there's a bunch of lines. These are classical lines. But you might be able to tell that most of this will generalize to quantum with a bit more work. I'm not going to do it today. But I have a proof, which is some polynomial size thing in the input. And then there are gates. So things like this, right? Not and maybe there's an or. I'm using some kind of circuit notation. Maybe they split out again. So I have some set of gates. This is my sort of general circuit, OK? And at the end, I get out at the bottom a line. And this line, maybe it comes out from some final gate like this, is the accept reject output. That's my output. And here, my proof is the input. It's my verification circuit for some problem A. It's something. I know it exists because it's an NP, right? So now, let's just label. Let's label every line. Every line during an operation of this circuit takes a binary value. So I can maybe say there's a time. And then I say this is time 0. Here's time 1, 2, 3, et cetera, right? It's a number of gates. And I can just label. I can say that this is sigma, some input proof configuration. It's not the original sigma. So it's some bit. Well, yeah, sigma. And I'm going to label it as this is the top. So let's say 0, 0 for the time. And this is sigma 1, 0, and sigma 2, 0. And here is sigma 0, 1, because t is 1, and sigma 1, 1, et cetera. So I can label everything. And then instead of viewing it as a circuit, we just view it as an interaction graph. So label every wire with a binary variable sigma it, which is an internal, it's like an internal variable, and view circuit as interaction graph or a three-set graph, three-set interaction graph. What do I mean by that? I look here, say, and I see that sigma 0, 1, sigma 1, 1, and sigma 0, 2 all come together in an AND gate. And so I write a term in some Hamiltonian, which includes E of sigma 0, 1, sigma 1, 1, sigma 0, 2. And this is an AND. And the point is that I can put, and there's going to be more, 1 for every gate. And I can put in here anything I want. But what I say is that if this output is the AND of these two inputs, the energy is 0. And if this output is not the AND of these two inputs, the energy is 1. And I'm penalized. So what I did was I took this verification circuit and I'm turning it into a giant instance of satisfiability. It's going to be a Hamiltonian with three-body interactions because gates, which take two inputs and one output are universal for classical computation. So I can always draw the circuit using only three bodies. And I'm going to get a giant Hamiltonian. And what that Hamiltonian represents, or configuration represents, is an operation of the circuit that might be faulty. And if it's faulty, I pay. But if it's not faulty, I get zero energy, OK? Good. So now the only other thing I need to do is add a term here at the end, which says I want the output bit sigma n, whatever, sigma 0 comma n for capital T final, whatever, the output bit. I want that to be accept. And I can make it, I mean, one body is a subset of three bodies. So that's OK. So I can basically say, and I want a term which looks like sigma output at T final is accept. So this is what I want. So what do I mean by that? I mean that I set the energy to 1 if it's reject. I set the energy to 0 if it's accept. So think about this Hamiltonian I've just written. I know if I put a set of bits here, which are a yes proof, then I operate the circuit correctly. The circuit will output accept, which means that there is a configuration of all the wires, all the variables with zero energy. I don't know what the proof is. I'm just saying it exists. I mean if the proof exists and this exists, I put that at the input. I have this operate correctly, get this at the output, and that would correspond to a zero energy state of this Hamiltonian. If the system is a no instance, then any proof I put in here, anything I put here, would be rejected by a correct operation of the circuit. So either I have correct operation, which means that all of these terms associated with the internal gates are zero, but then this would be reject. Or this will say accept, but there'll be an error somewhere inside. I made a mistake in the operation. So thus, basically, I mean you may want to think about it, but it is really just this picture. Yes, instances map to satisfiable history circuits or Hamiltonians, that is ones with zero energy. And no instances, always the ground state energy is above zero. That was clear, but that's it actually. That's the entire Cook-Levin theorem. They formalize it a lot more carefully than I did. But yeah? Did you do something to do with the accuracy of what you're doing with all this? Is it kind of similar or not? No, so this is a proof using a circuit model for computation. So I'm saying, I'm assuming that my verifier can always be expressed. Remember, by Church Turing, I can take any classical computation and simulate it with any other model for computation. And in particular, the circuit model can simulate the Turing machine. I'm being a little bit sloppy, but it can. So I'm just showing you a proof using the circuit model. So I know that my verifiers always exist with circuits. And I can turn those circuits into instances of the Hamiltonian. And then I can ask the question, does this have a satisfying state? So maybe the verifier is a Turing machine. So maybe the Turing machine is a Turing machine? Yeah, I mean, you could frame it with Turing machines. You don't need to. You could just say, I start with a circuit model. Why do you find maybe my verifier an all-end size gate? So it's very complex stuff. So the point, of course, is that the verifier is polynomial time. So the most number of gates it can have in it is polynomial. And that means that the number of terms here is polynomial. Doesn't matter. Again, I can't have something which is more than polynomial high, because I wouldn't be able to use all those inputs. So that turns it into a polynomially large instance of satisfiability. So more or less, I just wanted to show you this picture, a couple of comments. So 3SAT is NP-complete. I had that list of NP-complete things. So those are sitting out here. Again, if you could solve 3SAT, I didn't show you that it couldn't be solved. I just said it's NP-complete. So if you could solve it, you could solve everything. Same of traveling salesman, et cetera. I didn't prove that to you. There's a completely analogous story in the quantum case. There are problems which are called QMA-complete. So in the quantum case, there's something called quantum satisfiability. So 3-quantum-SAT is QMA-complete. And the most general case is local Hamiltonian, is what it's called. And this is, if I give you a Hamiltonian, which is now, say, looks just like this. But these things don't have to just be classical functions of the bits. They could be quantum operators on the bits. So they don't have to commute. And if you ask the question, is the ground-state energy of a general, say, three-body or four-body Hamiltonian below some threshold, that is QMA-complete. So it's supposed to be hard for this giant-class QMA in the same sense that 3-SAT is for NP. That was more or less what I wanted to tell you. Any questions about it before we go in the other room? Yeah? You give an example of a problem that's not NP. Are classes a problem? It's not NP? Yeah, so is the ground-state energy of this Hamiltonian three? Classical. Sorry, energy function. Say it's an Ising model, even. The ground-state energy of this classical Ising model, three. Because someone could give you a state which has energy, three, but you'd have a very hard time checking there wasn't a state that was lower. Now, it can be verified in general. You could check all of them. So it's a verifiable problem, but it takes exponential time to check everything. So it's not efficiently verifiable. So it's not a crazy problem. It can be checked. It just can't be checked in any efficient way, unless you know a lot more structure. It's paramagnetic or something. There are simple cases where you can do these things. But in complete generality, just is the ground-state energy of this Hamiltonian three? You'd have to check. It's hard to verify that the ground-state is this one. Sorry, say that again. Why can't I just evaluate the energy and see if there is three in the polynomial or a state? Oh, you can do that. But how do you know that's the ground-state? What are you supposed to give me? I don't trust Merlin. I can check that the state that's given to me has energy, three. So that's why I always said, the NP problem is, is the ground-state energy below something? Because then I can just evaluate a state. I don't need to know that it's actually the ground-state. I just know the ground-state will always be no greater than whatever I look. It's variational. But if I say, is it exactly three, then I need to know that there's no state lower. That's very hard to prove. That takes ex, well, naively it takes exponential time to prove that. You have to check. You have to use the silly algorithm. Yeah? What is NP hard? Because they always use NP hard problems. So NP hard is this half. So if you have a problem which isn't necessarily an NP, but is as hard as everything in NP, everything in NP can reduce to it, then it's NP hard. If it's also an NP, it's called NP complete. That's just the definitions. So NP complete required it to be in NP. NP hard doesn't. Let's go talk about Python.