← Course overview and all lessons

Lesson 2 of 23 · 2:29

Build CMs from four basis matrices

Build a numeric basis matrix and connect it to its operator symbol.

Keyboard: focus the player, then Space or K to play/pause and arrow keys to seek. Tab moves through the controls. Selectable captions replace the video's caption strip with the same timed text below.

In this lesson

  1. 0:00 · Can four pieces build any two-input rule?
  2. 0:21 · A column that selects the first position
  3. 0:35 · Turn the column into a row
  4. 0:50 · Column times row makes a matrix
  5. 1:08 · Four pieces, four positions
  6. 1:24 · Combine the pieces for exclusive-or
  7. 1:42 · Your turn: place a basis entry
  8. 2:00 · Answer: the lower-left basis matrix
  9. 2:14 · Next: use the matrix to measure

Complete transcript

This transcript includes the answers to prediction prompts.

Show transcript

Can four pieces build any two-input rule? · 0:00

Can four pieces build any two-input rule? Exclusive-or accepts two input pairs, so we will start by building its matrix one accepting position at a time. You will learn how a column and a row create a single-position basis matrix, then how those pieces combine into a complete operator C M.

A column that selects the first position · 0:21

Ket one is a column containing one above zero. Ket zero contains zero above one. The vertical arrangement matters: these are columns with two entries. Their names tell us which input state they select in our true-first ordering.

Turn the column into a row · 0:35

Transpose a column and it becomes a row. We call that row a bra. Bra zero contains zero followed by one. The angled brackets are names for these vectors; we are still doing a concrete calculation with zeros and ones.

Column times row makes a matrix · 0:50

Multiply ket one by bra zero. Every column entry multiplies every row entry. The first row becomes zero, one. The second becomes zero, zero. This is an outer product: a column times a row produces a matrix.

Four pieces, four positions · 1:08

Choosing either ket and either bra gives four possible pieces. Each contains exactly one one. Its ket chooses the row and its bra chooses the column. These four single-position matrices are the basis pieces for our two-input operators.

Combine the pieces for exclusive-or · 1:24

Choose the top-right piece and the bottom-left piece. Combine their entries with exclusive-or. Because their ones occupy different cells, both ones remain. We have reconstructed the complete exclusive-or matrix from its two accepting input pairs.

Your turn: place a basis entry · 1:42

Try building ket zero times bra one. Which row does the ket choose, and which column does the bra choose? Decide where the single one will appear. The other entries must all be zero.

Prediction pause: 8 seconds.

Answer: the lower-left basis matrix · 2:00

Ket zero chooses the bottom row. Bra one chooses the first column, so the one belongs at the lower left. The paper names this operator with a downward double arrow. Its matrix accepts left input false and right input true.

Next: use the matrix to measure · 2:14

An outer product makes a matrix from a column and a row. In the next lesson, we place a row on the left of an existing C M and a column on its right. We will compute the resulting single bit, showing every AND and exclusive-or.