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_display_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.5.tar.gz (40.8 kB view details)

Uploaded Source

Built Distribution

pytket_offline_display-0.0.5-py3-none-any.whl (182.7 kB view details)

Uploaded Python 3

File details

Details for the file pytket-offline-display-0.0.5.tar.gz.

File metadata

File hashes

Hashes for pytket-offline-display-0.0.5.tar.gz
Algorithm Hash digest
SHA256 913d7de2c8c54fdeafd8df052187e6bab411b1b176b17dc50528971f0dda2470
MD5 40f9d2209beaa2016f73a4e8a2415e5d
BLAKE2b-256 33ddb04b7d703c3b86a3cedac539f928ce9ecc789175160a605c263874fc555c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytket_offline_display-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e9f3cea2242049a2b271d6600103abcf09e10d30d0d3ebd8273beff178983268
MD5 2404aa27213ece04ae5c0c54aed68b70
BLAKE2b-256 e411db4cf0b903bfd770ac33f5fcedf4bb5cb33098181572eae0bf60fc612dd0

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