tensor-network-visualization 1.5.4__tar.gz → 1.6.0__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.0}/LICENSE +21 -21
- tensor_network_visualization-1.6.0/PKG-INFO +184 -0
- tensor_network_visualization-1.6.0/README.md +133 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/pyproject.toml +1 -1
- tensor_network_visualization-1.6.0/src/tensor_network_visualization.egg-info/PKG-INFO +184 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/__init__.py +43 -26
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_contraction_viewer_ui.py +4 -4
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/__init__.py +1 -1
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/disk_metrics.py +73 -73
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/graph_pipeline.py +52 -23
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/pick_distance.py +82 -82
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/render_prep.py +0 -14
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/vectors.py +33 -33
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/focus.py +1 -1
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/graph_cache.py +42 -7
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/graph_utils.py +95 -95
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/layout/direction_common.py +14 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/layout/free_directions_2d.py +33 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/layout/free_directions_3d.py +45 -3
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/renderer.py +1 -1
- tensor_network_visualization-1.6.0/src/tensor_network_viz/_input_inspection.py +533 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_interaction/controls.py +5 -4
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_interaction/tensor_inspector.py +4 -3
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_interaction/views.py +7 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_tensor_comparison_support.py +11 -3
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_tensor_elements_data.py +124 -152
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_tensor_elements_payloads.py +25 -13
- tensor_network_visualization-1.6.0/src/tensor_network_viz/_typing.py +31 -0
- tensor_network_visualization-1.6.0/src/tensor_network_viz/_widgets.py +38 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/contraction_viewer.py +6 -4
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/snapshot.py +13 -5
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/tenpy/graph.py +1 -7
- tensor_network_visualization-1.6.0/src/tensor_network_viz/tensor_elements.py +297 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/tensorkrowch/_history.py +3 -13
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/tensorkrowch/renderer.py +17 -17
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/tensornetwork/renderer.py +17 -17
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/viewer.py +34 -8
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_contraction_viewer.py +35 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_engine_detection.py +35 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_engineering_baseline.py +169 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_graph_cache.py +15 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_integration_tensornetwork.py +26 -26
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_interaction_controls.py +46 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_layout_core.py +61 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_logging_and_exceptions.py +16 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_plotting.py +161 -0
- tensor_network_visualization-1.6.0/tests/test_snapshot_api.py +233 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_tensor_comparison.py +20 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_tensor_elements.py +139 -0
- 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/_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/_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.0}/setup.cfg +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_visualization.egg-info/SOURCES.txt +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_visualization.egg-info/dependency_links.txt +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_visualization.egg-info/requires.txt +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_visualization.egg-info/top_level.txt +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_contraction_viewer_style.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/_draw_common.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/_label_format.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/_nodes_edges_common.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/axis_directions.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/contractions.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/curves.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/__init__.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/constants.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/contraction_edges.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/contraction_scheme.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/dangling_self_edges.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/edge_labels.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/edge_orchestration.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/edges.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/fonts_and_scale.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/hover.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/label_descriptors.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/labels_misc.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/plotter.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/scene_state.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/tensors.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/draw/viewport_geometry.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/graph.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/layout/__init__.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/layout/body.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/layout/force_directed.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/layout/geometry.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/layout/parameters.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/layout/positions.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/layout/types.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_core/layout_structure.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_engine_specs.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_interaction/__init__.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_interaction/bridge.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_interaction/controller.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_interaction/scheme.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_interaction/state.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_interactive_scene.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_logging.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_matplotlib_state.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_registry.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_tensor_elements_controller.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_tensor_elements_rendering.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_tensor_elements_support.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/_ui_utils.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/config.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/einsum_module/__init__.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/einsum_module/_backend.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/einsum_module/_equation.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/einsum_module/_trace_state.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/einsum_module/_trace_types.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/einsum_module/contraction_cost.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/einsum_module/graph.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/einsum_module/renderer.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/einsum_module/trace.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/exceptions.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/interactive_viewer.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/py.typed +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/quimb/__init__.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/quimb/graph.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/quimb/renderer.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/tenpy/__init__.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/tenpy/explicit.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/tenpy/renderer.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/tensor_comparison.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/tensor_comparison_config.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/tensor_elements_config.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/tensorkrowch/__init__.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/tensorkrowch/graph.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/tensornetwork/__init__.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/src/tensor_network_viz/tensornetwork/graph.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_ci_workflow.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_contraction_cost.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_contraction_groups_once.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_contraction_scheme.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_contraction_scheme_api.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_demo_cli_scheme.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_draw_performance.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_edge_index_label_2d.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_edge_index_label_3d.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_einsum_autotrace.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_einsum_backend.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_examples.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_examples_structure.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_integration_einsum.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_integration_tensorkrowch.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_interaction_state.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_label_draw_metrics_perf.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_label_format.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_lazy_imports.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_matplotlib_state.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_node_degrees_perf.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_packaging_metadata.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_public_api.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_quimb_backend.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_render_performance_controls.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_show_tensor_network_throughput.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_tenpy_backend.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/tests/test_tensor_elements_perf.py +0 -0
- {tensor_network_visualization-1.5.4 → tensor_network_visualization-1.6.0}/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,184 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tensor-network-visualization
|
|
3
|
+
Version: 1.6.0
|
|
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
|
+
- [Backend Examples](docs/backends.md): copy-paste examples for TensorKrowch, TensorNetwork, Quimb,
|
|
173
|
+
TeNPy, and `einsum`.
|
|
174
|
+
- [Troubleshooting](docs/troubleshooting.md): common install, Jupyter, Matplotlib, backend, and data
|
|
175
|
+
issues.
|
|
176
|
+
- [Repository Examples](examples/README.md): command-line demo launcher and example catalog.
|
|
177
|
+
|
|
178
|
+
## Project Links
|
|
179
|
+
|
|
180
|
+
- [Changelog](CHANGELOG.md)
|
|
181
|
+
- [Contributing](CONTRIBUTING.md)
|
|
182
|
+
- [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
183
|
+
- [Issues](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/issues)
|
|
184
|
+
- [Repository](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization)
|
|
@@ -0,0 +1,133 @@
|
|
|
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
|
+
- [Backend Examples](docs/backends.md): copy-paste examples for TensorKrowch, TensorNetwork, Quimb,
|
|
122
|
+
TeNPy, and `einsum`.
|
|
123
|
+
- [Troubleshooting](docs/troubleshooting.md): common install, Jupyter, Matplotlib, backend, and data
|
|
124
|
+
issues.
|
|
125
|
+
- [Repository Examples](examples/README.md): command-line demo launcher and example catalog.
|
|
126
|
+
|
|
127
|
+
## Project Links
|
|
128
|
+
|
|
129
|
+
- [Changelog](CHANGELOG.md)
|
|
130
|
+
- [Contributing](CONTRIBUTING.md)
|
|
131
|
+
- [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
132
|
+
- [Issues](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/issues)
|
|
133
|
+
- [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.0"
|
|
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,184 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tensor-network-visualization
|
|
3
|
+
Version: 1.6.0
|
|
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
|
+
- [Backend Examples](docs/backends.md): copy-paste examples for TensorKrowch, TensorNetwork, Quimb,
|
|
173
|
+
TeNPy, and `einsum`.
|
|
174
|
+
- [Troubleshooting](docs/troubleshooting.md): common install, Jupyter, Matplotlib, backend, and data
|
|
175
|
+
issues.
|
|
176
|
+
- [Repository Examples](examples/README.md): command-line demo launcher and example catalog.
|
|
177
|
+
|
|
178
|
+
## Project Links
|
|
179
|
+
|
|
180
|
+
- [Changelog](CHANGELOG.md)
|
|
181
|
+
- [Contributing](CONTRIBUTING.md)
|
|
182
|
+
- [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
183
|
+
- [Issues](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/issues)
|
|
184
|
+
- [Repository](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization)
|
|
@@ -1,35 +1,37 @@
|
|
|
1
1
|
"""Public package surface with lazy imports for optional backends and viewers."""
|
|
2
2
|
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
3
5
|
from importlib import import_module
|
|
4
6
|
from typing import TYPE_CHECKING, Any
|
|
5
7
|
|
|
6
|
-
from matplotlib.axes import Axes
|
|
7
|
-
from matplotlib.figure import Figure
|
|
8
|
-
from mpl_toolkits.mplot3d.axes3d import Axes3D
|
|
9
|
-
|
|
10
8
|
from . import _logging as _package_logging
|
|
11
|
-
from ._core.graph_cache import clear_tensor_network_graph_cache
|
|
12
|
-
from .config import (
|
|
13
|
-
EngineName,
|
|
14
|
-
PlotConfig,
|
|
15
|
-
TensorNetworkDiagnosticsConfig,
|
|
16
|
-
TensorNetworkFocus,
|
|
17
|
-
ViewName,
|
|
18
|
-
)
|
|
19
|
-
from .exceptions import (
|
|
20
|
-
AxisConfigurationError,
|
|
21
|
-
MissingOptionalDependencyError,
|
|
22
|
-
TensorDataError,
|
|
23
|
-
TensorDataTypeError,
|
|
24
|
-
TensorNetworkVizError,
|
|
25
|
-
UnsupportedEngineError,
|
|
26
|
-
VisualizationInputError,
|
|
27
|
-
VisualizationTypeError,
|
|
28
|
-
)
|
|
29
9
|
|
|
30
10
|
if TYPE_CHECKING:
|
|
11
|
+
from matplotlib.axes import Axes
|
|
12
|
+
from matplotlib.figure import Figure
|
|
13
|
+
from mpl_toolkits.mplot3d.axes3d import Axes3D
|
|
14
|
+
|
|
15
|
+
from ._core.graph_cache import clear_tensor_network_graph_cache
|
|
16
|
+
from .config import (
|
|
17
|
+
EngineName,
|
|
18
|
+
PlotConfig,
|
|
19
|
+
TensorNetworkDiagnosticsConfig,
|
|
20
|
+
TensorNetworkFocus,
|
|
21
|
+
ViewName,
|
|
22
|
+
)
|
|
31
23
|
from .contraction_viewer import ContractionViewer2D, ContractionViewer3D
|
|
32
24
|
from .einsum_module.trace import EinsumTrace, einsum, einsum_trace_step, pair_tensor
|
|
25
|
+
from .exceptions import (
|
|
26
|
+
AxisConfigurationError,
|
|
27
|
+
MissingOptionalDependencyError,
|
|
28
|
+
TensorDataError,
|
|
29
|
+
TensorDataTypeError,
|
|
30
|
+
TensorNetworkVizError,
|
|
31
|
+
UnsupportedEngineError,
|
|
32
|
+
VisualizationInputError,
|
|
33
|
+
VisualizationTypeError,
|
|
34
|
+
)
|
|
33
35
|
from .snapshot import (
|
|
34
36
|
NormalizedContractionStepMetrics,
|
|
35
37
|
NormalizedTensorEdge,
|
|
@@ -62,7 +64,8 @@ else:
|
|
|
62
64
|
"""Lazily dispatch to :func:`tensor_network_viz.viewer.show_tensor_network`.
|
|
63
65
|
|
|
64
66
|
Args:
|
|
65
|
-
network: Tensor-network input accepted by the public viewer entry point
|
|
67
|
+
network: Tensor-network input accepted by the public viewer entry point,
|
|
68
|
+
including flat iterables and nested 2D/3D grids with ``None`` holes.
|
|
66
69
|
engine: Optional backend override.
|
|
67
70
|
view: Optional initial view name.
|
|
68
71
|
config: Optional plotting configuration.
|
|
@@ -89,7 +92,7 @@ else:
|
|
|
89
92
|
data: Any,
|
|
90
93
|
*,
|
|
91
94
|
engine: EngineName | None = None,
|
|
92
|
-
config:
|
|
95
|
+
config: TensorElementsConfig | None = None,
|
|
93
96
|
ax: Axes | None = None,
|
|
94
97
|
show_controls: bool = True,
|
|
95
98
|
show: bool = True,
|
|
@@ -124,8 +127,8 @@ else:
|
|
|
124
127
|
reference: Any,
|
|
125
128
|
*,
|
|
126
129
|
engine: EngineName | None = None,
|
|
127
|
-
config:
|
|
128
|
-
comparison_config:
|
|
130
|
+
config: TensorElementsConfig | None = None,
|
|
131
|
+
comparison_config: TensorComparisonConfig | None = None,
|
|
129
132
|
ax: Axes | None = None,
|
|
130
133
|
show_controls: bool = True,
|
|
131
134
|
show: bool = True,
|
|
@@ -146,20 +149,34 @@ else:
|
|
|
146
149
|
|
|
147
150
|
|
|
148
151
|
_LAZY_EXPORTS: dict[str, tuple[str, str]] = {
|
|
152
|
+
"AxisConfigurationError": (".exceptions", "AxisConfigurationError"),
|
|
149
153
|
"ContractionViewer2D": (".contraction_viewer", "ContractionViewer2D"),
|
|
150
154
|
"ContractionViewer3D": (".contraction_viewer", "ContractionViewer3D"),
|
|
155
|
+
"EngineName": (".config", "EngineName"),
|
|
151
156
|
"EinsumTrace": (".einsum_module.trace", "EinsumTrace"),
|
|
157
|
+
"MissingOptionalDependencyError": (".exceptions", "MissingOptionalDependencyError"),
|
|
152
158
|
"NormalizedContractionStepMetrics": (".snapshot", "NormalizedContractionStepMetrics"),
|
|
153
159
|
"NormalizedTensorEdge": (".snapshot", "NormalizedTensorEdge"),
|
|
154
160
|
"NormalizedTensorEndpoint": (".snapshot", "NormalizedTensorEndpoint"),
|
|
155
161
|
"NormalizedTensorGraph": (".snapshot", "NormalizedTensorGraph"),
|
|
156
162
|
"NormalizedTensorNode": (".snapshot", "NormalizedTensorNode"),
|
|
163
|
+
"PlotConfig": (".config", "PlotConfig"),
|
|
157
164
|
"TenPyTensorNetwork": (".tenpy.explicit", "TenPyTensorNetwork"),
|
|
158
165
|
"TensorComparisonConfig": (".tensor_comparison_config", "TensorComparisonConfig"),
|
|
159
166
|
"TensorAnalysisConfig": (".tensor_elements_config", "TensorAnalysisConfig"),
|
|
167
|
+
"TensorDataError": (".exceptions", "TensorDataError"),
|
|
168
|
+
"TensorDataTypeError": (".exceptions", "TensorDataTypeError"),
|
|
160
169
|
"TensorElementsConfig": (".tensor_elements_config", "TensorElementsConfig"),
|
|
170
|
+
"TensorNetworkDiagnosticsConfig": (".config", "TensorNetworkDiagnosticsConfig"),
|
|
171
|
+
"TensorNetworkFocus": (".config", "TensorNetworkFocus"),
|
|
161
172
|
"TensorNetworkLayoutSnapshot": (".snapshot", "TensorNetworkLayoutSnapshot"),
|
|
162
173
|
"TensorNetworkSnapshot": (".snapshot", "TensorNetworkSnapshot"),
|
|
174
|
+
"TensorNetworkVizError": (".exceptions", "TensorNetworkVizError"),
|
|
175
|
+
"UnsupportedEngineError": (".exceptions", "UnsupportedEngineError"),
|
|
176
|
+
"ViewName": (".config", "ViewName"),
|
|
177
|
+
"VisualizationInputError": (".exceptions", "VisualizationInputError"),
|
|
178
|
+
"VisualizationTypeError": (".exceptions", "VisualizationTypeError"),
|
|
179
|
+
"clear_tensor_network_graph_cache": ("._core.graph_cache", "clear_tensor_network_graph_cache"),
|
|
163
180
|
"einsum": (".einsum_module.trace", "einsum"),
|
|
164
181
|
"einsum_trace_step": (".einsum_module.trace", "einsum_trace_step"),
|
|
165
182
|
"export_tensor_network_snapshot": (".snapshot", "export_tensor_network_snapshot"),
|