tket icon indicating copy to clipboard operation
tket copied to clipboard

`squash_1qb_to_tk1` does not preserve conditional phase

Open lmondada opened this issue 3 years ago • 1 comments

The following code

Circuit circ(1, 1);
circ.add_conditional_gate<unsigned>(OpType::Rz, {2.}, {0}, {0}, 1);
std::cout << circ;
Transforms::squash_1qb_to_pqp(OpType::Rz, OpType::Ry).apply(circ);
std::cout << circ;

prints an empty circuit with phase 1.0, ie:

Phase (in half-turns): 1.0

expected:

IF ([c[0]] == 1) THEN Rz(2) q[0];
Phase (in half-turns): 0.0

or equivalent.

lmondada avatar Oct 05 '22 12:10 lmondada

Fix on its way...

lmondada avatar Oct 05 '22 12:10 lmondada