Drawing
Drawing
display(x, qcd=None, layout='LR', theme='light', fill=True, **kwargs)
Display a block, circuit, or quantum model.
The kwargs
are forwarded to
the underlying nx.Graph
, so you can e.g. specify the size of the resulting plot via
size="2,2"
(see examples)
PARAMETER | DESCRIPTION |
---|---|
x |
TYPE:
|
qcd |
Circuit diagram to plot the block into.
TYPE:
|
layout |
Can be either "LR" (left-right), or "TB" (top-bottom).
TYPE:
|
theme |
Available themes are: ["light", "dark", "black", "white"].
TYPE:
|
fill |
Whether to fill the passed
TYPE:
|
kwargs |
Passed on to
TYPE:
|
Examples:
from qadence import X, Y, kron
from qadence.draw import display
b = kron(X(0), Y(1))
display(b, size="1,1", theme="dark")
Source code in qadence/draw/__init__.py
savefig(x, filename, *args, **kwargs)
Save a block, circuit, or quantum model to file. Accepts the same args/kwargs as display
.
PARAMETER | DESCRIPTION |
---|---|
x |
TYPE:
|
filename |
Should end in svg/png.
TYPE:
|
args |
Same as in
TYPE:
|
kwargs |
Same as in
TYPE:
|
Examples:
from qadence import X, Y, kron
from qadence.draw import display
b = kron(X(0), Y(1))
savefig(b, "test.svg", size="1,1", theme="dark")