Python module for displaying pytket circuits when offline.
Project description
Pytket-offline-display
This pytket extension package provides offline circuit rendering functionality.
To use, first install the package with pip
:
pip install pytket-offline-display
Then replace the usual pytket.circuit.display
import with pytket.extensions.offline_display
. For example:
from pytket.extensions.offline_display import render_circuit_jupyter
from pytket import Circuit
circ = Circuit(2,2)
circ.H(0)
circ.CX(0,1)
circ.measure_all()
render_circuit_jupyter(circ)
If you want to control the default options, you can instead load a configurable instance. (Note that this requires pytket >= 1.15)
from pytket.extensions.offline_display import get_circuit_renderer
circuit_renderer = get_circuit_renderer()
circuit_renderer.set_render_options(zx_style=False) # set the default options.
circuit_renderer.dark_mode = True # You can also set them directly.
circuit_renderer.render_circuit_jupyter(circ)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for pytket_offline_display-0.0.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c16b1cef781522fbfb3634a6ab7ce874618f7d75346c51653384e858ba8169b |
|
MD5 | e73ee3f345b739e5bfc948eb5a0bc368 |
|
BLAKE2b-256 | 9ad39b2d38fdd5f4bb83205064f82d3902ea63067fcb8bbc676a42ce5900b4e0 |
Close
Hashes for pytket_offline_display-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27a89cf5a3910318565746517df28d71c8178aedd9cc797061f16e1651d01baf |
|
MD5 | 18f139bfaa27acdb638376f009403165 |
|
BLAKE2b-256 | 04e14ad028f45726de5c31068723f0a033eab0445c8fe6cfb41a373d40a8c4b4 |