
Wolfram Research session with Speaker A and Nick building quantum circuits from scratch. They cover Hadamard gates, Pauli operators, rotations, controlled gates, and measurements including POVMs, which can produce more outcomes than the dimension of the system.
Chapters
Thank you, Cassidy. Like, you know, as she mentioned, like, you know, please feel free to interact with us via that community post. You know, if our explanation is not understandable or if there is a still gray area, do not hesitate to repeat your question. Let me know. Before joining Wolfram Research, I spent like, you know, more than 15 years of my life just being academia, being an educator. So the, at least, the least that I learned is when it comes to learning, you know, you really need to be patient and being ready to repeat and repeat and repeat and repeat. So don't be shy asking the same question over and over again. We don't mind explaining that. At least I don't mind. Maybe, maybe Nick would say learn it yourself. But like, you know, it's. Yeah, I'm teasing you. Like, you know, because Nick, you know, growing up with a different, like, you know, education system, both of us completely different. So that interaction is interesting. So what our plan for today? I know, like, you know, quantum circuit operator, very interesting function. Many of you, you want to learn more about that, those beautiful diagrams and et cetera. But when it comes to the algorithm development, when it comes to the circuit design, behind the scene is operators. We really need to have a better understanding of like, you know, how we can construct our quantum operators. So that's why like, you know, today we are going to focus more time and do some problem solving with quantum operator. And then once we master these skills, shifting to circuit would be very straightforward. Let us start with the first question. Create a uniform superposition of 8 qubits using quantum state function only. Okay. Like, let's see how Nick would tack so he would disturb the quantum state. So you see, like, you know, the, the, the, the immediate things that comes to our mind is that like, you know, if this is one of those famous ones, you know, it has a named state, which is uniform superposition. And the second argument, it tells you, it tells you the number of qubits. Okay. And you can see like, you know, when we say qubit, meaning that, you know, all of them are in two dimension. Okay, next, next, let's see how we can create that using, you know, Hadamard oper.
Support this notation, right?
Yep. So there are two ways. So like, you know, here we know, like, you know, those of you are familiar with, you know, a uniform superposition, you can create it by applying Hadamard. So what, what is happening here is that like, you know, we are saying, you know, Hadamard operator act on 8qubits. And then remember, if you want to apply it on a register state when all, all the qubits are in the ground state, you can either specify it explicitly or if you just like, you know, apply that quantum operator on. Let's do it explicitly. Register state of eight qubits. And you're going to get, you know, your uniform superposition.
Literally an 8 qubit one.
Okay, interesting.
This one. Did I break it? Hold on.
So the only like, you know what register state, like you know what's happening there is that you are giving like, you know, that list is basically tells you like, you know, what is the dimension of, you know, each of those, those quantum states. We are saying that you know all of them. So it's very odd to have like, you know, those particular log, you know, features. But, you know, that's what's happening here. Now the easy way. We can also show the easy way. So you just don't need to specify your registered state, just quantum operator. And then, yeah, that's like basically, which is almost always. This is what's happening. In most cases you design your operator or your circuit and then you apply it on a register state. So don't bother with the specifying the register state because behind the scene we understand all the dimensionalities and everything. And that piece of code is exactly the same as line 23. So we understand that like, you know, you want to apply it in a register state. And then the dimensionality of that register state, we get it from your operator. For example, if you, I don't know, let's apply the nine qubits automatically. We understand that like, you know, okay, so behind the scene is nine qubits. And you can easily see that like, no, it's nine qubits. So that's one common thing that you would see, you know, in, you know, whenever we want a uniform superposition, just apply Hadamard. One quick comment. This is one design. Another design for applying hadamard on 9qubit is to specify that in the order of your operator. So let's also show that just, just, you know, for the sake of explanation. So you can go with Hadamard and then you can say applied on, for example, eight qubits. This form is exactly the same as the form above that Those two operators are literally the same thing. So there is no difference between them. Of course, the main reason that we added the above design is that it's easier. But if those of you who like to work directly with the order, that's how you can work with the order. Because if you specify that, you know, in the Way that we did it above the Automatic order is 1 through 8, 1 through 9, whatever is the number of qubits in the order you have the possibility of like you know, applied on whatever qubit you want to apply it. But both of them are the same. Okay, move on to the next question. The next question tells us like, you know, why, you know, whenever we talk about poly Z, why you know, many people, you know, many literature, they call it phase flip. What's happening there? It's literally as you can see, it's like adding a negative phase whenever you have your one state. For example, I can apply that state A and B and look at the formula, it's become negative. Okay. And that's exactly the same way that like you know, when it comes to phase flip error that can be caused by an environment, it's like applying randomly poly Z on one of your qubits. It's just you're flipping the face of like you know, that, that qubit. Okay, let's move on to the next one. So that's a very generic rotation. So we have an arbitrary unit vector N which is basically we can say nx, ny and nz and it says how we can create the corresponding generic rotation. So that's the rotation around that unit vector N with a given angle theta. So let's see how we can construct.
That operator like from built in construction selection manually.
Let's see like, let's look at both ways. Like you know, we can like, you know, go.
If I knew nothing about how our things work, I would do something like table polymetric stuff or maybe at least quantum operator. This is my paula. Create free Pauli operators. Just put a new one like that. I would just exchange it I guess exactly the same structure.
So that's one approach that's basically the manual way of constructing that. Okay, that's fine. Now let's go with the shorthand version. There is an easier way of constructing that and as you may guess there is a reason this is called rotation. So we can go with our build function. So for any rotation you have to specify the angle. That's the second argument. And then the operators that you want to apply.
Actually just add them up.
All of them and then in front of each one there is coupling nx, ny and nc.
Something like this. Is it the same way? Same thing, Yeah.
So which way is easier? Like you know, again like you know, depends when it comes to circuit design, especially for the circuit. Of course, you know the last option online 38, that's much easier way of you know, constructing that. So you see, like, you know, the first argument we are specifying rotation, then the angle, sometimes that angle, you know, when it comes to the coupling, we call it like, you know, basically the strength of your coupling and the operator that you apply on. Does it understand? Yeah, that's even better. So that's much more straightforward way of doing that. Okay. And by the way, like, you know, because like, you know, these operators, they do not commute. You cannot write down the exponential of summation as multiplication of exponential. Here we cannot do that. You know, this is one of those examples. Okay, let's move on to the next one. What you see here, like in some literature they call it canonical gate. That's a very common gate. You can easily show that with some additional qubits. This two qubit gate, any two qubit gates, eventually you can write it down in this form. So. How we can construct that first? The first approach that Nick is trying is constructing the operator, the exponent component. And then you can wrap it around like, you know, your ex. You can wrap exponential around that. Okay, so that, that's one approach that you can do it. Another approach would be like, you know, okay, this is the family of like, you know, rotation operator. So the only thing that you have to remember is like, you know, remember by definition, like, you know, there that angle is PI. So it's like, you know, PI over half. Like, you know, that one half is automatically included. So that's the second way of, like, you know, the shorthand way of, you know, specifying that canonical gate. And by the way, like, you know, one other comment. When we say xx automatically, our framework understands that it means poly X on the first qubit, Pauli X on second qubit. That's how like in our framework, you know, interpret that. You see here, like, you know, in this, you know, notation that we have here, we haven't specified any order because so it's 2 qubit behind the scene. You know, we understand it as like, you know, look, it is acting on X on the first one and then X on the second one. So that's how, that's literally how we would interpret that. And of course, like, you know, in case we have other examples, just be patient, like, you know, we are going to show you some other examples. Next question. Like, you know, that's like, you know, another, you know, common, like, you know, you would, I forgot what's the name of like, you know, that interaction. But you know, it's very common when we are, you know, starting or givens yeah, givens. Yeah, it's there. Silly me. So again, two approaches. You can create the exponent directly, or this time, let's go with our rotation operator. You see, again, three arguments. The first argument, you are saying what family of unnamed operators, then the coupling or the angle and then the type of operators that you want to apply. So that's like, you know, a very straightforward, like in a way of, you know, creating that given skate. Givens operator. Okay, Next one. Like, you know, you would see the lot, especially for variational approaches like, you know, the power gates, poly power gates. So it's literally like poly operator raised the power. It says, you know, show it that, you know, it's the same as rotation along the same angle. And. Let's go with. So for the rotation, there are two ways, like, you know, you can. Either go with the generic definition of the. Now you just wrap it around, you know, simplify. Maybe it gives you.
It depends. Maybe.
Or we can, like, you know, go with the full simpler. Yeah. Similarly, maybe it's easier if we wrap. If we ask. Yeah, that one to be. Maybe go with the exponential to trick. Maybe those functions helps us to show explicitly that these two are the same thing.
I sure, we're doing the same thing.
Yep. Let me double check that. Yes, they are the same thing. Poly. Let me just implement it on my end. Yep, they're the same thing.
Does this satisfy? Always? Wait, we are missing some constant.
Oh, now, good point. Like, you know, it's. So that. That was like, you know, I totally forgot, like, you know, why I added this example. Now, when you are working with a framework and any other, you know, quantum frameworks, you will have. Anna, I'll come to your question very soon. You will have this issue that, like, you know, sometimes we say two gates are equivalent, but this equivalency is always up to a phase. Okay. There is always an overall phase showing that, you know, these two things are equivalent. So in many literature, we do not say that explicitly. We would say that, you know, look, you know, polypower gate is the same as, like, you know, rotation by a given angle. And then we would tell that, you know, okay, so they are the same because the overall phase is not included. Now, if I remember correctly, the overall phase is EI half of PI T. That's. That's what I remember. Like, let's just try that. Let's see, like, you know, it gives us the same answer.
What, what, what was the phrase?
Exponential E to I half PI T. That's the. Yeah. I PI over 2 and t. I think like, you know. Yeah. If I remember that correctly. Yeah, that's, that's the case basically. But like, you know, in the literature we, we don't tell you that. Like, you know, in the literature, like, you know, what we would tell you is like most of the time is saying that look, these two are the same. Like, you know why these two are the same? Because overall phase is not observable in quantum. Yeah. Okay, next, so the nini, there's a question. You know, they run that quantum operator r&n.xyz and they get iteration limit error.
Probably because N is undefined.
Yeah. So make sure like, you know, and look, you know, Nick, define N as. As a list. So Anna, try that and let's see. Like, you know, you shouldn't get an error anymore. So define.
We should evaluate to this into that sum. Yep.
Yeah.
Otherwise if you clear it, this is not a valid operator. Basically what you should have a valid operator here and it's not evaluates to anything. So it's kind of, it should be a failure, not a bunch of messages. Because I, well, it depends. It should be better. I. I'm improving message messages every day. Maybe you update the packet. It would be a little bit clear what's happening here, that this is not a valid operator. Yeah, that should be a proper message there.
Analog. You know, he is also, you know, answering your question. Okay. Another interesting thing that you would see among all the operators in the literature. Sometimes they call it fractional phase shift gate, which is basically a phase operator with that 2pi over 2 2n. So how we can phase shift. Yep. And then N. So remember like, you know, whenever there is something common. Very likely, very likely. Like you know, we have it, you know, in our 2pi over. Yeah, very likely. Like, you know, it is already like, you know, in our framework. Okay. So either you can construct it, you know, like needed phase and then the corresponding angle or check if it is a named operator like you know, that we have in our framework. Now it says like, you know, If n is 1, like trivial. But like just check, let's check it quickly like you know, phase shift one. Let's see if it is the same as poly. Z. And of course like, you know, you can do the same for two and three. Okay, so that, that's another common thing especially for like, you know, Nick, just show it's quantum Fourier transform circuit, the simplest one. This is like, you know, where the, this shift. That's, that's where you would see it a lot. So like you Know that green color and with the circle, that's the. Basically the notation that we use for phase shift.
Controlled phase shift.
That's controlled phase shift. Yeah. Okay, so let's see. Next question. Next question is like, you know, it would have been much better if we discuss about it immediately after that Pauli Power. But anyhow, like, you know that we can also discuss it here. Remember, like, you know, an overall phase in front of quantum state is not observable. Okay. So like, you know, that's why like, you know, if you add a global phase in front of any quantum state, you can easily test that. You can see like, you know, the. I don't know, let's create a quantum state and random few, let's call it something state, whatever. Now remember we have an operator global phase. Let's just apply global phase in front of that with an angle, whatever angle we like. And let's apply it on our state. So like, you know that that's the whole thing. Like you know, you see, like, you know that that is not observable. So basically like, you know, it's, you.
Know, how do you want to test it?
Let's see. Test it. Is everything the same? Because it's, you know, symbolic. Let's test it. If it's the same as state or we need to give a numerical value.
We don't test enough to phase, right? Yeah, for states we do.
Yeah.
All right. Yeah.
So you can test it like this. And that's. I know it's a source of confusion, but pay attention in the literature, for example, when you look at the metrics representation of some gates in our framework and compare it with some, I don't know, somewhere, another paper, you may notice that there is an overall phase difference. And it's confusing. We say, okay, there is an overall phase. Why people are not explicit about this overall phase difference? It's only because.
Make sure that we are not testing phase four operators. Yeah, just make comment.
Yeah, it's for the state. Yeah, the, the reason that like you know, people, they do that is only because at the level of operators we know that they are different. Exactly what Nick is showing here, like, you know, when you're comparing the operators, the formula for the operators are the same, but because an overall phase on the top of quantum state is not an observable. Many times people, they just don't care about them. So pay attention. Like, you know, this global phase, they can cause some headache when you are dealing with some circuits or some specific definition of like, you know, rotation, operator and et Cetera especially you may see it a lot when it comes to rotation operator. So for rotation operator, like, you know, sometimes like, you know, there is an overall phase difference between the definitions that we have and the definitions that you may see in other textbooks. Okay, so let's see, creates the inverse, so V gate, which is again like, you know, there inverse is basically conjugate transpose or dagger of that. How we can create that. So it's literally put this work. So let's check if it's the same as dagger. We can check that. I never test that. Okay, that's interesting. So why it is like. And again, remember, like, you know why we are saying like, you know, that's. That's interesting because many times in the literature you would see that like, you know, okay, let's apply, you know, inverse Fourier transform, like, you know, on the top of something. You don't need to basically go through the headache of doing that step by step. You can just directly. Apply dagger on the top of that operators.
It's not implemented. Maybe soon.
Okay, so what else? Those, you know, let's just skip through those, you know, the relations. It's, you know, easy. They can check it, you know, let's go, let's, you know, how much time do we have? Let's look at that circuits. Let's go with the magic ones. Like, you know, we already shown. Yeah. This is also a very healthy practice. Like, you know, whenever you see a circuit, try to construct it as an operator, a multiplication of bunch of operators. Because it helps you to have a better understanding of like, you know, how things is happening here. Okay, remember we should read it from left to right.
So the first thing that we have just. I know, I think this notation, I got rid of it. It's confusing. It's a connection of as should be.
Okay, this is a magic gate. So you can just ask for the magic gate. Let's see, like, you know how the magic gate as a circuit without any problem.
Yeah, please.
I know. Having that connection there is kind of confusing.
Yeah.
So we like just say that that connection between two S, you know, we are going to take care of that. But anyhow, let's see, what do we have there? So Nick, just focus on operator. Let's not use, you know, quantum circuit operator. Let's just write it down as like, you know, a composition of, you know, bunch of operators. So first we have S on qubit number one and number two. What you can do is go with the order. That's the most straightforward way of doing that. Or 2s. Both of them are totally correct. Like, you know, we usually, like whenever I do it, I personally go with like, you know, with order. So. But again, those of those two constructs are exactly the same. But remember, like, you know, when it comes to the operator operators, like, you know, the. The order of action is the same is. Is inverse of like, you know, the diagram that you have. So the next operator that we have is Hadamard on the second one. So now we are going to go Hadamard, but this time in the second one. And then we have C not. But pay attention to the. Like, you know. So the last one is C not. But the order is like, you know, two is your target and two is your.
With control.
Control. And like, you know, one is target. Now the way, like, now if we want to compose all of them together, we start like, you know, the first one that you should write down is C. So it's going to be. Again, Nick, go with the operator. I just want them to remember like, you know, when. So it's gonna be. You should start with like, you know, your last operator goes to the left side. C. Not.
Quite a composition.
Yep. Or apply, you know, whatever way, like, you know, it's, you know, let's show them the composition because, like, the composition has a very definite meaning in. In mathematics.
Okay. I just want to show whether it works or not. Okay, but as a composition, we run this one and then.
How on the second one and the last one. So I just want to make sure that, you know, look, you know, make sure that, you know, you have a good understanding of like, you know, the order of like, you know, those operations is very important. I guess, like, you know, Nick, on your composition operator on the top line 96, you have to put C nut at the very. Yeah. So again, I fully understand. You may feel like, you know, okay, you know why people do it like this and like, you know, why this circuit is like written left to right. But when we apply a composition of functions like, you know, it has a. For example, if you look at line 97, it's clear that first you're applying S, then H, then cnot. Okay, but like, you know, the order. Remember the order, like the sequence of your operator. That's very important. So either you wrap it around one operator or application of one operator on the top of another operator, but pay attention to the sequence when it comes to the circuit design. Okay, so that was, you know, one thing that I wanted to make sure that, you know, you guys remember that. Okay, let's Move on to the next example. The next example is basically like, you know, a practice on control gates. This time let's write our composition with only one single, you know, operator. So let's just have only one quantum operator and let's put in inject everything there. So we start with X on the second one. Then here we have control. So we go the family of control. First say that you know, this is control. Then your operator acting on the, like, you know. Now look, let me just comment here. Look, you see here we are specifying control one as one and two and Nick is not giving any argument for Z operator. So automatically that's how we would understand it. So we would say, okay, whatever is the control, Z will be the next one. So here we automatically understand that Z is acting on the third one. Okay, so it's not given explicitly, but like, you know, that, that, that's what's like, you know, you don't need to include it. But like, you know, let's, let's keep it like that. And then we have X on the second one. And then like, you know, there we have our, like, you know, let's. I know it's to Foley, but let's write it explicitly not on the second 1 and 1 and 2. So this is basically the operator composition of that circuit. Okay, so like, of course, like you know exactly the same construct. Like you know, you can wrap. Just let's wrap it also like, you know, that one instead of operator, let's go with the circuit and adding one extra. You see that that's exactly the same thing. For now let's. That target tree. Let's make it for, just for clarity, like you know, when Z. Yeah, you see here like that's why like, you know, we don't. You see, you can change that so that, that's why, you know, that's an interesting option. So we can act. Your target can be anything. But again, remember, if we do not specify it, we automatically go to the next one immediately after your control one qubits. Okay, let's see. Then that last example, like you know, before we move on to the next topic, like now the, the circuit that you see here like, you know, this is the multiplex gates. You see here like, you know, what's happening here is 0, 0, 0 and then y on that qubit. Then one by one we are basically con. Come including all the combinations. This is basically all the subsets of like, you know, 0 and 1 with the list of like, you know, when, when all of them are so not sublist tuples. Yeah. So this is exactly the same order as you see there.
Oh yeah, that's right.
Yep. Now like, you know how you want, like, you know how we can write down the corresponding, you know, operator. So what we need to do, we have to create a series of like, you know, control gates. So Nick, first he's specifying like, you know, the operators Y, H, Z. So that's, that's the sequence that we have. And then he's gonna tell. Tell us like, you know. Okay, now let's go with operator. Okay. C and order.
The code name.
That's better name control. That makes sense.
No, because we can't use zero.
Oh, you. We have. Yeah, it's. This is basically. No, I. So we have to create two lists. So we have to say how we can, you know, split it. Let's see.
Just do this thing.
1, 2, 3. Okay. But remember like, you know, 1, 2, 3 is your control. Yep, that's good.
I think it's pretty fine. I just have to splice it here. Yep. This is our. It's the other way around.
So basically, remember, like, you know, the first one is zero. So in our control C, the first argument is for one. And these are basically the operators that we have. Oh, you have to remove the reverse, I guess. Yeah.
No, no, it's the same. So we screw that. So if this one, because it's a. Maybe you should pad it with the empty one. Weird. One, two. It's not quite reverse. What if I just swap this around? Why it's this so hard?
Another trick is like this, Nick, create all the subset of the 1, 2, 3. That's another approach. Subsets of 1, 2, 3. And then let's map this one and complement of each case with 1, 2, 3. Again. So like, you know, let's apply function open the parentheses pound.
Well, in this case I can just part with an empty one. If this is response to a control one. Right?
Yep. No, these are like, you know, control zeros. Look at that. These are control ones. You are right. These are the control ones. Yep, these are the control ones. Now like, you know, with the complement, it's much easier to create that. But like, you know, with the padding.
I'm just going to do this control one. It's the same thing.
Reverse like this.
Now it's good.
That's exactly what we want. Yep.
Not any silliness here. Mm.
And let's look at our circuit. So that's exactly the same. So you notice like, you know, when we have like, you Know the sequence and all the possibilities. It's kind of a headache. So we had to do like, it took us some times to basically create what we have here, but like, you know, literally what we have here, you know, and it is called, you know, multiplex gates. Basically, like, you know, you have block diagonal gates, and then in a sequence starting from 0, 0, you're applying all the possibilities, whatever you want. So instead of this construct, you can simply go with the named operator multiplex. So let's go with the multiplex. And then literally that list of Y and exactly that. And I don't remember. I guess we should kill the list, if I remember that correctly. Yep. So this is exactly. This operator is exactly the. The one that you see above.
Just after compiling it into a single. Not sure.
Circuit operator. As for the circuit operator.
Okay. All.
Right.
It's almost the same.
Yeah, it's like, you know, because like, you know, we have.
Dimensionality thing. I have to specify dimensions, dimension 2, 2, 2.
So like, you know, like, you know, we have to go with the quantum basis. Oh, let's go order one through four. One, two, three and four.
That's smart. I don't remember how multiplexer works exactly.
Let me just double check that. You know, we have it in our documentation. But I guess like, you know, you guys got the message like, you know, it's some of the named operators. Where is the multiplex?
It's not even returning any. Anything. So it was kind of a bad idea.
Rapid maybe. Hold on a second. No, that, that's. So just change the basis. No, the order is not good. Just. Just give the basis to 2 and 4 instead of order. Yep. I guess you crash your kernel.
Yeah, I already recording it.
So basically, you know, a multiplexer is a block diagonal. And the top one, like, you know, what you see here, the first one, it says like, you know, Y. So Y. You know, it means like, you know, what's happening there is the first 2 by 2 is poly y and then move along the diagonal elements. Then the next one is Hadamard operator. Then the next one is Z operator X, X and you know, so forth. So that's how we would like, you know, basically construct our multiplexer operator. And you know, it makes your life much easier when you have fancy, fancy, like, you know, control case like this.
A little bit out of order. It's not. Oh, and 1, 2, 3, 4. With the basis what we strike.
And these two should be. Maybe we need to do some simplification on the circuit because it's 16 by 16. So let's look at just, you know, the matrix and you know, we can compare the matrixes.
I can see by the picture it's kind of in reverse for some reason.
Let's see.
I have.
Now let me just look at our documentation. Just like, you know, I do not remember that like, you know, Nick, like, you know, for multiplexer, like, you know, we do not have. Do we need to add, you know, quantum operators wrapping around those named operators or we don't need to do that.
We may give it. Or maybe, maybe, maybe what we should do because the.
Oh, it goes on the first one.
We should do something like this for everyone.
No, like, hold on. Like we are just specifying the block diagonal. Like, you know, I don't think, you know, we need that. So what we need is, Let's see.
It will.
I think we need to wrap each one of them around, you know, quantum operators. I do not think like, you know, it's just wrap around, you know, xyz. All of them are in a quantum operator. And we can kill like, you know, the order and the basis. And I think like, you know, it should work. No, it's still C. That's. Yeah. The same as before. That's interesting.
We don't have to focus on it right now. Multiplexer is very.
But the idea of multiplexer is literally a block diagonal matrix. So like, you know, it's. I thought like, you know, I remember all of its construct, but it seems, you know, I have four got and how we constructed that. Just a sec. Let me check one thing on my end. Okay, we can, you know, let's show a simpler example. Let's have, for example, quantum multiplexer. Let's have an operator quantum multiplexer. Let's kill all of that simpler example. For example, let's go with xy. Yep. So now this should be X, not X. Well, let's go with identity and I. Identity and I actually ident. And it should be the same as control C. So that's exactly what you're saying. So it should be the same as control C and Y. And this time, you know. Yeah, one. So empty list and then one. Or maybe one and empty.
That way.
Yeah, that way. Yes. Okay. So that's literally like. And then if we switch them, it's going to be the opposite. That would be empty. Yep. Now I guess now you guys have a better understanding of what we were discussing regarding the multiplexer. So multiplexer is the most advanced way of creating Robert. Yes, we are going to upload with the solutions, the most advanced way of creating the control operators. But it's counterintuitive, but it's very nifty. Like, you know, it's, it makes your life very easy. Okay, let's move on like, you know, very quickly. You know, let's, you know, comment on quantum measurement operators. I don't think you are going to have time to discuss circuits. So we can discuss circuits next time in more detail. But remember, we already gave you a good taste of circuit on day one, remember, you know, as we said at the very beginning of this session, quantum measurement is very different from everything else that we have in quantum. A big headache, lots of discussions about them. But anyhow, for computational purposes, either you can go with usual projective measurements, okay? Like here, what we are doing here is we are measuring qubit number one and number three in computational basis, okay? And then random pure state, you know, random pure state of, you know, three qubit. So the measurement, what we do here is literally just measuring two of the subsystems. And one other comment, remember, whenever we are not specifying the basis, it is the computational basis, which is, I think most of the time you guys are working in the computational basis unless you want to do the fancy things. The result of like, you know, quantum measurement operator on any state is a new object, which is quantum measurement. And there are tons of interesting features that you can extract out of that quantum measurement. For example, the corresponding probability. Plot the probabilities as an association. And then you can also ask for the corresponding states. Like, you know, these are what you may call them post measurement results, okay, after the measurement, what is the corresponding state and, and what's happening there? Remember, your original state was the state of three qubits, okay? And we were measuring only two of them. Now the next example you see here, like, you know, three, and we are measuring only two of them. One and number one and number three. Now we can, let's measure all of them so we can, you know, another approach is like just measuring, you know, all of them. And of course, you know, this time when we look at the probability plots, we are gonna get like, you know, at least, like, you know, this is eight different, you know, results that corresponds to your measurement. But anyhow, like, you know, one interesting feature about measurement is that in our framework, you can do a sequence of measurements, you can have a composition of measurements or you can have like an operator, like literally that one. You can do it in three steps. You can say that, you know, look, first measure number one. Then Measure number two, then measure number three. This is like, you know, one another way of like, you know, constructing like, you know, your, your measurements. Like, you know, remember, like, you know, these are different quantum states. Sorry, these are different quantum systems or like, you know, the sequence of measurement, like, you know, how you construct that, you know, it's not important. Let's call it the same state. Yeah, just showing that. No, it's exactly the same for about. Okay. One other thing that you can do in a framework is a generic measurement. We usually call it like, you know, POVMs. So here, so what's the idea here? In the usual projective measurement, the number of, you know, results that you would get is the same as the dimension that you are working with. Okay. For example, if you are measuring, you know, spin, it's just two potential answers. Or when you have like, you know, eight qubits, eight outcomes. Okay, that's exactly like, you know, what's happening here, what you can do. Let's look for. These are the potential outcomes, eight outcomes. With povm, you don't, you go beyond the projective measurements. So it means first of all, after the measurements, the states, they have overlap, okay? They are not orthogonal anymore. Okay? This is one case that happens a lot when those of you are familiar with the weak measurements. That's exactly the case. Your measurement results, they are not orthogonal anymore. Why POVMs are interesting because remember, when we do projective measurements in quantum, we always remind our students, projective measurements, then you cannot simultaneously measure, for example, two operators that are non commuting, like Pauli X and Pauli wise. You cannot measure them simultaneously. But if you release this condition of projective measurements, yes, you can measure them simultaneously. And that's exactly what's happening in the weak measurements. For example, with weak measurements, you can simultaneously measure Pauli X, Pauli Y and Pauli Z. Okay? But the result is that these states are overlapping. They are not orthogonal anymore. I hope you guys remember the states that you see here. This was one of the problems that we did, you know, last time during the last sessions. And I told you, like, you know, the Trinity states. And I told you, look, you know, these are very interesting for, for POVMs. So what we are doing here, we have bunch of states. Remember, it's a two dimensional system, but we have three states and these states, they are not orthogonal. There is an overlap between them. You can easily see that like, you know, there is an overlap between them. What we can create, we can create the corresponding, you know, operators for each state. That's, you know, you can see, you know, conventionally quantum, we would call them the corresponding like, you know, projectors. Then POVM is basically the least of those elements. Conventionally, like, you know, remember, like, you know, this is those operators, all of them are, you know, positive semi definite matrixes. Their summation is also identity. These are the usual things that we have because like, you know, they should be physical. And also the, the concept of probability, we can easily check all of them. Nothing fancy here, but anyhow, long story short, you can have generic measurements. So this time like, you know, you are going to get like, you know, a different. So this is, look at here what is interesting, like you know, just, you know, look at the, like you see here in the summary box is not a square matrix anymore. Okay, it's a rectangular matrix. So that, that's one thing like that, that, that kind of fingerprint of like, you know, povm. And although you are measuring like, you know, a two dimensional system, you get three results and each result corresponds to those states that we, you know, define at the very beginning. We can look at, you know, probability plot or like, you know, E1 corresponds to state number one, E2 and E3. So it's like I'm measuring, it's like measuring a spin 1/2 a spin system. But because, you know, I'm doing, you know, a generic measurement, we are getting, you know, three results. Okay? So I feel like, you know, we give you enough basically, basically all the functionalities that you need. And now next time, tomorrow we are going to focus more on circuit. But literally like, you know, whenever we discuss the circuits, behind the scene is quantum operator, quantum measurement, quantum state and that, that's how we are basically dealing with them. So and whenever it comes to algorithm design, that's a very good strategy. Always think in terms of like, you know, your operators and what's happening to the state rather than just focusing on circuit by itself. So tomorrow we are going to focus more on the circuit and we are going to review everything because circuit has all of these concepts together, measurement, operator, state, all of them together and hopefully like, you know, you have a better understanding of like, you know, our quantum framework. By the way, all of the notebooks that we have shown you here, they are already on that, you know, series material. You can download them from there. I think we just need to include the answers. So like, you know, we will also include the answers. So you will see the notebooks together with the answers. Any question, any niche is there. We have about less than a few minutes. Would you like Any comment you would like to add?
No, I guess. Well, I would love to discuss more in detail, but I don't think we have time.
So maybe we can, we can do it next time. Like, you know, it's, by the way, like, you know, quantum measurement. Like, you know, maybe just, just, you know, show like, you know, the input form behind the scene. What is the quantum measurement, maybe that's.
Interesting for our quantum measurement.
As an object.
Yeah.
So you see like, you know, behind.
The scene, like, it's easier to show it. Like instead this one.
Yeah.
Inside of quantum measurement is underneath it. It's just a measurement operator.
So, so, like, you may say, okay, so while you are showing me, like, you know, the quantum measurement, most stuff like, you know, these issues are for communication purposes. Like, you know, if we show you, if we tell you that, you know, look, you know, behind the scene is the same as, like, you know, what's happening to that operator. It would say, then while you are showing me, like, the application will be very complicated. And then when it comes to like, you know, the actual measurement results, the way that we do it originally, like, you know, if you guys, like, you know, if. I don't know if anyone attended our very first study group, if you may remember, you know, in the very first study group we told you that, you know, quantum measurement is, for us, behind the scene is like a categorical, you know, distribution. We kind of like, you know, get rid of that, that, that design. Because there are much better way of like, you know, dealing with quantum measurement. For us right now, it's like, you know, the way that you can see it is like this. Whenever there is a measurement, it's like you are including detector, sort of, let's call it classical system. Some people, they would call it environment. The way that we deal, we deal with that is that we go to a higher dimension. Okay. It's like in that higher dimension, in it, like much larger Hilbert space, we basically include everything. And that's why when you look at the diagram for your measurement, it's the same diagram as a quantum state.
Of a label.
Yeah, just change the label. So behind the scene, like, you know, what we do is that, okay, so you want to do whatever you need to do. So it's like entangling, coupling your system with a detector. So behind the scene, we do all the couplings. And if you ask why we do that, then any future operation on your measurement, you can easily do it in a higher dimensional Hilbert space. But you don't need to worry about that. Like you know, this is the thing that like, you know, we kind of, we save that information and behind the scene we have that. That's why like, you know, on the top of a quantum measurement, you can apply an operator. So that's, that's one of the neat features of like, you know, our, our framework. Like, you know, you can have a sequence of measurements, you can have operator applied on the top of like, you know, a measurement results, and you can do all of them together there. Now we have to remember like, you know, what's the dimension now? Is it three? What was the dimensions?
1, 2, 3, 2. Because it's a. Yeah, it's very tricky. Like, I can try something like this.
Yeah.
That would be. Oh, what. Just happened here?
Let's just apply that. This one on coin. It should work on the first one. Yeah, the first one was the three dimension. I don't remember which one was which.
Come like this. This two, three.
Just switch the two.
No, it's, it's fine because.
Oh, the dimensions. Oh, yeah, two, three.
For some reason unordered, I think guy normal, undefined state, rather.
Yeah. So basically, like, you know, you can apply directly on your states and like, you know, keep evolving. But anyhow, remember, like, you know, we do it in. Bianca. The question is like, you know, what. What's the benefit of going to the higher dimension? Like, you know, it's like you're saving all the information about your quantum system. For example, like, you know, conventionally when people talking about measurement, for example, they will tell you that, you know, spin measure it, and then your result is like, you know, your, your result is a mixed state, right? Like, you know, you get it for a mix state after the measurement. So it means if you want to do like, you know, further operation on like, you know, saying that, you know, if I get positive, what's going to happen? I just want to apply like, you know, an operator. If I get positive. Conventionally, if you do not save that, you cannot do it. Okay. You have to construct it manually. But what we do is that going to higher dimension is like using an ancillary, like, you know, quantum system and we save that information. It's literally like, you know, I don't know, you know, if you guys are familiar with the idea for them quantum channels. One way of describing quantum channel is saying that, okay, you have your state with this environment, this happens. No environment, for example, it stays as it is. So it's literally exactly the same approach. Like, you know, you go to a higher dimension and you can preserve everything There because in that higher dimension, all of your operation would be unitary linearity and everything. You are not going to lose any information. But you don't, you know, again, like it was just an explanation. Like what we are doing behind the scene. Okay. Like, you know, it's not like you don't need to care about, you don't need to understand, like, you know, how we are dealing it. But that's a very nifty construct that we have. So you can do lots of other things on the top of your measurement result. Like what, what, what's happening here? You see here, like, you know, Nick is applying a poly Y operator on the first qubit and then it. He does another quantum measurement on the top of the first qubit. So we can do it only because, like, you know, behind the scene, like, you know, we are, we are going to those higher dimensions without showing it to you. So you don't see it immediately. But I guess, like, you know, if we ask for the state of the quantum measurement, they can see for the state. Right? If I remember that correctly. Oh yeah, it's even visible here. Like, you know, you see here, you can see it here.
Like, you know, this is the eigenvalue. So this measurement operator. So first we measured with POVM and got three results. Those E1, E2 and E3. When you apply the new operator, necessarily don't apply it, just measure it again. But normally we kind of double our measurements on the same qubit. We measured twice with two measurement operators, doubled our probability distribution, you know, again.
You know, Bianca, related to that question. Look at exactly what's happening here. If you use a mixtape, you cannot see the sequence of measurement results. You cannot see. Okay, I got E1 for the first one, which was a POVM. And then for the second measurement, I did a projective measurement. If you go with the mixtape, you know, like, basically if you don't save that, you are losing that information. You don't see that information. It's kind of like just to give you a taste, it's kind of like, you know, similar to what's, what's the idea? Like, you know, it's kind of similar to the idea of purifying your code. Kind of. Okay, you know, when you purify your system, you go to a higher dimension and you're saving everything into, in a pure state because dealing with that pure state is easier because you're saving, you know, more information. It's kind of similar to that. Not, not 100, exactly the same. Okay, we, I guess you know we are running out of time so we'll upload the solutions. Any question on community or directly quantumolform.com let us know any issue. If you are not able to code anything, please let us know. And in case if you notice any for example, like maybe. For example today when I was looking our documentation I realized there's a typo somewhere so users were not able to reproduce our results. So maybe there is an issue somewhere or a bug. If you notice anything, let us know. We will take care of that immediately.
More from Guy

Cheryl Strauss Einhorn | The Human Edge: Smarter Decisions in the Age of AI | Talks at Google

Rachel Glennerster | Innovation and the Center for Global Development | Talks at Google

Rebecca Winthrop | Rethinking the Purpose of Education in the Age of AI | Talks at Google

Dr. Robert Wachter | A Giant Leap: How AI Is Transforming Healthcare... | Talks at Google






