Indeed, I just found it useful for keeping some constant information about each field here (and also in some other case in #733). It can be replaced by a constant variable, for example
SYMMETRIC_GATES = {"CZ", "iSWAP"}
and then field.metadata["symmetric"] would be just field.name in SYMMETRIC_GATES but I found it a bit more organized to use metadata (actually more in #733 than here).
for the most part these are just creating a Pulse with arbitrary start time, so once we remove start from the Pulse they'll automatically become redundant. That's why I don't worry much about them now (they are also not a priority as long as they don't break anything).
Still SingleQubitNatives and TwoQubitNatives will probably be needed for the serialization/deserialization of the runcard and also to provide the interface:
After pulse refactoring is complete:
Indeed, I just found it useful for keeping some constant information about each field here (and also in some other case in #733). It can be replaced by a constant variable, for example
and then
field.metadata["symmetric"]
would be justfield.name in SYMMETRIC_GATES
but I found it a bit more organized to usemetadata
(actually more in #733 than here).General comment regarding native.py is that we could probably drop most of it. Particularly
NativePulse
,NativeSequence
,CouplerPulse
should be replaced byPulse
/PulseSequence
objects once their refactoring is done. As you can probably see, for example here https://github.com/qiboteam/qibolab/blob/33f4519cdf28b9958278a1b80be09ecae16e9350/src/qibolab/native.py#L69for the most part these are just creating a
Pulse
with arbitrarystart
time, so once we removestart
from thePulse
they'll automatically become redundant. That's why I don't worry much about them now (they are also not a priority as long as they don't break anything).Still
SingleQubitNatives
andTwoQubitNatives
will probably be needed for the serialization/deserialization of the runcard and also to provide the interface:I am not sure if there is a better way to implement them but I would still leave it after the pulse refactor (maybe open issue).
_Originally posted by @stavros11 in https://github.com/qiboteam/qibolab/pull/737#discussion_r1446019587_