quilc icon indicating copy to clipboard operation
quilc copied to clipboard

Parametric compilation doesn't use 2Q optimality results

Open ecpeterson opened this issue 5 years ago • 0 comments

We recently (#498) introduced a parametric compilation feature for gates described by time-independent Hamiltonians. The technique implemented there works for any number of qubits, but it has no guarantee on optimality of circuit depth. Indeed, in the two-qubit case of XX + YY it emits a circuit with 6 CZs, but a 2 CZ circuit exists:

RZ(3*pi/4)  0
RX(-pi/2)   0
RZ(-3*pi/4) 1
RX(pi/2)    1
CZ          0 1
RZ(-pi/2)   0
RX(pi/2)    0
RZ(%alpha)  0
RX(-pi/2)   0
RZ(-pi/2)   1
RX(pi/2)    1
RZ(%alpha)  1
RX(-pi/2)   1
CZ          0 1
RZ(-pi/2)   0
RX(-pi/2)   0
RZ(pi/4)    0
RZ(-pi/2)   1
RX(pi/2)    1
RZ(-pi/4)   1

There is room for an extension of the CZ-targeting techniques found in src/compilers/approx.lisp to give improved circuits in the 2Q case.

Note: I don't think this can be trampolined to from the n-qubit case.

ecpeterson avatar Jan 18 '20 16:01 ecpeterson