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.9.tar.gz (40.9 kB view details)

Uploaded Source

Built Distribution

pytket_offline_display-0.0.9-py3-none-any.whl (202.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for pytket_offline_display-0.0.9.tar.gz
Algorithm Hash digest
SHA256 62040cab7fd93a74f162c7ffcda25ad6255b72f2f57cf8567b3d539aabd8e22d
MD5 d6bdd00dd855241d47df2cffa571e0c5
BLAKE2b-256 d179f634c4192a8fe522f2c015918b2df7f0e1ca40450b0f5f6e70e3dfdbc303

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytket_offline_display-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 cd7f3f4b39e550529d93b138ded924dbdb27724cead85482b13cc2cd4d296c4a
MD5 9392c182135699b0b2b9eb38a6b28080
BLAKE2b-256 d6c565aab0ba59abce9b4b854bde89396b593c0b064b1ef8adc36e807cfe095f

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