[Bug] Interpreter stabilizer: `IsResourceEstimating()` is an unknown intrinsic
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- backend, testing-qa
Research direction
Start by locating CliffordSim::custom_intrinsic in the stabilizer simulator and compare its handling with SparseSim, which the issue says already supports this intrinsic. Run the Python reproduction with the Adaptive_RIF profile and stabilizer backend. Done means the program returns [Zero, Zero] instead of an unknown intrinsic error.
Written by the indexing model from the issue text.
Description
- Symptom: Rejected
- Release
5a7b2ee32: Non-regression - Where: interpreter · qsharp.run(type='stabilizer')
Summary. Any program calling IsResourceEstimating() (including library code such as AddLookup) fails on the stabilizer simulator with 'unknown intrinsic'.
Q# repro (Main.qs)
// Interpreter stabilizer backend: Std.ResourceEstimation.IsResourceEstimating() is an unknown intrinsic.
// Expected: false -> program returns Zero. Observed (qsharp.run(type="stabilizer")): "unknown intrinsic `IsResourceEstimating`".
// (Sparse and the QIR simulators return Zero.) Needs a profile that allows classical-if (Adaptive_RIF / Unrestricted).
namespace Repro {
@EntryPoint()
operation Main() : Result {
use q = Qubit();
if Std.ResourceEstimation.IsResourceEstimating() { X(q); }
MResetZ(q)
}
}
Python repro
# F8: CliffordSim::custom_intrinsic has no "IsResourceEstimating" arm.
from qdk import qsharp, Result
SRC = """
namespace Repro {
operation Main() : Result {
use q = Qubit();
if Std.ResourceEstimation.IsResourceEstimating() { X(q); }
MResetZ(q)
}
}
"""
qsharp.init(target_profile=qsharp.TargetProfile.Adaptive_RIF)
qsharp.eval(SRC)
print("sparse :", qsharp.run("Repro.Main()", shots=2, seed=1, type="sparse"), "(expected [Zero, Zero])")
try:
got = qsharp.run("Repro.Main()", shots=2, seed=1, type="stabilizer")
except qsharp.QSharpError as e:
msg = str(e).strip().splitlines()[0]
print("stabilizer: ERROR", msg)
if "unknown intrinsic" in msg and "IsResourceEstimating" in msg:
print(f"VERDICT: REPRODUCED - {msg}")
raise SystemExit(1)
print(f"VERDICT: INCONCLUSIVE - different error: {msg}")
raise SystemExit(2)
print("stabilizer:", got)
if got == [Result.Zero] * 2:
print("VERDICT: NOT REPRODUCED - stabilizer returns Zero")
raise SystemExit(0)
print(f"VERDICT: REPRODUCED - stabilizer returned {got}")
raise SystemExit(1)
| Build | Result | Evidence |
|---|---|---|
release 5a7b2ee32 |
bug present | Error: unknown intrinsic IsResourceEstimating |
main 42c843a20 |
bug present | Error: unknown intrinsic IsResourceEstimating |
Observed: stabilizer: Error: unknown intrinsic IsResourceEstimating (sparse returns [Zero, Zero])
Expected: [Zero, Zero]
Probable cause. CliffordSim::custom_intrinsic has no IsResourceEstimating arm (SparseSim handles it).
Originally reported as A127
- 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
-
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
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