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

Uploaded Source

Built Distribution

pytket_offline_display-0.0.6-py3-none-any.whl (184.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for pytket-offline-display-0.0.6.tar.gz
Algorithm Hash digest
SHA256 47b5d2162c2172942f4c21e2e69f2b202fb9e6491c71cbaa3804b119ab9be154
MD5 ea69dac7c66db26e59899669f52f0c80
BLAKE2b-256 a93eb8c459a12ac1f608d575dec405ac618a81dd6259797ec26de96aac7a0fa9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytket_offline_display-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8eb129bcd8b0200e30162e25de8c6b8381a0902ee288a82f00937fd076ee2f7d
MD5 7cad71a4c9ebee329b4802a89d052164
BLAKE2b-256 67f4752b6921d7f8d0b7fa72e28fa7a6d2b2de2fcc162f06756ac211934aa580

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