Skip to content

Commit

Permalink
Merge pull request #204 from BBN-Q/feature/tdm-chan
Browse files Browse the repository at this point in the history
Add TDM channels
  • Loading branch information
Diego Ristè committed Apr 12, 2019
2 parents 5b031c0 + 79e1fb6 commit e8676de
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions QGL/ChannelLibraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ def load_from_library(self, return_only=False):
params["phys_chan"] = meas_instr + "-" + meas_chan
params["meas_type"] = "autodyne"
params["receiver_chan"] = "RecvChan-" + qubit["measure"]["receiver"]
if "tdm_chan" in qubit["measure"].keys():
params['tdm_chan'] = qubit["measure"]["tdm_chan"]
params["__module__"] = "QGL.Channels"
params["__class__"] = "Measurement"
channel_dict[params["label"]] = params
Expand Down
1 change: 1 addition & 0 deletions QGL/Channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ class Measurement(LogicalChannel):
gate_chan = Instance((str, LogicalMarkerChannel))
trig_chan = Instance((str, LogicalMarkerChannel))
receiver_chan = Instance((str, ReceiverChannel))
tdm_chan = Int(0).tag(desc='tdm input for this digitized measurement result')

def __init__(self, **kwargs):
super(Measurement, self).__init__(**kwargs)
Expand Down
6 changes: 4 additions & 2 deletions QGL/drivers/APS2Pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,8 @@ def tdm_instructions(seqs):

elif isinstance(s, PulseSequencer.Pulse):
if s.label == 'MEAS' and s.maddr != (-1, 0):
instructions.append(CrossBar(2**s.maddr[1], 0x1, label=label))
tdm_chan = m.channel.tdm_chan if getattr(m.channel, 'tdm_chan') else 1
instructions.append(CrossBar(2**s.maddr[1], 2**(tdm_chan-1), label=label))
instructions.append(LoadCmp(label=label))
instructions.append(StoreMeas(s.maddr[0], 1 << 16, label=label))

Expand All @@ -1409,7 +1410,8 @@ def tdm_instructions(seqs):
if len(set(maddr))>1:
raise Exception('Storing simultaneous measurements on different addresses not supported.')
for n,m in enumerate(sim_meas):
instructions.append(CrossBar(2**m.maddr[1], 2**n))
tdm_chan = m.channel.tdm_chan if getattr(m.channel, 'tdm_chan') else n+1 #default 0
instructions.append(CrossBar(2**m.maddr[1], 2**(tdm_chan-1)))
instructions.append(LoadCmp(label=label))
instructions.append(StoreMeas(maddr[0], 1 << 16))

Expand Down

0 comments on commit e8676de

Please sign in to comment.