diff --git a/QGL/PulsePrimitives.py b/QGL/PulsePrimitives.py index 24408a3e..25f00f40 100644 --- a/QGL/PulsePrimitives.py +++ b/QGL/PulsePrimitives.py @@ -73,11 +73,10 @@ def Ztheta(qubit, angle=0, label='Ztheta', **kwargs): # special cased because it can be done with a frame update Zprod = TAPulse(label, qubit, length=0, amp=0, phase=0, frameChange=-angle) if hasattr(ChannelLibrary.channelLib,"connectivityG"): - for node in ChannelLibrary.channelLib.connectivityG.nodes(): - #shift the reference for all CR gates with qubit as the target - if ChannelLibrary.channelLib.connectivityG.has_predecessor(qubit,node): - CRchan = ChannelLibrary.channelLib.connectivityG.edge[node][qubit]['channel'] - Zprod = Zprod*TAPulse(label, CRchan, length=0, amp=0, phase=0, frameChange=-angle) + #shift the reference for all CR gates with qubit as the target + for predecessor in ChannelLibrary.channelLib.connectivityG.predecessors(qubit): + CRchan = ChannelLibrary.channelLib.connectivityG.edge[predecessor][qubit]['channel'] + Zprod = Zprod*TAPulse(label, CRchan, length=0, amp=0, phase=0, frameChange=-angle) return Zprod #Setup the default 90/180 rotations