[Stim] Accept lowercase and mixed-case instruction names
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
The failure is the Qdk.Stim.Semantic.UnknownInstruction error raised by qdk.stim.compile on lowercase or mixed-case gate names. Start by finding where instruction names are looked up and make that lookup case-insensitive, including the cnot and zcx aliases. Done when the reproduction script in the issue prints NOT REPRODUCED.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
Stim treats gate names as case-insensitive: h 0, cx 0 1 and Mpp Z0 are all valid Stim. qdk.stim rejects them with Qdk.Stim.Semantic.UnknownInstruction, so some valid Stim files can't be compiled.
import sys
import qdk.stim
failed = []
for src in ["R 0\nh 0\nm 0", "R 0\nH 0\nMpp Z0", "R 0 1\ncx 0 1\nM 0 1"]:
try:
qdk.stim.compile(src)
except Exception:
failed.append(src)
if failed:
print("Rejected:", failed)
print("REPRODUCED")
sys.exit(1)
print("NOT REPRODUCED")
Describe the solution you'd like
Match instruction names case-insensitively (including aliases such as cnot and zcx), as Stim does.
Additional context
Found by differential fuzzing against Stim 1.16.0.
- Dominant language
- Rust
- Stars
- 1k
- Forks
- 226
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 72
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/qdk
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug low-priority
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/qdk#4187 · 1 comment ·
Maintainers usually reply within 1 day
-
bug bulk-filed needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
libracoder/kiri#935 ·
Maintainers usually reply within 1 day
-
Node's `index.d.ts` declares no constructor for `VirtxError`, so TypeScript rejects its argumentsOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
kashsuks/Pinel#172 · 1 comment ·
Maintainers usually reply within 1 day