-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix circuit drawer for instructions with circuit parameters #9942
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
af823bb
fix: modify get_param_str to prevent circuit drawer from displaying p…
diemilio 9e966e0
fix lint errors
diemilio b9111cd
Merge branch 'main' into fix-drawer-for-instr
diemilio 6624604
test: add circuit drawer test for instructions with parameters of typ…
diemilio 48d4465
test: add circuit drawer tests for no parameters and params of type n…
diemilio 9c1d40a
fix lint errors
diemilio 7fd576c
remove variable to fix lint error
diemilio fd6ad69
add reno
diemilio 50bcc2e
Merge branch 'main' into fix-drawer-for-instr
diemilio 5feaf89
update releasenotes/notes/fix-circuit-drawer-for-qc-params
diemilio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
releasenotes/notes/fix-circuit-drawer-for-qc-params-e78c67310ae43ccf.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
fixes: | ||
- | | ||
Fixes the circuit drawer from displaying parameters when they are of type :class:`.QuantumCircuit` | ||
since this resulted in an illegible drawing. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine. It would be good to add tests for these 3 cases. Though the code is in
utils.py
, the easiest place to test it would probably be intest_circuit_text_drawer
. Also a simple release note indicating that aQuantumCircuit
as a parameter will no longer display in the circuit drawers due to formatting issues.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much @enavarro51. I wasn't sure if additional tests were needed since this code was a minor change for something I thought was already being tested.
Also, thanks for pointing out where the tests should go. I will look into
test_circuit_text_drawer
and add them. Just to double check, are tests only for the text drawer enough? Or do other drawers (like mpl) need them too?I'll add the reno as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, there apparently aren't any tests for these 3 options. The text drawer is sufficient. You're really just checking the call to
_get_param_str
returns "". You could do that intest_utils
if you want, but I think it's nice to have a visual output for visualizations.