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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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