I would like to know some circuit decomposition for an arbitrary controlled Pauli string rotation: \begin{equation} |0\rangle\langle 0| \otimes e^{i \theta (P_1\otimes...\otimes P_n)}+ |1\rangle\langle 1| \otimes I \end{equation} where $P_i$ are Pauli operators. What's a simple circuit decomposition for that?
1 Answer
This is nearly a built-in decomposition in cirq. Here's what happens when you decompose a Pauli product:
import cirq
a, b, c, d, e = cirq.LineQubit.range(5)
product = cirq.X(a) * cirq.X(b) * cirq.Y(c) * cirq.Y(d) * cirq.Z(e)
power = product**0.125
ops = cirq.decompose_once(power)
print(cirq.Circuit(ops).to_text_diagram(use_unicode_characters=False))
Which prints:
0: ---Y^-0.5---X---X---X---X---Z^(1/8)---X---X---X--------X--------Y^0.5---
| | | | | | | |
1: ---Y^-0.5---@---|---|---|-------------|---|---|--------@--------Y^0.5---
| | | | | |
2: ---X^0.5--------@---|---|-------------|---|---@--------X^-0.5-----------
| | | |
3: ---X^0.5------------@---|-------------|---@---X^-0.5--------------------
| |
4: ---I--------------------@-------------@---I-----------------------------
It works by conjugating the Pauli product by single qubit gates to turn it into a product of Z observables, then conjugating by CNOTs to reduce that to a single Z observable, then phasing that single observable.
Anyways, the point is that the key operation in this entire thing is that one Z gate in the middle. Everything else is self-undoing conjugation. So...
C: ----------------------------@-------------------------------------------
|
0: ---Y^-0.5---X---X---X---X---Z^(1/8)---X---X---X--------X--------Y^0.5---
| | | | | | | |
1: ---Y^-0.5---@---|---|---|-------------|---|---|--------@--------Y^0.5---
| | | | | |
2: ---X^0.5--------@---|---|-------------|---|---@--------X^-0.5-----------
| | | |
3: ---X^0.5------------@---|-------------|---@---X^-0.5--------------------
| |
4: ---I--------------------@-------------@---I-----------------------------
Controlling that one key gate controls the entire operation.