# Working with larger quantum registers

Working with multi-qubit registers allows the number of possible
states to grow exponentially. It requires us to keep track of the
*weight* (or amplitude) and phase of each possible state.

## Weights and measures

Let’s say we have two quantum registers, which we will call and , and we add them together and put the result in register , so that . (These registers would each have more than one qubit, but for our purposes here we can treat them as a single numeric value.)

Let’s assume we begin with in a superposition of all of the numbers 0 to 3. We can write this using our dial representation, but in this case a simple table will do. Our values for :

A |
---|

0 |

1 |

2 |

3 |

and the same:

B |
---|

0 |

1 |

2 |

3 |

Then when we add them together, obviously will be the superposition of the numbers 0 to 6. But it’s not quite as simple as that.

Since there are more different ways to get 3 when you add two numbers
(0+3, 1+2, 2+1, 3+0) than to get 6 (only 3+3), there will be a
different *weight* in the register set for the value than for
the value .

Moreover, our , and registers are now entangled, so we can no longer write down their values independently. There are four possible values for , four for , and seven for , so we might need as many as different clock dial vectors! This shows the amazing growth in the classical resources necessary to represent the state of a quantum computer; although we are using only a few quantum values here, it is already impractical to write down the entire state. Fortunately, out of the 142 possibilities, only sixteen of them are non-zero. Let’s list them:

A | B | C |
---|---|---|

0 | 0 | 0 |

0 | 1 | 1 |

0 | 2 | 2 |

0 | 3 | 3 |

1 | 0 | 1 |

1 | 1 | 2 |

1 | 2 | 3 |

1 | 3 | 4 |

2 | 0 | 2 |

2 | 1 | 3 |

2 | 2 | 4 |

2 | 3 | 5 |

3 | 0 | 3 |

3 | 1 | 4 |

3 | 2 | 5 |

3 | 3 | 6 |

If we reorganize our list, sorting according to the values of , we get this:

A | B | C |
---|---|---|

0 | 0 | 0 |

0 | 1 | 1 |

1 | 0 | 1 |

0 | 2 | 2 |

1 | 1 | 2 |

2 | 0 | 2 |

0 | 3 | 3 |

1 | 2 | 3 |

2 | 1 | 3 |

3 | 0 | 3 |

1 | 3 | 4 |

2 | 2 | 4 |

3 | 1 | 4 |

2 | 3 | 5 |

3 | 2 | 5 |

3 | 3 | 6 |

It’s now obvious that has four times the weight of or . When we measure , with some probability we will find each of the possible outcomes. The probability of finding 3 is , four times the probability of finding 0, which is only .

Let us assume that we do, in fact, find . When this happens,
the superposition *collapses*, and we are left with only the terms
that included a value of 3 for :

A | B | C |
---|---|---|

0 | 3 | 3 |

1 | 2 | 3 |

2 | 1 | 3 |

3 | 0 | 3 |

After measuring , it is no longer entangled with and , but in this case and are still entangled with each other.

## The ket notation

Of course, writing down tables this way is relatively clear but clumsy, which is why we use the ket notation. We can also track the weights a little more clearly. The initial superpositions for and would be

To write down the combination of and , we can put them together inside one ket, separated by a comma. For example, would be . Since our two registers are independent and each has four terms, it’s now obvious that we have sixteen values to write down, one corresponding to each line in the table above.

Let’s skip forward a couple of steps and write down all three of our registers after measuring and finding 3:

Since all of the values for are the same here, now we can factor out:

Since is no longer entangled with and , we can ignore it if it’s convenient, and just write and . Of course, the vector lengths are adjusted at every step in this process so that the whole set remains normalized, but as long as all of the terms are the same weight and we mentally keep track, we can simplify it and just write down

This kind of partial collapse of the entire state, leaving some terms and entanglement, is a key to the way quantum algorithms work, and we will see its use in the upcoming Steps.

© Keio University