tket
tket copied to clipboard
`squash_1qb_to_tk1` does not preserve conditional phase
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.
Fix on its way...