[Stim] Accept ! and * in CORRELATED_ERROR / ELSE_CORRELATED_ERROR targets
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 66/100
Research direction
The two diagnostics named in the issue, Qdk.Stim.Semantic.UnsupportedTarget and Qdk.Stim.Semantic.NegatedTarget, are the entry points: search for where they are raised and find the code that validates E, CORRELATED_ERROR and ELSE_CORRELATED_ERROR targets. Run the reproduction script from the issue to confirm the failures. Done when the * and ! forms compile to the same channel as the plain form and the script prints NOT REPRODUCED.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
Low priority. qdk.stim rejects two Stim spellings of CORRELATED_ERROR/E and ELSE_CORRELATED_ERROR targets that Stim accepts:
| Input | Stim | qdk.stim |
|---|---|---|
E(0.1) X0 Z1 |
OK | OK |
E(0.1) X0*Z1, E(0.1) X0 * Z1 |
OK, same channel as X0 Z1 |
Qdk.Stim.Semantic.UnsupportedTarget |
E(0.1) !X0 Z1 |
OK, same channel as X0 Z1 |
Qdk.Stim.Semantic.NegatedTarget |
In both cases the meaning is unchanged. A correlated error's targets already form one Pauli product, so * is redundant. A ! only changes the global phase of the applied Pauli. Stim samples identical results for each pair (checked with Stim 1.16.0). (MPP X0 * Z1 is already accepted by qdk.stim.)
import sys
import qdk.stim
failed = []
for src in ["E(0.1) X0*Z1", "E(0.1) X0 * Z1", "E(0.1) !X0 Z1",
"E(0.1) X0\nELSE_CORRELATED_ERROR(0.2) X0*!Z1"]:
try:
qdk.stim.compile(src)
except Exception as e:
failed.append(src)
print(repr(src), "->", str(e).splitlines()[0])
if failed:
print("REPRODUCED")
sys.exit(1)
print("NOT REPRODUCED")
Describe the solution you'd like
For E/CORRELATED_ERROR/ELSE_CORRELATED_ERROR, treat * combiners like whitespace, with or without spaces around them. Accept ! on Pauli targets and ignore it.
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 72/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