Skip to main content

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

Metadata

Release files for qCodePlot3D 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qCodePlot3D 0.1.0
File Size Uploaded
qcodeplot3d-0.1.0.tar.gz 39.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for qCodePlot3D 0.1.0
File Interpreter ABI Platform
qcodeplot3d-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 83.3 kB

Release files / qcodeplot3d-0.1.0.tar.gz

Download URL qcodeplot3d-0.1.0.tar.gz
Size 39.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d0226c35477b3526572246a2cbceebdcaa999bd6cfe842f65451215e38aa4ebb
BLAKE2b-256 checksum
How to use checksums
a05734e8adcc245b69c493e72bd00539fd0bc92c7c0193dd554b1cc96612902a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release files / qcodeplot3d-0.1.0-py3-none-any.whl

Download URL qcodeplot3d-0.1.0-py3-none-any.whl
Size 43.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e842742af653265c40c628cbc195a84197bd48011c9bee103849b3338dceb33
BLAKE2b-256 checksum
How to use checksums
04c26fc42ca1a243e77976323f1153cd341ac7f71847d16b39dd298b1effd7d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page