Serialization of TwoQubitQPDGate
should not decompose it into two SingleQubitQPDGate
s
#443
Labels
cutting
QPD-based circuit cutting code
qpd
Related to quasi-probability decompositions
serialization
Related to serialization of our custom objects
Assuming #417 is fixed upon merging #442, it will be possible to serialize the QPDGates. However, in the course of serializing a
TwoQubitQPDGate
, it will first be decomposed to twoSingleQubitQPDGate
s. This is probably not desirable: it would almost certainly be better for aTwoQubitQPDGate
to make it through a serialization/deserialization process unchanged.To fix this, we can make
TwoQubitQPDGate._define
do nothing ifbasis_id is None
, just like inSingleQubitQPDGate._define
. However, we will need to provide users a straightforward way to decompose all (or perhaps some?)TwoQubitQPDGate
s in a circuit intoSingleQubitQPDGate
s. Right now this can be accomplished withcircuit.decompose(TwoQubitQPDGate)
, but this procedure would no longer work with the change suggested here. Whatever we do, we should be sure to document it carefully in the release notes.The text was updated successfully, but these errors were encountered: