Lecture 8 - Single-qubit Gates

Monday, 4/22/24 (week 4, lesson 1):

  1. Submit Activity 1 as a ipynb file in Assignment – Activity 1 by 3 pm tomorrow (Tuesday)!
  2. Look through suggested topics for group presentation and think about your personal top 3, or specific topics. Then chat with the other students in your activity to look for a match :o)
  3. For Activity: Read/do: 5.1.1 (Circuit Composer is now Quantum Composer). Just create your IBMid and open it – we will play around during the activity!
  4. Read 5.4.4-5 (no subsections)

Last time we talked about the bloch sphere:

![[Physics CPE 345 Quantum Computing Lecture slides Week 3 The Qubit 240417 1.pdf#page=13]]

Notice here:

Ψ1qubit=cos(θ/2)|0+eiϕsin(θ/2)|1

We even could have many possible states:

Ψ1qudit=i=1nai|i

where the special n=3 case is a qutrit.

Single-Qubit Gates

Classical computers carry computations via gates. There's is only one gate, the NOT gate, that makes a unique possible gate (ikik there's the Identity Gate, but no one cares nerd).

A NOT
0 1
1 0
Where A refers to the input, and NOT refers to the output to the gate.

In contrast, here we move a point on the Bloch sphere, to another point (and do that for every point on the sphere). The qubits can have a continuous infinite number of states, rather than just the two of a classical bit. As a consequence, there are a continuous number of possible gates. Each gate is some generic operator O^:

O^Ψ1qubit=aO^|0+bO^|1

we won't usually expand it out like this, but it allows us to treak the Ψ's just like these kets, allowing us to scalar multiply and add together. Here, single-qubit gates are 2x2 matrices applied to teh vector representing the single qubit state:

O^=o11o12o21o22

Visually, single-qubit gates are rotations around the bloch sphere:

![[Physics CPE 345 Quantum Computing Lecture slides Week 3 The Qubit 240417 1.pdf#page=20]]

Some examples are:

![[Physics CPE 345 Quantum Computing Lecture slides Week 3 The Qubit 240417 1.pdf#page=21]]

![[Physics CPE 345 Quantum Computing Lecture slides Week 3 The Qubit 240417 1.pdf#page=22]]

![[Physics CPE 345 Quantum Computing Lecture slides Week 3 The Qubit 240417 1.pdf#page=23]]

Looking at these Matrices

Let's look specifically at the Z, Rz(θ) and T=P(π/4) gates. Recall that:

Ψ1qubit=a|0+b|1=(a,b)

So:

ZΨ1qubit=[1001][ab]=[ab]=a|0+(b)|1

So Z just flips the sphere over the z-axis.

Rz(θ)Ψ1qubit=[eiθ/200eiθ/2][ab]=aeiθ/2|0+beiθ/2|1=areiθaeiθ/2|0+breiθbeiθ/2|1

So Rz(θ) rotates the points on the bloch sphere around the z-axis, by angle θ.

P(π/4)Ψ=[10022(1+i)][ab]=a|0+beiπ/4|1

which does a phase shift by π/4 radians to the b term.

For these: