Skip to main content

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

pytket_offline_display-0.0.8.tar.gz (40.8 kB view details)

Uploaded Source

Built Distribution

pytket_offline_display-0.0.8-py3-none-any.whl (195.9 kB view details)

Uploaded Python 3

File details

Details for the file pytket_offline_display-0.0.8.tar.gz.

File metadata

File hashes

Hashes for pytket_offline_display-0.0.8.tar.gz
Algorithm Hash digest
SHA256 7c16b1cef781522fbfb3634a6ab7ce874618f7d75346c51653384e858ba8169b
MD5 e73ee3f345b739e5bfc948eb5a0bc368
BLAKE2b-256 9ad39b2d38fdd5f4bb83205064f82d3902ea63067fcb8bbc676a42ce5900b4e0

See more details on using hashes here.

File details

Details for the file pytket_offline_display-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for pytket_offline_display-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 27a89cf5a3910318565746517df28d71c8178aedd9cc797061f16e1651d01baf
MD5 18f139bfaa27acdb638376f009403165
BLAKE2b-256 04e14ad028f45726de5c31068723f0a033eab0445c8fe6cfb41a373d40a8c4b4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page