openquantumhardware/qick

B_PHASE class attribute missing on AxisSgMux4Vx classes

dmtvanzanten opened this issue · 2 comments

The series of AxisSgMux4Vx classes is missing the B_PHASE class attribute which makes calls to .deg2reg() failing with

File .....\qick_lib\qick\qick_asm.py:504, in QickConfig.deg2reg(self, deg, gen_ch, ro_ch)
    502 if ch_cfg is None:
    503     raise RuntimeError("must specify either gen_ch or ro_ch!")
--> 504 b_phase = ch_cfg['b_phase']
    505 return to_int(deg, 2**b_phase/360, parname='phase') % 2**b_phase

KeyError: 'b_phase'

NOTE: the AxisSgMux8V1 class does have the B_PHASE class attribute.

Update:
The class subclasses a class that does carry the B_PHASE class attribute, but this is default to None, which I guess causes it not to be included in the ch_cfg dict. To some degree this is not terrible, as the AxisSgMux4Vx classes don't 'have' a phase, but perhaps a better error message can be implemented.

meeg commented

Are you calling deg2reg directly? There's a check in declare_gen() which should block you from defining phases for those generators and I think that should be the only place you'd try to do it for a muxed generator, so I want to understand how you got here.

I am calling deg2reg directly indeed. I think I may have ended up here due to being used to do this for other generators when I'm using their phase in register (Ramsey stuff etc...)