Skip to content

Commit

Permalink
Merge afbe77c into 0dae294
Browse files Browse the repository at this point in the history
  • Loading branch information
Himorask committed Feb 20, 2019
2 parents 0dae294 + afbe77c commit 2269021
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions QGL/ChannelLibraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,16 @@ def new_source(self, label, model, address, power=-30.0, frequency=5.0e9, refere
self.add_and_update_dict(thing)
return thing

def set_control(self, qubit_or_edge, transmitter, generator=None):
def set_control(self, qubit_or_edge, transmitter, generator=None, aps1_chan=None):
quads = [c for c in transmitter.channels if isinstance(c, Channels.PhysicalQuadratureChannel)]
markers = [c for c in transmitter.channels if isinstance(c, Channels.PhysicalMarkerChannel)]

if isinstance(transmitter, Channels.Transmitter) and len(quads) > 1:
raise ValueError("In set_control the Transmitter must have a single quadrature channel or a specific channel must be passed instead")
#raise ValueError("In set_control the Transmitter must have a single quadrature channel or a specific channel must be passed instead")
print("Warning: In set_control the Transmitter must have a single quadrature channel if using APS2. Assuming APS1.")
if aps1_chan != '12' and aps1_chan != '34':
raise ValueError("Assuming APS1, specify APS channel 12 or 34")
phys_chan = transmitter.ch(aps1_chan)
elif isinstance(transmitter, Channels.Transmitter) and len(quads) == 1:
phys_chan = quads[0]
elif isinstance(transmitter, Channels.PhysicalQuadratureChannel):
Expand Down Expand Up @@ -423,12 +427,16 @@ def set_qubit_connectivity(self, graph):
self.add_and_update_dict(new_edges)
return new_edges

def set_measure(self, qubit, transmitter, receivers, generator=None, trig_channel=None, gate=False, gate_channel=None, trigger_length=1e-7):
def set_measure(self, qubit, transmitter, receivers, generator=None, trig_channel=None, gate=False, gate_channel=None, trigger_length=1e-7, aps1_chan=None):
quads = [c for c in transmitter.channels if isinstance(c, Channels.PhysicalQuadratureChannel)]
markers = [c for c in transmitter.channels if isinstance(c, Channels.PhysicalMarkerChannel)]

if isinstance(transmitter, Channels.Transmitter) and len(quads) > 1:
raise ValueError("In set_measure the Transmitter must have a single quadrature channel or a specific channel must be passed instead")
#raise ValueError("In set_measure the Transmitter must have a single quadrature channel or a specific channel must be passed instead")
print("Warning: In set_measure the Transmitter must have a single quadrature channel if using APS2. Assuming APS1.")
if aps1_chan != '12' and aps1_chan != '34':
raise ValueError("Assuming APS1, specify APS channel 12 or 34")
phys_chan = transmitter.ch(aps1_chan)
elif isinstance(transmitter, Channels.Transmitter) and len(quads) == 1:
phys_chan = quads[0]
elif isinstance(transmitter, Channels.PhysicalQuadratureChannel):
Expand Down

0 comments on commit 2269021

Please sign in to comment.