ATQ101: Incorrect flag on non-ARTIQ delay() calls
Summary
flake8-artiq
flags on calls to https://qiskit.org/documentation/stubs/qiskit.pulse.builder.delay.html#qiskit.pulse.builder.delay
Details
Found when running CI tests on some UMD EURIQA code: https://gitlab.com/UMD-EURIQA/euriqa-artiq/-/jobs/1137649046#L329
The relevant lines are: https://gitlab.com/UMD-EURIQA/euriqa-artiq/-/blob/7d259fe733f5acf1f846d948f5a67415827fd30f/euriqafrontend/repository/rfsoc/ramsey.py#L140-142
Basically (for those who don't have access):
import qiskit.pulse as qp
def ramsey_function():
with qp.build() as schedule:
qp.play(qp.Constant(100, qp.DriveChannel(0))
qp.delay(1000, qp.DriveChannel(0))
qp.play(qp.Constant(100, qp.Drivechannel(0))
return schedule
I think that the call to qp.delay()
is flagging against flake8-artiq
because it doesn't check the source of the delay()
function, so if a similar function name exists in a separate library, then flake8-artiq
will flag.
Relevant Code
Code version
- Using
flake8-artiq
from MLabs'snix-scripts
at 42df27a7fd6edf6df8aa663ce7cb7f4e8a1ddbdd (https://git.m-labs.hk/M-Labs/nix-scripts/src/commit/42df27a7fd6edf6df8aa663ce7cb7f4e8a1ddbdd), which usesflake8-artiq
f16bda40
Edited by Drew Risinger