From the course: Quantum Computing Fundamentals
Hadamard gate
From the course: Quantum Computing Fundamentals
Hadamard gate
- The three Pauli gates we've seen thus far are incredibly useful and you'll see them used throughout quantum programs. But if those are the only three gates we have to use it's impossible for us to take a qubit, which is initialized in the zero state, and put it into any state other than zero or one. That's not any different than working with classical bits. The Pauli gates are often used to initially set up or encode classical information into a few qubits at the beginning of a quantum program but to then transition our qubits into more interesting states of super position we're going to need a few more gates. - The most common gate for converting a qubit from one of the two basis states into a super position is the Hadamard gate named after the French mathematician Jacques Hadamard. Unlike the Pauli gates, which rotate around one of the major axes, x, y, and z, the Hadamard gate rotates our quantum state by pi radians or 180 degrees around the Bloch sphere vector [1 0 1] which is the vector pointing halfway between the x-axis and the z-axis. In our quantum circuit diagrams, you'll see the Hadamard gate represented as a box with the letter H in it. So what does that look like to rotate around that vector on the Bloch sphere? - Let's use our Bloch sphere beach ball to visualize it. To apply a Hadamard gate, I'll put my finger on the point halfway between the zero state, which is at the top of the z-axis and the positive side of the x-axis. Then I'll place another finger on the opposite side of the ball. This will be our axis for rotation, which is at a 45 degree angle. Starting with our qubit in the zero state, I'll rotate it 180 degrees and that transitions us to the superposition state at the positive side of the x-axis. If I applied the Hadamard gate a second time on this quantum state, that rotates us another 180 degrees which brings us back to zero. So the Hadamard gate is its own inverse. Applying it twice in a row brings us back to where we started. - To apply the Hadamard gate to a qubit starting in the one state, Baron will put his fingers along the same vector as before then rotate the sphere 180 degrees, and that transitions us from one to the negative side of the x-axis. This is clearly a quantum gate because it takes our classical basis, states one and zero, and puts them into a superposition. - Let's look at that operation mathematically. The two by two matrix shown here represents the Hadamard gate. Notice that, unlike the three Pauli matrices we saw in previous videos, the Hadamard gate does not have any zero elements in it. Factoring out the scalar value of one over the square root of two makes it a little easier to see what's going on here. If we apply this Hadamard gate to a qubit in the zero basis state, that produces a matrix with one over the square root of two as both elements. We can write that using Dirac notation as the sum of ket zero and ket one over the square root of two. We'll refer to this state as ket plus, which is located at the positive end of the x-axis on the Bloch sphere. When we measure a qubit in this state, the probability of a zero outcome is the absolute value of one over the square root of two squared, which is one half. Along the same lines, the probability of measuring that qubit and getting an outcome of one is also one half. Measuring this quantum state in our standard basis is like flipping a coin between one and zero. - [Speaker 2] If we apply the same Hadamard gate to a qubit starting in the one basis state, the product is slightly different. Both elements of the state vector are one over the square root of two but now the bottom element is negative. That corresponds to a point on the Bloch sphere at the negative end of the x-axis which we'll represent in equations with the ket minus symbol. Measuring a qubit in this superposition state has a one half chance of resulting in a zero outcome and an equal probability that the outcome will be one. Applying the Hadamard gate to each of our two basis states results in one of two superpositioned states that look similar when measured. - However, they are distinct states with different phases that put them on opposite ends of the Bloch sphere's x-axis. The Hadamard gate is significant because it can transition our qubits from the classical realm of ones and zeros into the quantum realm of superposition which is where the magic really happens.
Contents
-
-
-
-
-
-
Hadamard gate4m 30s
-
(Locked)
Hadamard gate with Qiskit3m 3s
-
(Locked)
Measurement on an arbitrary basis6m
-
(Locked)
Phase shift gates4m 27s
-
(Locked)
Phase shift gates with Qiskit1m 55s
-
(Locked)
Parameterized rotation gates3m 23s
-
(Locked)
Parameterized rotation gates with Qiskit3m 1s
-
(Locked)
Single-qubit gates on multi-qubit states3m 57s
-
(Locked)
Challenge: Random numbers1m 45s
-
(Locked)
Solution: Random numbers2m 2s
-
-
-
-
-
-