Skip to main content

Create 3D visualizations of 3D quantum color codes.

Project description

qCodePlot3D

qCodePlot3D provides 3D visualizations of 2D and 3D quantum color codes, making it easy to inspect the code and visualize syndromes of error configurations.

Available Quantum Codes

The following quantum codes are currently implemented:

  • 2D square color code
  • 2D triangular color code
  • 3D cubic color code
  • 3D tetrahedral color code

The package provides an interface to extend it to further quantum codes. Contributions of such implementations to the package are appreciated.

Usage

The package comes with a minimal GUI to construct and plot the predefined quantum codes. Start the GUI by calling

python3 -m qcodeplot3d

After Building a available code with a given distance, you can hit Plot Primary Graph to show it. If you press Build Dual Graph in addition, you can also plot the dual graph or both graphs at once.

Alternatively, the package can be used to script the creation of figures. A small example snipped might look as following:

import pathlib
from qcodeplot3d.cc_3d import TetrahedronPlotter, tetrahedron_3d_dual_graph

THIS_DIR = pathlib.Path(__file__).parent

distance = 5
dual_graph = tetrahedron_3d_dual_graph(distance)
plotter = TetrahedronPlotter(dual_graph, distance=distance)
# describes the position of the camera in the 3D visualization
CPOS = [(333.44920594948127, -92.62132121918515, 221.35429214703458),
        (-1.365808884682137, 1.7594735760392801, -12.072404824078472),
        (0.5292985009453346, 0.7030498941163704, -0.4749357254197479)]
plotter.plot_primary_mesh(
    camera_position=CPOS,
    filename= THIS_DIR / "tetrahedron-d=5-1-primary"
)
dual_graph_mesh = plotter.construct_dual_mesh(
    dual_graph,
    use_edges_colors=True,
    highlighted_edges=dual_graph.edges(),
    highlighted_nodes=dual_graph.nodes()
)
plotter.plot_debug_primary_mesh(
    dual_graph_mesh,
    camera_position=CPOS,
    transparent_faces=True,
    filename= THIS_DIR / "tetrahedron-d=5-2-both"
)

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

qcodeplot3d-0.1.0.tar.gz (39.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qcodeplot3d-0.1.0-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

Details for the file qcodeplot3d-0.1.0.tar.gz.

File metadata

  • Download URL: qcodeplot3d-0.1.0.tar.gz
  • Upload date:
  • Size: 39.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for qcodeplot3d-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d0226c35477b3526572246a2cbceebdcaa999bd6cfe842f65451215e38aa4ebb
MD5 397d5c35c82c64c3222e1e477ee52987
BLAKE2b-256 a05734e8adcc245b69c493e72bd00539fd0bc92c7c0193dd554b1cc96612902a

See more details on using hashes here.

File details

Details for the file qcodeplot3d-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: qcodeplot3d-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 43.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for qcodeplot3d-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e842742af653265c40c628cbc195a84197bd48011c9bee103849b3338dceb33
MD5 d7ea96fd4efac31bafaa4038db8c5436
BLAKE2b-256 04c26fc42ca1a243e77976323f1153cd341ac7f71847d16b39dd298b1effd7d9

See more details on using hashes here.

Supported by

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