- Compilation/
Pauli Product Rotations
Pauli Product Rotations
Parametrized gates
We list typical parametrized gates with their PPR decomposition. The cost of a gate is critically dependent on its angle, making it impractical to assign a fixed cost. To actually determine the cost, floating point angles need to be discretized and transformed to the (Clifford + T) gate set.
Operator | PPR | Comment |
---|---|---|
PauliRot | e^{-i \frac{\phi}{2} P} | note the factor -\frac{1}{2} in the exponent |
RZ | e^{-i \frac{\phi}{2} Z} | same logic for RX and RY |
PhaseShift | e^{i \frac{\phi}{2}}e^{-i \frac{\phi}{2} Z} | |
ControlledPhaseShift | e^{i \frac{\phi}{4}}e^{-i \frac{\phi}{4} Z_0} e^{-i \frac{\phi}{4} Z_1} e^{i \frac{\phi}{4} Z_0 Z_1} | |
CRX | e^{i \frac{\phi}{4} Z_0 X_1} e^{-i \frac{\phi}{4} X_1} | |
CRY | e^{i \frac{\phi}{4} Z_0 Y_1} e^{-i \frac{\phi}{4} Y_1} | |
CRZ | e^{i \frac{\phi}{4} Z_0 Z_1}e^{-i \frac{\phi}{4} Z_1} | |
PSWAP | e^{-i (\frac{\pi}{4} - \frac{\phi}{2})} e^{i (\frac{\pi}{4} - \frac{\phi}{2}) Z_0 Z_1} e^{-i \frac{\pi}{4} X_0 X_1} e^{-i \frac{\pi}{4} Y_0 Y_1} | Note that the XX and YY coefficients are static |
SingleExcitation | e^{i \frac{\phi}{4}( XY - YX)} | Givens rotation, all generators commute |
DoubleExcitation | e^{i \frac{\phi}{2^4}(XXXY + XXYX - XYXX + XYYY - YXXX + YXYY - YYXY - YYYX)} | all generators commute |
MultiControlledPhaseShift
Let us denote a controlled PhaseShift gate with multiple controls as a MultiControlledPhaseShift
, or, C_{1, 2, .., n-1}(R_\phi). In code, this can be realized as
qml.ctrl(qml.PhaseShift(phi, wires=[n]), control=range(1, n))
For n=3 qubits, the PPR decomposition takes the following form:
Note that we collected generators with the same Pauli weight in a single exponent for the sake of brevity. Formally, this can be written as
where P_Z(\ell, n) is the sum of all possible pure Z Pauli words with Pauli weight \ell on n qubits. We define P_Z(0, n) as the identity, so this PPR term is just a global phase.
This can alternatively be understood in code:
import pennylane as qml
from itertools import combinations
def MultiControlledPhaseShift(phi, n):
qml.exp(1j * phi/(2**n) * I(range(n)))
for i in range(1, n+1):
for ops in combinations([Z(jj) for jj in range(n)], i):
qml.exp(1j * (-1)**i * phi/(2**n) * qml.prod(*ops))
And can be easily verified:
from functools import partial
import numpy as np
n = 4
phis = np.linspace(0, np.pi, 50)
U_decomp = qml.matrix(MultiControlledPhaseShift, wire_order=range(n))
@partial(qml.matrix, wire_order=range(n))
def U(phi, n):
qml.ctrl(qml.PhaseShift(phi, wires=[n-1]), control=range(n-1))
all(np.allclose(U_decomp(phi, n), U(phi, n)) for phi in phis)
# True
PCPhase
The PCPhase gate can be decomposed into individual MultiControlledPhaseShift
operations, as detailed here. So together with the above decomposition of MultiControlledPhaseShift
, we can decompose any PCPhase
gate into PPRs.