Skip to content
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

Matplotlib circuit drawer #1370

Merged

Conversation

sergiomtzlosa
Copy link
Contributor

A new class named MPLDrawer to draw the circuit using matplotlib, this is a code integration and enhancement from https://github.com/rpmuller/PlotQCircuit.

The circuit now has a function called draw_mpl() to invoke matplotlib on drawing.

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.

sergiomtzlosa and others added 30 commits June 20, 2024 14:52
Copy link
Member

@alecandido alecandido left a comment

Choose a reason for hiding this comment

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

There are things that may still be improved. But that will be the case forever ^^

As the first implementation of this feature in Qibo, it is definitely acceptable.

Thanks a lot @sergiomtzlosa! :)

src/qibo/ui/mpldrawer.py Outdated Show resolved Hide resolved
src/qibo/ui/mpldrawer.py Outdated Show resolved Hide resolved
src/qibo/ui/mpldrawer.py Outdated Show resolved Hide resolved
src/qibo/ui/mpldrawer.py Outdated Show resolved Hide resolved
@MatteoRobbiati MatteoRobbiati self-requested a review August 13, 2024 12:13
Copy link
Contributor

@MatteoRobbiati MatteoRobbiati left a comment

Choose a reason for hiding this comment

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

Thanks a lot @sergiomtzlosa for this!
A few comments follow.

src/qibo/ui/FusedGateBarrier.py Outdated Show resolved Hide resolved
src/qibo/ui/FusedGateBarrier.py Outdated Show resolved Hide resolved
src/qibo/ui/FusedGateBarrier.py Outdated Show resolved Hide resolved
src/qibo/ui/mpldrawer.py Outdated Show resolved Hide resolved
src/qibo/ui/mpldrawer.py Outdated Show resolved Hide resolved
src/qibo/ui/mpldrawer.py Outdated Show resolved Hide resolved
src/qibo/ui/mpldrawer.py Show resolved Hide resolved
src/qibo/ui/mpldrawer.py Outdated Show resolved Hide resolved
Copy link
Contributor

@MatteoRobbiati MatteoRobbiati left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the modifications @sergiomtzlosa.
If it is fine with you I would prefer to align the docstrings style with the rest of Qibo :) The docstrings here are a bit different from the "canonical" way we do them. You can take this or this as examples (I just selected them randomly).

Finally, I was wondering if we aim to add the mpldrawer to the documentation. In that case we have to add it to the doc/source files. I think it would be nice to prepare a simple example to show the users how to use the drawer :)

Once this is done, I think we are ready to merge!

@sergiomtzlosa
Copy link
Contributor Author

Hi,

Thanks a lot for your support and advices, I have uploaded the documentation and gave and example on the doc/source path, please, let me know if this is enough of not.

Thanks!

Copy link
Contributor

@MatteoRobbiati MatteoRobbiati left a comment

Choose a reason for hiding this comment

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

Thanks a lot @sergiomtzlosa!

@MatteoRobbiati MatteoRobbiati added this pull request to the merge queue Sep 4, 2024
Merged via the queue into qiboteam:master with commit 47cb206 Sep 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants