1 00:00:00,000 --> 00:00:08,001 So now we are ready to look at our first quantum circuit. So, how does a quantum 2 00:00:08,001 --> 00:00:14,003 circuit work? Quantum circuit consists of wires and gates. It's just like a 3 00:00:14,003 --> 00:00:21,000 classical circuit except that the gates are now quantum gates and the wires carry 4 00:00:21,000 --> 00:00:27,003 bits of information. The one other property of quantum circuits is every gate 5 00:00:27,003 --> 00:00:33,063 has the same number of wires leaving it as the number that enter it, okay. Let's make 6 00:00:33,063 --> 00:00:41,004 up a circuit that consists of two gates, the Hadamard Gate and the CNOT Gate. So 7 00:00:41,004 --> 00:00:52,075 remember what the Hadamard Gate does? What it does is. H(0) =,, + and H(1) =,, -. In 8 00:00:52,075 --> 00:01:03,039 fact H(+) = (zero) and H(-1) = (one) as well. So it swaps zero and +, swaps one 9 00:01:03,039 --> 00:01:10,082 and -. So it's a one qubit gate. Okay, so now what we want to understand is what's 10 00:01:10,082 --> 00:01:16,078 the behavior of the simple quantum circuit where you first perform a Hadamart on the 11 00:01:16,078 --> 00:01:23,007 first qubit. And then you perform a CNOT with the first qubit as the source as the, 12 00:01:23,007 --> 00:01:29,056 as the control bit and the second qubit as a target bit. So let's try to understand 13 00:01:29,056 --> 00:01:35,077 what happens if the input bits are both zero. So, let's follow, follow the state 14 00:01:35,077 --> 00:01:43,089 as we go along. So initially, the state is 00 but then what happens after the, after 15 00:01:43,089 --> 00:01:50,015 this first Hadamard? Well the first qubit now is in the state one / square root two 16 00:01:50,015 --> 00:02:01,067 (zero) + one / square root two (one). And the second qubit is still in the state 17 00:02:01,067 --> 00:02:10,053 zero. So the state here is one / square root to (00) + one / square root two 18 00:02:10,053 --> 00:02:19,088 (ten). Okay so now, this is the input state to the CNOT Gate. So what happens 19 00:02:19,088 --> 00:02:27,080 after we go through this CNOT Gate? Well, okay, so you want to understand what the 20 00:02:27,080 --> 00:02:34,053 state is here. What is the CNOT Gate do to (00)? Well, the control bit is zero so you 21 00:02:34,053 --> 00:02:40,095 end up with one / square root two (00). What about (ten)? Well now the control bit 22 00:02:40,095 --> 00:02:46,068 is one and so the target bit gets split so you end up in the state one / square root 23 00:02:46,068 --> 00:02:56,035 two (eleven). I hope you'll recognize this state. This is a Bell State. Okay so, here 24 00:02:56,035 --> 00:03:04,061 is a circuit that starts with two qubits initially in the zero state and what it 25 00:03:04,061 --> 00:03:14,081 does is it entangles them into a Bell State. Okay now, here's the interesting 26 00:03:14,081 --> 00:03:25,033 thing. If you play with the circuit you realize that as y ou change he inputs from 27 00:03:25,033 --> 00:03:32,064 00 to the four possibility, the other three possibilities 01, ten, and eleven. 28 00:03:32,065 --> 00:03:38,037 The output state changes between this, whats called this five plus state which 29 00:03:38,037 --> 00:03:45,002 was, which was what the, what we were calling the Bell State but in fact there 30 00:03:45,002 --> 00:03:50,062 is a whole basis of Bell States. There are four orthogonal Bell States. These are 31 00:03:50,062 --> 00:03:59,015 called the Bell Basis States and they look like this. They, they come in pairs. 32 00:03:59,015 --> 00:04:04,087 There's phi+ and phi-. Phi+ is 00 + eleven. Phi- is 00 - eleven. Of course, 33 00:04:04,087 --> 00:04:15,002 with this normalization, one / square root two. And then you have psi+ and psi- which 34 00:04:15,002 --> 00:04:22,006 are 01 + ten and 01 - ten. Okay, so you should check that these are four mutually 35 00:04:22,006 --> 00:04:29,059 orthogonal basis states. They are, they are mutually orthogonal unit vectors. And 36 00:04:29,059 --> 00:04:40,002 you should also check that as you change the input bits. Say from 00 to, should we 37 00:04:40,002 --> 00:04:46,005 do one more example. Let's say, what happens if you start with ten? So suppose, 38 00:04:46,005 --> 00:04:52,093 suppose that you start with ten. Now, what's the output look like? Well, so at 39 00:04:52,093 --> 00:04:58,052 this point we'll be in the state (one / square root two (zero) - one / square root 40 00:04:58,052 --> 00:05:04,095 two (one)) (ten) which is. One / square root two (00) - one / square root two 41 00:05:04,095 --> 00:05:17,064 (ten). And now when we feed this through this CNOT Gate and we are looking at the 42 00:05:17,064 --> 00:05:26,004 state here. This, the first part goes to just (00). The second part, the control 43 00:05:26,004 --> 00:05:35,004 bit is one, so we get (eleven) which is exactly this one, okay. So check that you 44 00:05:35,004 --> 00:05:44,018 understand what happens in the case you have 01 and then eleven as inputs? Okay, 45 00:05:44,018 --> 00:05:53,020 so now let's look at one other aspect of this. Remember that we said the CNOT is 46 00:05:53,020 --> 00:06:00,090 its own inverse, Hadamard is its own inverse so now, let's think about it this 47 00:06:00,090 --> 00:06:08,085 way. Let's think the input bits as coming in from this side and the output bits 48 00:06:08,085 --> 00:06:16,075 coming out on, on the left. Here. Okay, so instead of the circuit being one where you 49 00:06:16,075 --> 00:06:22,082 first do a Hadamard on the first qubit and then do a CNOT, what if you, first the 50 00:06:22,082 --> 00:06:30,082 CNOT and then the Hadamard. Okay. So, so just for convenience let me think of the 51 00:06:30,082 --> 00:06:37,014 circuit as running from right to left. Okay but, but remember, we could have done 52 00:06:37,014 --> 00:06:43,014 exactly the same thing where we flip the circuit arou nd. So we, we put the, the 53 00:06:43,014 --> 00:06:49,022 CNOT first on the left, then the Hadamard and then we put the inputs on the left and 54 00:06:49,022 --> 00:06:54,046 the output on the right, it's all the same thing. But for that in a mess, what I'm 55 00:06:54,046 --> 00:06:59,049 going to do is I'm going to now think of the input is coming in from the right and 56 00:06:59,049 --> 00:07:04,040 I'll keep the circuit the way it was. Except as I think of, think of the bits as 57 00:07:04,040 --> 00:07:09,042 moving from right to left. Okay. So what happens? So lets, lets hear that we feed 58 00:07:09,042 --> 00:07:16,004 in the Bell State (00) + (eleven) We want to know what's the output going to be? 59 00:07:16,004 --> 00:07:23,020 What happens? What, what would the state be out here? Well I claim it's exactly 60 00:07:23,020 --> 00:07:30,084 what it was, you know so when we started from 00 and this, ran the circuit forward 61 00:07:30,084 --> 00:07:40,032 the state out here was one / square root two (00) + one / square root two (ten). 62 00:07:40,032 --> 00:07:46,060 And then, when we ran this forward, this, this state got transformed into the Bell 63 00:07:46,060 --> 00:07:52,067 State after going through the CNOT. Well, what happens if we apply CNOT again to 64 00:07:52,067 --> 00:07:59,007 this state? I plainly come back to where we started from because you apply the CNOT 65 00:07:59,007 --> 00:08:06,007 twice, you come back to where you started from. Okay, so when we move from right to 66 00:08:06,007 --> 00:08:12,051 left here, we are just retracing our path. Same goes for the Hadamard. When we apply 67 00:08:12,051 --> 00:08:19,092 the Hadamard to this state we retrace our path and we come back to 00. Okay? So, so 68 00:08:19,092 --> 00:08:26,032 here's the, here's the picture you should have. If you start with the state 00, you 69 00:08:26,032 --> 00:08:32,072 apply this circuit to it, it entangles the qubits and creates this Bell State. If you 70 00:08:32,072 --> 00:08:39,036 start from ten, it entangles it and creates this, this other Bell State phi-. 71 00:08:39,036 --> 00:08:47,052 And similarly for (01), (eleven) creates this two states. But now you can also run 72 00:08:47,052 --> 00:08:55,012 the circuit backwards from right to left. And now, if you feed in a Bell State on 73 00:08:55,012 --> 00:09:00,060 this side, on the right side what the circuit does for you as you run it from 74 00:09:00,060 --> 00:09:05,023 right to left is it analyzes the Bell State for you. And outputs (00), (01), 75 00:09:05,023 --> 00:09:11,029 etcetera which tells you which Bell State it was. Okay, what does this mean? So 76 00:09:11,029 --> 00:09:18,002 suppose that I, I were to tell you I have these two qubits. They are in one of the 77 00:09:18,002 --> 00:09:24,011 four Bell States, one of these four Bell States, psi+, phi+, psi-, phi- but I don't 78 00:09:24,011 --> 00:09:30,035 know which one. Can you please help me figure out which one it's in? This is what 79 00:09:30,035 --> 00:09:38,003 you would do. You would, you would create the circuit. And it created, you know to 80 00:09:38,003 --> 00:09:44,087 look like this you, you know, at first does a CNOT and then does a Hadamard. And 81 00:09:44,087 --> 00:09:50,097 now, what this, what this circuit does for you is, is it analyzes Bell States. What 82 00:09:50,097 --> 00:09:57,007 that means is after you run the circuit, if you just measure these two qubits in 83 00:09:57,007 --> 00:10:04,034 the standard basis. If you get as output 00 you knew that the Bell State was phi+, 84 00:10:04,034 --> 00:10:10,005 it was (00) + (eleven). If you get (ten) you know it was phi-, (00) - (eleven), 85 00:10:10,006 --> 00:10:16,002 etcetera. So this is what's called a Bell Basis Measurement Circuit