Tutorial B: More Single Qubit Gates

In this short tutorial, we’ll cover more quantum gates.

Objectives:

  • to apply the two other Pauli Gates.

  • to apply gates with parameters and other phase gates.  

Importing Modules

from qiskit import *
from qiskit.visualization import *

In Tutorial A, we covered only two: the X gate and the Hadamard gate. There are more quantum gates to explore, so let’s go through a few ones now.

1. Pauli Gates

The X gate is grouped with two other gates, namely the Y gate and the Z gate. Together with the Identity operator, these are called Pauli gates. We will test these out now.

ycircuit=QuantumCircuit(1)
ycircuit.y(0)
ycircuit.draw(output='mpl')
_images/Tutorial02_5_0.png

Above, we’ve created a quantum circuit with a Y gate. Let’s visualize what happens.

visualize_transition(ycircuit, trace=True, saveas=None, fpg=25, spg=2)