# How do you write the matrix form of $Z_1 Z_2$ as a quantum circuit?

In order to perform the projective measurement to identify the error we must apply the $Z_1 \otimes Z_2 \otimes I$ operator. How do we represent this in quantum circuit notation?
The matrix form is a diagonal matrix with the diagonal: $$\begin{matrix}(1 &&-1&&-1&&1&&1&&-1&&-1&&1)\end{matrix}$$
The Kronecker product of matrices is the matrix representation of the linear transformation on a tensor product of spaces obtained by letting two linear transformations act independently on the factors. This should be understood in the tensor product basis whose elements could be written $|ij\rangle$ if $|i\rangle, |j\rangle$ are basis elements of the factors, and ordered in such a way that for each $i$, $j$ runs through all possibilities before $i$ is incremented.
In your case the transformation is already written as a tensor product, and the circuit simply is a 3-qubit system, where in parallel $Z_1$ is applied to the first qubit, $Z_2$ to the second, and $I$ to the third (doing nothing). If you don't know what these single-qubit gates do, you could easily factor the matrix of the compound transformation.