tensor-network-visualization 1.5.4__tar.gz → 1.6.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/LICENSE +21 -21
- tensor_network_visualization-1.6.1/PKG-INFO +211 -0
- tensor_network_visualization-1.6.1/README.md +160 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/pyproject.toml +1 -1
- tensor_network_visualization-1.6.1/src/tensor_network_visualization.egg-info/PKG-INFO +211 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_visualization.egg-info/SOURCES.txt +1 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/__init__.py +46 -26
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_contraction_viewer_ui.py +28 -7
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/__init__.py +1 -1
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/constants.py +1 -1
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/contraction_scheme.py +157 -16
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/disk_metrics.py +73 -73
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/edge_orchestration.py +220 -220
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/graph_pipeline.py +52 -23
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/labels_misc.py +18 -9
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/pick_distance.py +82 -82
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/plotter.py +60 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/render_prep.py +21 -14
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/tensors.py +21 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/vectors.py +7 -1
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/focus.py +1 -1
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/graph_cache.py +42 -7
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/graph_utils.py +95 -95
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout/direction_common.py +14 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout/force_directed.py +247 -227
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout/free_directions_2d.py +22 -0
- tensor_network_visualization-1.6.1/src/tensor_network_viz/_core/layout/free_directions_3d.py +798 -0
- tensor_network_visualization-1.6.1/src/tensor_network_viz/_core/layout/generic_coarsening.py +716 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout/parameters.py +1 -1
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout/positions.py +242 -27
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout_structure.py +452 -4
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/renderer.py +8 -4
- tensor_network_visualization-1.6.1/src/tensor_network_viz/_input_inspection.py +533 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_interaction/controller.py +8 -1
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_interaction/controls.py +7 -6
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_interaction/tensor_inspector.py +4 -3
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_interaction/views.py +7 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_tensor_comparison_support.py +11 -3
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_tensor_elements_controller.py +16 -1
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_tensor_elements_data.py +124 -152
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_tensor_elements_payloads.py +25 -13
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_tensor_elements_rendering.py +38 -5
- tensor_network_visualization-1.6.1/src/tensor_network_viz/_typing.py +31 -0
- tensor_network_visualization-1.6.1/src/tensor_network_viz/_ui_utils.py +157 -0
- tensor_network_visualization-1.6.1/src/tensor_network_viz/_widgets.py +38 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/config.py +347 -161
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/contraction_viewer.py +318 -6
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/snapshot.py +13 -5
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tenpy/graph.py +1 -7
- tensor_network_visualization-1.6.1/src/tensor_network_viz/tensor_elements.py +297 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensorkrowch/_history.py +3 -13
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensorkrowch/renderer.py +17 -17
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensornetwork/renderer.py +17 -17
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/viewer.py +49 -9
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_contraction_cost.py +85 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_contraction_scheme.py +31 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_contraction_viewer.py +292 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_demo_cli_scheme.py +41 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_edge_index_label_3d.py +15 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_engine_detection.py +57 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_engineering_baseline.py +169 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_examples.py +254 -55
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_examples_structure.py +14 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_graph_cache.py +15 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_integration_tensornetwork.py +26 -26
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_interaction_controls.py +83 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_layout_core.py +1343 -70
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_logging_and_exceptions.py +16 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_plotting.py +291 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_public_api.py +264 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_quimb_backend.py +41 -4
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_show_tensor_network_throughput.py +18 -16
- tensor_network_visualization-1.6.1/tests/test_snapshot_api.py +233 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_tensor_comparison.py +20 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_tensor_elements.py +260 -1
- tensor_network_visualization-1.5.4/PKG-INFO +0 -687
- tensor_network_visualization-1.5.4/README.md +0 -636
- tensor_network_visualization-1.5.4/src/tensor_network_visualization.egg-info/PKG-INFO +0 -687
- tensor_network_visualization-1.5.4/src/tensor_network_viz/_core/layout/free_directions_3d.py +0 -495
- tensor_network_visualization-1.5.4/src/tensor_network_viz/_input_inspection.py +0 -266
- tensor_network_visualization-1.5.4/src/tensor_network_viz/_typing.py +0 -25
- tensor_network_visualization-1.5.4/src/tensor_network_viz/_ui_utils.py +0 -69
- tensor_network_visualization-1.5.4/src/tensor_network_viz/_widgets.py +0 -26
- tensor_network_visualization-1.5.4/src/tensor_network_viz/tensor_elements.py +0 -146
- tensor_network_visualization-1.5.4/tests/test_snapshot_api.py +0 -123
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/setup.cfg +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_visualization.egg-info/dependency_links.txt +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_visualization.egg-info/requires.txt +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_visualization.egg-info/top_level.txt +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_contraction_viewer_style.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/_draw_common.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/_label_format.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/_nodes_edges_common.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/axis_directions.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/contractions.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/curves.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/__init__.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/contraction_edges.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/dangling_self_edges.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/edge_labels.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/edges.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/fonts_and_scale.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/hover.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/label_descriptors.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/scene_state.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/viewport_geometry.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/graph.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout/__init__.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout/body.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout/geometry.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout/types.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_engine_specs.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_interaction/__init__.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_interaction/bridge.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_interaction/scheme.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_interaction/state.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_interactive_scene.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_logging.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_matplotlib_state.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_registry.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_tensor_elements_support.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/einsum_module/__init__.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/einsum_module/_backend.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/einsum_module/_equation.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/einsum_module/_trace_state.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/einsum_module/_trace_types.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/einsum_module/contraction_cost.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/einsum_module/graph.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/einsum_module/renderer.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/einsum_module/trace.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/exceptions.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/interactive_viewer.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/py.typed +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/quimb/__init__.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/quimb/graph.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/quimb/renderer.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tenpy/__init__.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tenpy/explicit.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tenpy/renderer.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensor_comparison.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensor_comparison_config.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensor_elements_config.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensorkrowch/__init__.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensorkrowch/graph.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensornetwork/__init__.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensornetwork/graph.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_ci_workflow.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_contraction_groups_once.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_contraction_scheme_api.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_draw_performance.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_edge_index_label_2d.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_einsum_autotrace.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_einsum_backend.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_integration_einsum.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_integration_tensorkrowch.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_interaction_state.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_label_draw_metrics_perf.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_label_format.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_lazy_imports.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_matplotlib_state.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_node_degrees_perf.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_packaging_metadata.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_render_performance_controls.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_tenpy_backend.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_tensor_elements_perf.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.1}/tests/test_verify_script.py +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Alejandro Mata Ali
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alejandro Mata Ali
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tensor-network-visualization
|
|
3
|
+
Version: 1.6.1
|
|
4
|
+
Summary: Minimal Matplotlib visualizations for TensorKrowch, TensorNetwork, Quimb, TeNPy, and traced PyTorch/NumPy einsum tensor networks.
|
|
5
|
+
Author: Alejandro Mata Ali
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization
|
|
8
|
+
Project-URL: Documentation, https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/blob/main/docs/guide.md
|
|
9
|
+
Project-URL: Changelog, https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/blob/main/CHANGELOG.md
|
|
10
|
+
Project-URL: Repository, https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization
|
|
11
|
+
Project-URL: Issues, https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/issues
|
|
12
|
+
Keywords: tensor-network,visualization,pytorch,numpy,tensorkrowch,tensornetwork,quimb,tenpy,einsum,quantum-inspired,matplotlib
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: matplotlib>=3.7
|
|
23
|
+
Requires-Dist: networkx>=3.0
|
|
24
|
+
Requires-Dist: numpy
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: build; extra == "dev"
|
|
27
|
+
Requires-Dist: pytest; extra == "dev"
|
|
28
|
+
Requires-Dist: ruff; extra == "dev"
|
|
29
|
+
Requires-Dist: pyright; extra == "dev"
|
|
30
|
+
Requires-Dist: ipython; extra == "dev"
|
|
31
|
+
Requires-Dist: tensorkrowch; extra == "dev"
|
|
32
|
+
Requires-Dist: tensornetwork; extra == "dev"
|
|
33
|
+
Requires-Dist: quimb; extra == "dev"
|
|
34
|
+
Requires-Dist: physics-tenpy; extra == "dev"
|
|
35
|
+
Provides-Extra: jupyter
|
|
36
|
+
Requires-Dist: ipympl>=0.9.0; extra == "jupyter"
|
|
37
|
+
Requires-Dist: ipywidgets>=8.0; extra == "jupyter"
|
|
38
|
+
Requires-Dist: jupyterlab>=4.0; extra == "jupyter"
|
|
39
|
+
Requires-Dist: notebook>=7.0; extra == "jupyter"
|
|
40
|
+
Provides-Extra: tensorkrowch
|
|
41
|
+
Requires-Dist: tensorkrowch; extra == "tensorkrowch"
|
|
42
|
+
Provides-Extra: tensornetwork
|
|
43
|
+
Requires-Dist: tensornetwork; extra == "tensornetwork"
|
|
44
|
+
Provides-Extra: quimb
|
|
45
|
+
Requires-Dist: quimb; extra == "quimb"
|
|
46
|
+
Provides-Extra: tenpy
|
|
47
|
+
Requires-Dist: physics-tenpy; extra == "tenpy"
|
|
48
|
+
Provides-Extra: einsum
|
|
49
|
+
Requires-Dist: torch; extra == "einsum"
|
|
50
|
+
Dynamic: license-file
|
|
51
|
+
|
|
52
|
+
# Tensor-Network-Visualization
|
|
53
|
+
|
|
54
|
+
[](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/actions/workflows/ci.yml)
|
|
55
|
+
[](https://pypi.org/project/tensor-network-visualization/)
|
|
56
|
+
[](https://pypi.org/project/tensor-network-visualization/)
|
|
57
|
+
[](https://opensource.org/licenses/MIT)
|
|
58
|
+
|
|
59
|
+
Minimal Matplotlib visualizations for TensorKrowch, TensorNetwork, Quimb, TeNPy, and traced
|
|
60
|
+
PyTorch/NumPy `einsum` tensor networks.
|
|
61
|
+
|
|
62
|
+
## Why This Exists
|
|
63
|
+
|
|
64
|
+
Tensor-network libraries expose different Python objects. This package gives them a small shared
|
|
65
|
+
visualization API so you can inspect structure, tensor values, contraction playback, and normalized
|
|
66
|
+
graph exports without rewriting plotting code for every backend.
|
|
67
|
+
|
|
68
|
+
The common entry points are:
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
show_tensor_network(...)
|
|
72
|
+
show_tensor_elements(...)
|
|
73
|
+
show_tensor_comparison(...)
|
|
74
|
+
normalize_tensor_network(...)
|
|
75
|
+
export_tensor_network_snapshot(...)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Install
|
|
79
|
+
|
|
80
|
+
- PyPI package name: `tensor-network-visualization`
|
|
81
|
+
- Import package: `tensor_network_viz`
|
|
82
|
+
- Requires Python 3.11 or newer.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
python -m pip install tensor-network-visualization
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The base install only depends on `numpy`, `matplotlib`, and `networkx`.
|
|
89
|
+
|
|
90
|
+
For interactive Jupyter figures:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
python -m pip install "tensor-network-visualization[jupyter]"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
For backend-specific packages, install the matching extra, for example:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
python -m pip install "tensor-network-visualization[quimb]"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
See [docs/installation.md](docs/installation.md) for virtual environments, all optional extras, and
|
|
103
|
+
local development installs.
|
|
104
|
+
|
|
105
|
+
## Basic Usage
|
|
106
|
+
|
|
107
|
+
### NumPy `einsum` trace (base install)
|
|
108
|
+
|
|
109
|
+
This example uses only base dependencies and a NumPy-backed `EinsumTrace`.
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
import numpy as np
|
|
113
|
+
from tensor_network_viz import EinsumTrace, PlotConfig, einsum, show_tensor_network
|
|
114
|
+
|
|
115
|
+
trace = EinsumTrace()
|
|
116
|
+
a = np.ones((2, 3), dtype=float)
|
|
117
|
+
x = np.array([1.0, -0.5, 0.25], dtype=float)
|
|
118
|
+
|
|
119
|
+
trace.bind("A", a)
|
|
120
|
+
trace.bind("x", x)
|
|
121
|
+
einsum("ab,b->a", a, x, trace=trace, backend="numpy")
|
|
122
|
+
|
|
123
|
+
fig, ax = show_tensor_network(
|
|
124
|
+
trace,
|
|
125
|
+
config=PlotConfig(show_tensor_labels=True, hover_labels=True),
|
|
126
|
+
show=False,
|
|
127
|
+
)
|
|
128
|
+
fig.savefig("einsum-network.png", bbox_inches="tight")
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### TensorKrowch
|
|
132
|
+
|
|
133
|
+
Install the TensorKrowch extra (see [Installation](docs/installation.md) for details):
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
python -m pip install "tensor-network-visualization[tensorkrowch]"
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
import tensorkrowch as tk
|
|
141
|
+
from tensor_network_viz import PlotConfig, show_tensor_network
|
|
142
|
+
|
|
143
|
+
network = tk.TensorNetwork(name="demo")
|
|
144
|
+
left = tk.Node(shape=(2, 2), axes_names=("a", "b"), name="L", network=network)
|
|
145
|
+
right = tk.Node(shape=(2, 2), axes_names=("b", "c"), name="R", network=network)
|
|
146
|
+
left["b"] ^ right["b"]
|
|
147
|
+
|
|
148
|
+
fig, ax = show_tensor_network(
|
|
149
|
+
network,
|
|
150
|
+
config=PlotConfig(show_tensor_labels=True, show_index_labels=False),
|
|
151
|
+
show=False,
|
|
152
|
+
)
|
|
153
|
+
fig.savefig("tensorkrowch-network.png", bbox_inches="tight")
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Use `show=False` when you want to save or customize the figure yourself. Use
|
|
157
|
+
`show_controls=False` when you want a clean static figure with no embedded Matplotlib controls.
|
|
158
|
+
|
|
159
|
+
In Jupyter, install `"tensor-network-visualization[jupyter]"`, run `%matplotlib widget` before
|
|
160
|
+
plotting, then call `show_tensor_network` as usual (default `show_controls=True`) for interactive
|
|
161
|
+
figures with embedded controls. See [Installation](docs/installation.md) and
|
|
162
|
+
[User Guide](docs/guide.md) for details.
|
|
163
|
+
|
|
164
|
+
## Documentation
|
|
165
|
+
|
|
166
|
+
- [Installation](docs/installation.md): virtual environments, optional extras, Jupyter, and local
|
|
167
|
+
editable installs.
|
|
168
|
+
- [API Reference](docs/api.md): public functions, configuration objects, snapshots, exceptions, and
|
|
169
|
+
logging.
|
|
170
|
+
- [User Guide](docs/guide.md): workflows, notebooks, exports, layouts, tensor inspection,
|
|
171
|
+
comparisons, snapshots, and performance tips.
|
|
172
|
+
- [Layout Algorithms](docs/algorithms.md): node placement and free-edge direction rules in 2D and
|
|
173
|
+
3D.
|
|
174
|
+
- [Backend Examples](docs/backends.md): copy-paste examples for TensorKrowch, TensorNetwork, Quimb,
|
|
175
|
+
TeNPy, and `einsum`.
|
|
176
|
+
- [Troubleshooting](docs/troubleshooting.md): common install, Jupyter, Matplotlib, backend, and data
|
|
177
|
+
issues.
|
|
178
|
+
- [Repository Examples](examples/README.md): command-line demo launcher and example catalog.
|
|
179
|
+
- [Demo Commands](commands.md): copy-paste commands for every repository demo.
|
|
180
|
+
|
|
181
|
+
## Demo Gallery
|
|
182
|
+
|
|
183
|
+
The repository examples are organized around the same launcher:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
python examples/run_demo.py <group> <demo>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
The gallery includes backend demos for TensorKrowch, TensorNetwork, Quimb, TeNPy, and `einsum`,
|
|
190
|
+
plus three focused groups:
|
|
191
|
+
|
|
192
|
+
- `themes overview`: compares `default`, `paper`, and `colorblind` visual modes.
|
|
193
|
+
- `placements`: shows object, list, 2D grid, 3D grid, manual positions, manual schemes, and named
|
|
194
|
+
index inputs.
|
|
195
|
+
- `geometry`: renders larger irregular, incomplete, triangular, pyramidal, circular, and
|
|
196
|
+
disconnected networks.
|
|
197
|
+
|
|
198
|
+
For batch checks, use:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
python examples/run_all_examples.py --group engines --views 2d --list
|
|
202
|
+
python examples/run_all_examples.py --group all --views 2d --output-dir .tmp/examples
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Project Links
|
|
206
|
+
|
|
207
|
+
- [Changelog](CHANGELOG.md)
|
|
208
|
+
- [Contributing](CONTRIBUTING.md)
|
|
209
|
+
- [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
210
|
+
- [Issues](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/issues)
|
|
211
|
+
- [Repository](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization)
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Tensor-Network-Visualization
|
|
2
|
+
|
|
3
|
+
[](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/actions/workflows/ci.yml)
|
|
4
|
+
[](https://pypi.org/project/tensor-network-visualization/)
|
|
5
|
+
[](https://pypi.org/project/tensor-network-visualization/)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
Minimal Matplotlib visualizations for TensorKrowch, TensorNetwork, Quimb, TeNPy, and traced
|
|
9
|
+
PyTorch/NumPy `einsum` tensor networks.
|
|
10
|
+
|
|
11
|
+
## Why This Exists
|
|
12
|
+
|
|
13
|
+
Tensor-network libraries expose different Python objects. This package gives them a small shared
|
|
14
|
+
visualization API so you can inspect structure, tensor values, contraction playback, and normalized
|
|
15
|
+
graph exports without rewriting plotting code for every backend.
|
|
16
|
+
|
|
17
|
+
The common entry points are:
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
show_tensor_network(...)
|
|
21
|
+
show_tensor_elements(...)
|
|
22
|
+
show_tensor_comparison(...)
|
|
23
|
+
normalize_tensor_network(...)
|
|
24
|
+
export_tensor_network_snapshot(...)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
- PyPI package name: `tensor-network-visualization`
|
|
30
|
+
- Import package: `tensor_network_viz`
|
|
31
|
+
- Requires Python 3.11 or newer.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
python -m pip install tensor-network-visualization
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The base install only depends on `numpy`, `matplotlib`, and `networkx`.
|
|
38
|
+
|
|
39
|
+
For interactive Jupyter figures:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
python -m pip install "tensor-network-visualization[jupyter]"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
For backend-specific packages, install the matching extra, for example:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
python -m pip install "tensor-network-visualization[quimb]"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
See [docs/installation.md](docs/installation.md) for virtual environments, all optional extras, and
|
|
52
|
+
local development installs.
|
|
53
|
+
|
|
54
|
+
## Basic Usage
|
|
55
|
+
|
|
56
|
+
### NumPy `einsum` trace (base install)
|
|
57
|
+
|
|
58
|
+
This example uses only base dependencies and a NumPy-backed `EinsumTrace`.
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
import numpy as np
|
|
62
|
+
from tensor_network_viz import EinsumTrace, PlotConfig, einsum, show_tensor_network
|
|
63
|
+
|
|
64
|
+
trace = EinsumTrace()
|
|
65
|
+
a = np.ones((2, 3), dtype=float)
|
|
66
|
+
x = np.array([1.0, -0.5, 0.25], dtype=float)
|
|
67
|
+
|
|
68
|
+
trace.bind("A", a)
|
|
69
|
+
trace.bind("x", x)
|
|
70
|
+
einsum("ab,b->a", a, x, trace=trace, backend="numpy")
|
|
71
|
+
|
|
72
|
+
fig, ax = show_tensor_network(
|
|
73
|
+
trace,
|
|
74
|
+
config=PlotConfig(show_tensor_labels=True, hover_labels=True),
|
|
75
|
+
show=False,
|
|
76
|
+
)
|
|
77
|
+
fig.savefig("einsum-network.png", bbox_inches="tight")
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### TensorKrowch
|
|
81
|
+
|
|
82
|
+
Install the TensorKrowch extra (see [Installation](docs/installation.md) for details):
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
python -m pip install "tensor-network-visualization[tensorkrowch]"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
import tensorkrowch as tk
|
|
90
|
+
from tensor_network_viz import PlotConfig, show_tensor_network
|
|
91
|
+
|
|
92
|
+
network = tk.TensorNetwork(name="demo")
|
|
93
|
+
left = tk.Node(shape=(2, 2), axes_names=("a", "b"), name="L", network=network)
|
|
94
|
+
right = tk.Node(shape=(2, 2), axes_names=("b", "c"), name="R", network=network)
|
|
95
|
+
left["b"] ^ right["b"]
|
|
96
|
+
|
|
97
|
+
fig, ax = show_tensor_network(
|
|
98
|
+
network,
|
|
99
|
+
config=PlotConfig(show_tensor_labels=True, show_index_labels=False),
|
|
100
|
+
show=False,
|
|
101
|
+
)
|
|
102
|
+
fig.savefig("tensorkrowch-network.png", bbox_inches="tight")
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Use `show=False` when you want to save or customize the figure yourself. Use
|
|
106
|
+
`show_controls=False` when you want a clean static figure with no embedded Matplotlib controls.
|
|
107
|
+
|
|
108
|
+
In Jupyter, install `"tensor-network-visualization[jupyter]"`, run `%matplotlib widget` before
|
|
109
|
+
plotting, then call `show_tensor_network` as usual (default `show_controls=True`) for interactive
|
|
110
|
+
figures with embedded controls. See [Installation](docs/installation.md) and
|
|
111
|
+
[User Guide](docs/guide.md) for details.
|
|
112
|
+
|
|
113
|
+
## Documentation
|
|
114
|
+
|
|
115
|
+
- [Installation](docs/installation.md): virtual environments, optional extras, Jupyter, and local
|
|
116
|
+
editable installs.
|
|
117
|
+
- [API Reference](docs/api.md): public functions, configuration objects, snapshots, exceptions, and
|
|
118
|
+
logging.
|
|
119
|
+
- [User Guide](docs/guide.md): workflows, notebooks, exports, layouts, tensor inspection,
|
|
120
|
+
comparisons, snapshots, and performance tips.
|
|
121
|
+
- [Layout Algorithms](docs/algorithms.md): node placement and free-edge direction rules in 2D and
|
|
122
|
+
3D.
|
|
123
|
+
- [Backend Examples](docs/backends.md): copy-paste examples for TensorKrowch, TensorNetwork, Quimb,
|
|
124
|
+
TeNPy, and `einsum`.
|
|
125
|
+
- [Troubleshooting](docs/troubleshooting.md): common install, Jupyter, Matplotlib, backend, and data
|
|
126
|
+
issues.
|
|
127
|
+
- [Repository Examples](examples/README.md): command-line demo launcher and example catalog.
|
|
128
|
+
- [Demo Commands](commands.md): copy-paste commands for every repository demo.
|
|
129
|
+
|
|
130
|
+
## Demo Gallery
|
|
131
|
+
|
|
132
|
+
The repository examples are organized around the same launcher:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
python examples/run_demo.py <group> <demo>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
The gallery includes backend demos for TensorKrowch, TensorNetwork, Quimb, TeNPy, and `einsum`,
|
|
139
|
+
plus three focused groups:
|
|
140
|
+
|
|
141
|
+
- `themes overview`: compares `default`, `paper`, and `colorblind` visual modes.
|
|
142
|
+
- `placements`: shows object, list, 2D grid, 3D grid, manual positions, manual schemes, and named
|
|
143
|
+
index inputs.
|
|
144
|
+
- `geometry`: renders larger irregular, incomplete, triangular, pyramidal, circular, and
|
|
145
|
+
disconnected networks.
|
|
146
|
+
|
|
147
|
+
For batch checks, use:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
python examples/run_all_examples.py --group engines --views 2d --list
|
|
151
|
+
python examples/run_all_examples.py --group all --views 2d --output-dir .tmp/examples
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Project Links
|
|
155
|
+
|
|
156
|
+
- [Changelog](CHANGELOG.md)
|
|
157
|
+
- [Contributing](CONTRIBUTING.md)
|
|
158
|
+
- [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
159
|
+
- [Issues](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/issues)
|
|
160
|
+
- [Repository](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization)
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tensor-network-visualization"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.6.1"
|
|
8
8
|
description = "Minimal Matplotlib visualizations for TensorKrowch, TensorNetwork, Quimb, TeNPy, and traced PyTorch/NumPy einsum tensor networks."
|
|
9
9
|
authors = [{ name = "Alejandro Mata Ali" }]
|
|
10
10
|
readme = "README.md"
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tensor-network-visualization
|
|
3
|
+
Version: 1.6.1
|
|
4
|
+
Summary: Minimal Matplotlib visualizations for TensorKrowch, TensorNetwork, Quimb, TeNPy, and traced PyTorch/NumPy einsum tensor networks.
|
|
5
|
+
Author: Alejandro Mata Ali
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization
|
|
8
|
+
Project-URL: Documentation, https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/blob/main/docs/guide.md
|
|
9
|
+
Project-URL: Changelog, https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/blob/main/CHANGELOG.md
|
|
10
|
+
Project-URL: Repository, https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization
|
|
11
|
+
Project-URL: Issues, https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/issues
|
|
12
|
+
Keywords: tensor-network,visualization,pytorch,numpy,tensorkrowch,tensornetwork,quimb,tenpy,einsum,quantum-inspired,matplotlib
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: matplotlib>=3.7
|
|
23
|
+
Requires-Dist: networkx>=3.0
|
|
24
|
+
Requires-Dist: numpy
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: build; extra == "dev"
|
|
27
|
+
Requires-Dist: pytest; extra == "dev"
|
|
28
|
+
Requires-Dist: ruff; extra == "dev"
|
|
29
|
+
Requires-Dist: pyright; extra == "dev"
|
|
30
|
+
Requires-Dist: ipython; extra == "dev"
|
|
31
|
+
Requires-Dist: tensorkrowch; extra == "dev"
|
|
32
|
+
Requires-Dist: tensornetwork; extra == "dev"
|
|
33
|
+
Requires-Dist: quimb; extra == "dev"
|
|
34
|
+
Requires-Dist: physics-tenpy; extra == "dev"
|
|
35
|
+
Provides-Extra: jupyter
|
|
36
|
+
Requires-Dist: ipympl>=0.9.0; extra == "jupyter"
|
|
37
|
+
Requires-Dist: ipywidgets>=8.0; extra == "jupyter"
|
|
38
|
+
Requires-Dist: jupyterlab>=4.0; extra == "jupyter"
|
|
39
|
+
Requires-Dist: notebook>=7.0; extra == "jupyter"
|
|
40
|
+
Provides-Extra: tensorkrowch
|
|
41
|
+
Requires-Dist: tensorkrowch; extra == "tensorkrowch"
|
|
42
|
+
Provides-Extra: tensornetwork
|
|
43
|
+
Requires-Dist: tensornetwork; extra == "tensornetwork"
|
|
44
|
+
Provides-Extra: quimb
|
|
45
|
+
Requires-Dist: quimb; extra == "quimb"
|
|
46
|
+
Provides-Extra: tenpy
|
|
47
|
+
Requires-Dist: physics-tenpy; extra == "tenpy"
|
|
48
|
+
Provides-Extra: einsum
|
|
49
|
+
Requires-Dist: torch; extra == "einsum"
|
|
50
|
+
Dynamic: license-file
|
|
51
|
+
|
|
52
|
+
# Tensor-Network-Visualization
|
|
53
|
+
|
|
54
|
+
[](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/actions/workflows/ci.yml)
|
|
55
|
+
[](https://pypi.org/project/tensor-network-visualization/)
|
|
56
|
+
[](https://pypi.org/project/tensor-network-visualization/)
|
|
57
|
+
[](https://opensource.org/licenses/MIT)
|
|
58
|
+
|
|
59
|
+
Minimal Matplotlib visualizations for TensorKrowch, TensorNetwork, Quimb, TeNPy, and traced
|
|
60
|
+
PyTorch/NumPy `einsum` tensor networks.
|
|
61
|
+
|
|
62
|
+
## Why This Exists
|
|
63
|
+
|
|
64
|
+
Tensor-network libraries expose different Python objects. This package gives them a small shared
|
|
65
|
+
visualization API so you can inspect structure, tensor values, contraction playback, and normalized
|
|
66
|
+
graph exports without rewriting plotting code for every backend.
|
|
67
|
+
|
|
68
|
+
The common entry points are:
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
show_tensor_network(...)
|
|
72
|
+
show_tensor_elements(...)
|
|
73
|
+
show_tensor_comparison(...)
|
|
74
|
+
normalize_tensor_network(...)
|
|
75
|
+
export_tensor_network_snapshot(...)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Install
|
|
79
|
+
|
|
80
|
+
- PyPI package name: `tensor-network-visualization`
|
|
81
|
+
- Import package: `tensor_network_viz`
|
|
82
|
+
- Requires Python 3.11 or newer.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
python -m pip install tensor-network-visualization
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The base install only depends on `numpy`, `matplotlib`, and `networkx`.
|
|
89
|
+
|
|
90
|
+
For interactive Jupyter figures:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
python -m pip install "tensor-network-visualization[jupyter]"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
For backend-specific packages, install the matching extra, for example:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
python -m pip install "tensor-network-visualization[quimb]"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
See [docs/installation.md](docs/installation.md) for virtual environments, all optional extras, and
|
|
103
|
+
local development installs.
|
|
104
|
+
|
|
105
|
+
## Basic Usage
|
|
106
|
+
|
|
107
|
+
### NumPy `einsum` trace (base install)
|
|
108
|
+
|
|
109
|
+
This example uses only base dependencies and a NumPy-backed `EinsumTrace`.
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
import numpy as np
|
|
113
|
+
from tensor_network_viz import EinsumTrace, PlotConfig, einsum, show_tensor_network
|
|
114
|
+
|
|
115
|
+
trace = EinsumTrace()
|
|
116
|
+
a = np.ones((2, 3), dtype=float)
|
|
117
|
+
x = np.array([1.0, -0.5, 0.25], dtype=float)
|
|
118
|
+
|
|
119
|
+
trace.bind("A", a)
|
|
120
|
+
trace.bind("x", x)
|
|
121
|
+
einsum("ab,b->a", a, x, trace=trace, backend="numpy")
|
|
122
|
+
|
|
123
|
+
fig, ax = show_tensor_network(
|
|
124
|
+
trace,
|
|
125
|
+
config=PlotConfig(show_tensor_labels=True, hover_labels=True),
|
|
126
|
+
show=False,
|
|
127
|
+
)
|
|
128
|
+
fig.savefig("einsum-network.png", bbox_inches="tight")
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### TensorKrowch
|
|
132
|
+
|
|
133
|
+
Install the TensorKrowch extra (see [Installation](docs/installation.md) for details):
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
python -m pip install "tensor-network-visualization[tensorkrowch]"
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
import tensorkrowch as tk
|
|
141
|
+
from tensor_network_viz import PlotConfig, show_tensor_network
|
|
142
|
+
|
|
143
|
+
network = tk.TensorNetwork(name="demo")
|
|
144
|
+
left = tk.Node(shape=(2, 2), axes_names=("a", "b"), name="L", network=network)
|
|
145
|
+
right = tk.Node(shape=(2, 2), axes_names=("b", "c"), name="R", network=network)
|
|
146
|
+
left["b"] ^ right["b"]
|
|
147
|
+
|
|
148
|
+
fig, ax = show_tensor_network(
|
|
149
|
+
network,
|
|
150
|
+
config=PlotConfig(show_tensor_labels=True, show_index_labels=False),
|
|
151
|
+
show=False,
|
|
152
|
+
)
|
|
153
|
+
fig.savefig("tensorkrowch-network.png", bbox_inches="tight")
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Use `show=False` when you want to save or customize the figure yourself. Use
|
|
157
|
+
`show_controls=False` when you want a clean static figure with no embedded Matplotlib controls.
|
|
158
|
+
|
|
159
|
+
In Jupyter, install `"tensor-network-visualization[jupyter]"`, run `%matplotlib widget` before
|
|
160
|
+
plotting, then call `show_tensor_network` as usual (default `show_controls=True`) for interactive
|
|
161
|
+
figures with embedded controls. See [Installation](docs/installation.md) and
|
|
162
|
+
[User Guide](docs/guide.md) for details.
|
|
163
|
+
|
|
164
|
+
## Documentation
|
|
165
|
+
|
|
166
|
+
- [Installation](docs/installation.md): virtual environments, optional extras, Jupyter, and local
|
|
167
|
+
editable installs.
|
|
168
|
+
- [API Reference](docs/api.md): public functions, configuration objects, snapshots, exceptions, and
|
|
169
|
+
logging.
|
|
170
|
+
- [User Guide](docs/guide.md): workflows, notebooks, exports, layouts, tensor inspection,
|
|
171
|
+
comparisons, snapshots, and performance tips.
|
|
172
|
+
- [Layout Algorithms](docs/algorithms.md): node placement and free-edge direction rules in 2D and
|
|
173
|
+
3D.
|
|
174
|
+
- [Backend Examples](docs/backends.md): copy-paste examples for TensorKrowch, TensorNetwork, Quimb,
|
|
175
|
+
TeNPy, and `einsum`.
|
|
176
|
+
- [Troubleshooting](docs/troubleshooting.md): common install, Jupyter, Matplotlib, backend, and data
|
|
177
|
+
issues.
|
|
178
|
+
- [Repository Examples](examples/README.md): command-line demo launcher and example catalog.
|
|
179
|
+
- [Demo Commands](commands.md): copy-paste commands for every repository demo.
|
|
180
|
+
|
|
181
|
+
## Demo Gallery
|
|
182
|
+
|
|
183
|
+
The repository examples are organized around the same launcher:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
python examples/run_demo.py <group> <demo>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
The gallery includes backend demos for TensorKrowch, TensorNetwork, Quimb, TeNPy, and `einsum`,
|
|
190
|
+
plus three focused groups:
|
|
191
|
+
|
|
192
|
+
- `themes overview`: compares `default`, `paper`, and `colorblind` visual modes.
|
|
193
|
+
- `placements`: shows object, list, 2D grid, 3D grid, manual positions, manual schemes, and named
|
|
194
|
+
index inputs.
|
|
195
|
+
- `geometry`: renders larger irregular, incomplete, triangular, pyramidal, circular, and
|
|
196
|
+
disconnected networks.
|
|
197
|
+
|
|
198
|
+
For batch checks, use:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
python examples/run_all_examples.py --group engines --views 2d --list
|
|
202
|
+
python examples/run_all_examples.py --group all --views 2d --output-dir .tmp/examples
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Project Links
|
|
206
|
+
|
|
207
|
+
- [Changelog](CHANGELOG.md)
|
|
208
|
+
- [Contributing](CONTRIBUTING.md)
|
|
209
|
+
- [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
210
|
+
- [Issues](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/issues)
|
|
211
|
+
- [Repository](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization)
|
|
@@ -75,6 +75,7 @@ src/tensor_network_viz/_core/layout/direction_common.py
|
|
|
75
75
|
src/tensor_network_viz/_core/layout/force_directed.py
|
|
76
76
|
src/tensor_network_viz/_core/layout/free_directions_2d.py
|
|
77
77
|
src/tensor_network_viz/_core/layout/free_directions_3d.py
|
|
78
|
+
src/tensor_network_viz/_core/layout/generic_coarsening.py
|
|
78
79
|
src/tensor_network_viz/_core/layout/geometry.py
|
|
79
80
|
src/tensor_network_viz/_core/layout/parameters.py
|
|
80
81
|
src/tensor_network_viz/_core/layout/positions.py
|