From the course: Quantum Computing Fundamentals
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Hadamard gate with Qiskit
From the course: Quantum Computing Fundamentals
Hadamard gate with Qiskit
- Let's explore the Hadamard gate in action with qiskit. I've already imported qiskit and the visualization tools we'll be using at the top of the notebook, and in the second cell I've initialized a quantum circuit with one qubit and one classical bit. However, as we can see from the circuit diagram it does not perform a measurement on that qubit. The third and fourth cells simulate the circuit's state vector and then print that out along with its block sphere representation. After that, I add a measurement to the end of that circuit and redraw its diagram. Then finally, I use the chasm simulator to simulate the circuit and plot a histogram of outcomes. Since it's just a single qubit in the initial zero state we always get zero as the measured output. Now let's add the Hadamard gate to that qubit by calling circuit.h and then passing in the index value zero. I'll click the run all button to rerun this entire notebook…
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
-
-
-
-
-
-