From the course: Quantum Computing Fundamentals

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Pauli-X gate with Qiskit

Pauli-X gate with Qiskit

- Let's explore the Pauli-x gate with Qiskit. I've already imported Qiskit and the visualization tools we'll be using in the top cell of this notebook. The second cell initializes a new quantum circuit with a single qubit, and then the final cells simulate its state vector to display its quantum state on the block sphere. Now to use the Pauli-x or NOT gate on this qubit I'll call the X method on the circuit and pass it the parameter zero, which corresponds to the index of our first and only qubit. Qiskit gives us several ways to display a diagram of our quantum circuit. The simplest way is to call python's print function on the circuit object. I'll press the run all button at the top of the editor to run this entire notebook and we can see that cell prints out a diagram of the circuit using asy tech's characters. It's not the prettiest thing, but at least it shows us what's going on. This circuit has a single qubit…

Contents