1

In the answer here, it is explained that when the measurement operates on only a subset of the qubits of the system (for example qubits 2 and 3 out of five), the matrix can be constructed using the Kronecker product. However, I need to perform the measurement on qubits 1 and 4. So it is not clear to me what matrices to put into the Kronecker product.

The particular measurement I need to do is the Bell measurement, whose matrix is $$\begin{bmatrix} 0&1&1&0\\ 0&-1&1&0\\ 1&0&0&1\\ 1&0&0&-1 \end{bmatrix}.$$

Frederik vom Ende
  • 4,163
  • 3
  • 12
  • 49
Anna Naden
  • 711
  • 3
  • 15

1 Answers1

1

Explicit indices

The difficulty here arises from making indices implicit in tensor product expressions. For example, the unitary $U$ corresponding to controlled-NOT gate on qubits $1$ and $2$ and identity on qubit $3$ is often written down as

$$ U=\text{CNOT}\otimes I\tag1 $$

but a similar unitary $U'$ corresponding to controlled-NOT on qubits $1$ and $3$ and identity on qubit $2$ cannot be written this way

$$ U'=\text{???}.\tag2 $$

A solution is to introduce subscripts that identify the qubits

$$ U_{123}=\text{CNOT}_{12}\otimes I_3\tag{1'} $$

which allows us to write $(2)$ as

$$ U_{123}'=\text{CNOT}_{13}\otimes I_2.\tag{2'} $$

Computing matrix elements of tensor products

The additional advantage of this more explicit notation is that it provides a simple algorithm for computing matrix elements of tensor products. To that end replace qubit list like $123$ with two lists of indices like $i_1i_2i_3;k_1k_2k_3$ where $i_m$ are row indices and $k_m$ are column indices and where $m\in\{1,2,3\}$ identifies a qubit corresponding to each index. Then $(2)$ becomes

$$ U_{i_1i_2i_3;k_1k_2k_3}=\text{CNOT}_{i_1i_2;k_1k_2}I_{i_3;k_3}\tag3 $$

and $(2')$ becomes

$$ U_{i_1i_2i_3;k_1k_2k_3}'=\text{CNOT}_{i_1i_3;k_1k_3}I_{i_2;k_2}.\tag{3'} $$

If we now interpret $i_1i_2i_3\in\{000,001,\dots,111\}$ as the binary encoding of the row number of the matrix on the LHS and $k_1k_2k_3$ as the binary encoding of the column number, then $(3)$ and $(3')$ give us simple direct formulas for computing matrix elements of $U$ and $U'$ from the matrix elements of the factor matrices $\text{CNOT}$ and $I$.

Example

For example, the matrix of the CNOT gate is

$$ \text{CNOT}=\begin{bmatrix} 1&0&0&0\\ 0&1&0&0\\ 0&0&0&1\\ 0&0&1&0 \end{bmatrix}.\tag4 $$

In other words,

$$ \text{CNOT}_{ij;i'j'}=\begin{cases} 1&\text{ if }i=i'=0\text{ and }j=j',\\ 1&\text{ if }i=i'=1\text{ and }j\ne j',\\ 0&\text{ otherwise}. \end{cases}\tag5 $$

Also,

$$ I_{i;j}=\begin{cases} 1\text{ if }i=j,\\ 0\text{ if }i\ne j. \end{cases}\tag6 $$

Substituting $(5)$ and $(6)$ into $(3)$, we get

$$ U_{123} = \text{CNOT}_{12}\otimes I_3 = \begin{bmatrix} 1&&&&&&&\\ &1&&&&&&\\ &&1&&&&&\\ &&&1&&&&\\ &&&&&&1&\\ &&&&&&&1\\ &&&&1&&&\\ &&&&&1&& \end{bmatrix}\tag7 $$

and substituting $(5)$ and $(6)$ into $(3')$, we get

$$ U_{123}' = \text{CNOT}_{13}\otimes I_2 = \begin{bmatrix} 1&&&&&&&\\ &1&&&&&&\\ &&1&&&&&\\ &&&1&&&&\\ &&&&&1&&\\ &&&&1&&&\\ &&&&&&&1\\ &&&&&&1& \end{bmatrix}.\tag{7'} $$

Kronecker product

Finally, it is not hard to check that the above algorithm recovers the usual definition of the Kronecker product

$$ A\otimes B=\begin{bmatrix}a_{11}B&\dots&a_{1n}B\\&\dots&\\a_{n1}B&\dots&a_{nn}B\end{bmatrix}\tag8 $$

as a special case since in terms of matrix elements $(4)$ can be written as

$$ (A\otimes B)_{i_1i_2;k_1k_2} = A_{i_1;k_1}B_{i_2;k_2}\tag9 $$

where the compound indices $i_1i_2$ and $k_1k_2$ are to be interpreted as above.

Adam Zalcman
  • 25,260
  • 3
  • 40
  • 95