-
Notifications
You must be signed in to change notification settings - Fork 10
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
Circuit drawer #75
Circuit drawer #75
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
Thank you for a cool feature!
|
Thank you for your response. |
Now it works correctly!
|
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.
There may be a problem in the "devide and fold" section.
from quri_parts.circuit import QuantumCircuit
from quri_parts.circuit.utils.circuit_drawer import draw_circuit
c = QuantumCircuit(4)
c.add_X_gate(1)
c.add_CNOT_gate(0, 3)
c.add_SWAP_gate(0, 2)
c.add_X_gate(1)
draw_circuit(c, 32)
"""
-----------●--------x-----------
| |
___ | | ___
| X | | | | X |
--|0 |----|--------|----|3 |--
|___| | | |___|
| |
| |
-----------|--------x-----------
|
_|_
|CX |
---------|1 |------------------
|___|
"""
draw_circuit(c, 24)
"""
2
-----------●--------x---
| |
___ | |
| X | | |
--|0 |----|--------|---
|___| | |
| |
| |
-----------|--------x---
|
_|_
|CX |
---------|1 |----------
|___|
"""
A part of the circuit is truncated when the line_length
is short.
Co-authored-by: KAWAKUBO Toru <dev@kwkbtr.info>
Co-authored-by: KAWAKUBO Toru <dev@kwkbtr.info>
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.
LGTM, thanks!
Added circuit visualizer based on qulacs-visualizer.
Note that current implementation only supportNonParametricQuantumCircuit
.↑ Updated ee3eaa8
examples: