9

In Improved Simulation of Stabilizer Circuits by Aaronson and Gottesman, it is explained how to compute a table describing which Pauli tensor products the X and Z observable of each qubit get mapped to as a Clifford circuit acts upon them.

Here as an example Clifford circuit:

```
0: -------@-----------X---
| |
1: ---@---|---@---@---@---
| | | |
2: ---|---|---@---|-------
| | |
3: ---@---@-------Y-------
```

And the table describing how it acts on the X and Z observables of each qubit:

```
+---------------------+-
| 0 1 2 3 |
+------+---------------------+-
| 0 | XZ X_ __ Z_ |
| 1 | ZZ YZ Z_ ZZ |
| 2 | __ Z_ XZ __ |
| 3 | Z_ X_ __ XZ |
+------+---------------------+-
| sign | ++ ++ ++ ++ |
+------+---------------------+-
```

Each column of the table describes how the circuit acts on the X observable (left half of column) and Z observable (right half of column) of each qubit. For example, the left side of column 3 is Z,Z,_,X meaning an X3 operation (Pauli X on qubit 3) at the right hand side of the circuit is equivalent to a Z1 * Z2 * X4 operation at the left hand side of the circuit. The 'sign' row indicates the sign of the product, which is important if you're going to simulate a measurement (it tells you whether or not to invert the result).

You can also compute the table for the inverse of a circuit. In the example case I've given, the inverse table is this:

```
+---------------------+-
| 0 1 2 3 |
+------+---------------------+-
| 0 | XZ Y_ __ Z_ |
| 1 | _Z YZ Z_ _Z |
| 2 | __ Z_ XZ __ |
| 3 | Z_ Y_ __ XZ |
+------+---------------------+-
| sign | ++ -+ ++ ++ |
+------+---------------------+-
```

The tables look *almost* the same if you transpose their rows and columns. But the entries aren't exactly identical. In addition to transposing, you have to encode the letters into bits (`_`

=00, `X`

=01, `Z`

=10, `Y`

=11) then swap the middle bits then decode. For example, ZZ encodes into 1010 which swaps into 1100 which decodes into Y_.

The question I have is: is there also a simple rule for the computing the inverse table's signs?

Currently I'm inverting these tables by decomposing them into circuits, inverting the circuits, then multiplying them back together. It's extremely inefficient compared to transpose+replace, but if I'm going to use transpose+replace I need a sign rule.

To clarify the question: Let the Clifford circuit be $U$. Then reading the $j$'th column gives $U X_j U^\dagger$ and $U Z_j U^\dagger$ depending on left or right half used. And you want $U^\dagger X_j U$ and $U^\dagger Z_j U$ instead from this data. – AHusain – 2018-09-24T05:44:32.567

@AHusain Correct. – Craig Gidney – 2018-09-24T07:25:02.000

To clarify the question: what do the @ s mean in your Clifford circuit? – Josu Etxezarreta Martinez – 2018-09-24T07:53:47.467

1@JosuEtxezarretaMartinez Those are controls. When two are connected, it's a CZ gate. @ connected to an X is a controlled-X. @ connected to Y is a controlled-Y. – Craig Gidney – 2018-09-24T09:05:50.757