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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0226c35477b3526572246a2cbceebdcaa999bd6cfe842f65451215e38aa4ebb
|
|
| MD5 |
397d5c35c82c64c3222e1e477ee52987
|
|
| BLAKE2b-256 |
a05734e8adcc245b69c493e72bd00539fd0bc92c7c0193dd554b1cc96612902a
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e842742af653265c40c628cbc195a84197bd48011c9bee103849b3338dceb33
|
|
| MD5 |
d7ea96fd4efac31bafaa4038db8c5436
|
|
| BLAKE2b-256 |
04c26fc42ca1a243e77976323f1153cd341ac7f71847d16b39dd298b1effd7d9
|