docs(base): fix incorrect device_qubits kwarg in QasmModule.unroll() docstring - #349
Conversation
device_qubits was documented as an accepted **kwargs entry for QasmModule.unroll(), but it is not a parameter of QasmVisitor.__init__ and passing it raises TypeError. Device qubit validation is inferred automatically during unrolling, not user-settable via unroll(). Fixes qBraid#89
Argus reviewAuto-review is off for this repo. Tick the box below to run a review on this PR.
Estimated cost
Tip: you can also comment |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Thanks for this — the core fix is right. Confirmed QasmVisitor.__init__ has no device_qubits parameter and unroll(device_qubits=5) raises TypeError, and the five remaining documented kwargs all work, so the list is accurate once that line is gone.
Two things before merge:
- The replacement Notes text needs a correction — details inline.
- #89 asks for the kwargs to be promoted to explicit named parameters on
unroll(), not just documented, so this doesn't close it as written. Either extend the PR to do that — very welcome, and the corrected docstring makes it straightforward — or drop theCloses #89line from the description.
device_qubits is set via loads(program, device_qubits=N), not unroll(). Auto-inference only applies when consolidate_qubits=True. Move changelog entry under Fixed per review.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Related to #89, but does not close it -- #89 asks for the documented
kwargs to become explicit named parameters on unroll(), which is a
larger, separate change. This PR only corrects the existing docstring
to be accurate.
QasmModule.unroll()'s docstring lists device_qubits as a supported
**kwargs entry, but unroll() forwards kwargs directly to
QasmVisitor.init(), which has no device_qubits parameter.
Calling module.unroll(device_qubits=5) raises:
Device qubit validation is actually inferred automatically inside the
visitor, so it isn't something a caller can set through unroll().
Change:
automatically, not configurable via unroll() kwargs.
Testing:
docstring was inaccurate.