The error is being raised as the RelativeBarrier object is in sched, and doesn't have a channel attribute. Interestingly, I'm fairly sure this can be fixed by just doing nothing for barrier instructions. block_to_schedule already puts absolute timing in all of the other instructions (which is what we use), so there is no need to interpret the contents of barrier instructions in the converter.
As the converter already takes action based on the type of instruction (and only handles the types of instructions it needs to know about), I think this can be fixed by just changing the single line chan = inst.channel.name, either by eliminating it and directly using inst.channel.name in the few blocks that follow, or doing chan = inst.channel.name if hasattr(inst, "channel") else None.
The following example is courtesy of @zlianghahaha :
This raises the error:
The error is being raised as the
RelativeBarrier
object is insched
, and doesn't have achannel
attribute. Interestingly, I'm fairly sure this can be fixed by just doing nothing for barrier instructions.block_to_schedule
already puts absolute timing in all of the other instructions (which is what we use), so there is no need to interpret the contents of barrier instructions in the converter.As the converter already takes action based on the type of instruction (and only handles the types of instructions it needs to know about), I think this can be fixed by just changing the single line
chan = inst.channel.name
, either by eliminating it and directly usinginst.channel.name
in the few blocks that follow, or doingchan = inst.channel.name if hasattr(inst, "channel") else None
.