Skip to content

Edge names broken due to autoreplace of - by _ in qcodes==0.34 (InstrumentBase.__init__)

QCoDeS 0.34 has introduced autoreplace of - by _ in Instrument names.

This breaks our Edge naming

edge_name = f"{parent_element_name}-{child_element_name}"

https://gitlab.com/quantify-os/quantify-scheduler/blob/4ba71685f0f31bcb22f7fe90face8b3a9e3cce56/quantify_scheduler/device_under_test/edge.py#L19-19

and thereby a bunch of tests

/usr/local/lib/python3.8/site-packages/qcodes/instrument/base.py:416: UserWarning: Changed q2-q3 to q2_q3 for instrument identifier
    warnings.warn(f"Changed {name} to {new_name} for instrument identifier")

Current state of qcodes has advanced a bit further but still doesn't appear to allow for -

        name = self._replace_hyphen(name)
        self._short_name = name
        self._is_valid_identifier(self.full_name)

https://github.com/QCoDeS/Qcodes/blob/3a6c8f7d47fb3c449ef89cc6a7e5ceacd5ad068a/qcodes/instrument/base.py#L55-L57

https://github.com/QCoDeS/Qcodes/pull/4257

Solution

In Developer's meeting it has been decided to:

  • Move to underscore in edge names instead of dash
  • Disallow dash in qubit name: raise an exception in the init (of DeviceElement?)

As part of this, also please:

  • update
    def _find_edge(device_cfg, q0, q1, op_name):
    to
    def _find_edge(device_cfg, parent_element_name, child_element_name, op_name):
Edited by Edgar Reehuis