Skip to content

Conversation

mtreinish
Copy link
Member

Summary

For the purpose of documentation many of the circuit library classes
were using the circuit_library_widget to provide a visualization of
the circuit, a QASM definition, and some basic high level statistics
about the circuit. However, since #6634 and #6659 all the circuit
library elements are wrapped in an outer Instruction object. This
makes the top level object appear as a logical block in the circuit.
This has the unintended side effect of causing the widget output to not
be super useful, primarily it would should a single logical block for
each element and the circuit statistics would be for the single element
as opposed to its implementation. This commit address this by adding a
single decompose() call around all the statistics and drawing calls
inside the widget code. Since we're consistently wrapping every circuit
library element the widget will always need to do this now, so instead
of calling it directly in the library docstring it's better to just do
this in the widget itself.

Details and comments

For the purpose of documentation many of the circuit library classes
were using the circuit_library_widget to provide a visualization of
the circuit, a QASM definition, and some basic high level statistics
about the circuit. However, since Qiskit#6634 and Qiskit#6659 all the circuit
library elements are wrapped in an outer Instruction object. This
makes the top level object appear as a logical block in the circuit.
This has the unindended side effect of causing the widget output to not
be super useful, primarily it would should a single logical block for
each element and the circuit statistics would be for the single element
as opposed to its implementation. This commit address this by adding a
single decompose() call around all the statistics and drawing calls
inside the widget code. Since we're consistently wrapping every circuit
library element the widget will always need to do this now, so instead
of calling it directly in the library docstring it's better to just do
this in the widget itself.
@mtreinish mtreinish requested a review from a team as a code owner March 25, 2022 19:22
@mtreinish mtreinish added the Changelog: None Do not include in changelog label Mar 25, 2022
@coveralls
Copy link

Pull Request Test Coverage Report for Build 2041842862

  • 0 of 2 (0.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.001%) to 83.708%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/tools/jupyter/library.py 0 2 0.0%
Files with Coverage Reduction New Missed Lines %
qiskit/tools/jupyter/library.py 2 0%
Totals Coverage Status
Change from base Build 2041143002: -0.001%
Covered Lines: 52968
Relevant Lines: 63277

💛 - Coveralls

Copy link
Contributor

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@mergify mergify bot merged commit a540794 into Qiskit:main Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants