tensor-network-visualization 1.6.0__tar.gz → 1.6.2__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.6.0 → tensor_network_visualization-1.6.2}/LICENSE +21 -21
- {tensor_network_visualization-1.6.0/src/tensor_network_visualization.egg-info → tensor_network_visualization-1.6.2}/PKG-INFO +49 -5
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/README.md +177 -133
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/pyproject.toml +1 -1
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2/src/tensor_network_visualization.egg-info}/PKG-INFO +49 -5
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_visualization.egg-info/SOURCES.txt +8 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/__init__.py +3 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_contraction_viewer_ui.py +27 -6
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/__init__.py +1 -1
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/constants.py +1 -1
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/contraction_scheme.py +157 -16
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/dangling_self_edges.py +3 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/disk_metrics.py +73 -73
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/edge_labels.py +1 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/fonts_and_scale.py +45 -2
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/graph_pipeline.py +3 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/labels_misc.py +18 -9
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/pick_distance.py +82 -82
- tensor_network_visualization-1.6.2/src/tensor_network_viz/_core/draw/plotter.py +68 -0
- tensor_network_visualization-1.6.2/src/tensor_network_viz/_core/draw/plotter_2d.py +229 -0
- tensor_network_visualization-1.6.2/src/tensor_network_viz/_core/draw/plotter_3d.py +209 -0
- tensor_network_visualization-1.6.2/src/tensor_network_viz/_core/draw/plotter_common.py +85 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/render_prep.py +31 -1
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/scene_state.py +9 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/tensors.py +34 -3
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/vectors.py +39 -33
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/viewport_geometry.py +16 -5
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/focus.py +71 -16
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/graph_utils.py +95 -95
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/layout/force_directed.py +24 -4
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/layout/free_directions_2d.py +124 -34
- tensor_network_visualization-1.6.2/src/tensor_network_viz/_core/layout/free_directions_3d.py +838 -0
- tensor_network_visualization-1.6.2/src/tensor_network_viz/_core/layout/generic_coarsening.py +716 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/layout/parameters.py +1 -1
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/layout/positions.py +354 -28
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/layout_structure.py +360 -10
- tensor_network_visualization-1.6.2/src/tensor_network_viz/_core/layout_structure_coordinates.py +208 -0
- tensor_network_visualization-1.6.2/src/tensor_network_viz/_core/layout_structure_sparse_grid.py +222 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/renderer.py +16 -5
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_interaction/controller.py +54 -6
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_interaction/controls.py +2 -4
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_interaction/tensor_inspector.py +1 -2
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_interaction/views.py +0 -3
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_interactive_scene.py +56 -31
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_tensor_comparison_support.py +2 -1
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_tensor_elements_controller.py +253 -28
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_tensor_elements_data.py +61 -695
- tensor_network_visualization-1.6.2/src/tensor_network_viz/_tensor_elements_inputs.py +600 -0
- tensor_network_visualization-1.6.2/src/tensor_network_viz/_tensor_elements_models.py +137 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_tensor_elements_rendering.py +38 -5
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_tensor_elements_support.py +5 -3
- tensor_network_visualization-1.6.2/src/tensor_network_viz/_ui_utils.py +157 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/config.py +196 -10
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/contraction_viewer.py +312 -2
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/tensor_comparison.py +1 -1
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/tensorkrowch/renderer.py +17 -17
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/tensornetwork/renderer.py +17 -17
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/viewer.py +20 -6
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_contraction_cost.py +85 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_contraction_scheme.py +31 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_contraction_viewer.py +257 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_demo_cli_scheme.py +41 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_edge_index_label_3d.py +15 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_einsum_backend.py +2 -2
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_engine_detection.py +22 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_engineering_baseline.py +12 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_examples.py +254 -55
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_examples_structure.py +14 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_graph_cache.py +54 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_integration_tensornetwork.py +26 -26
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_interaction_controls.py +85 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_label_draw_metrics_perf.py +1 -1
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_layout_core.py +1641 -42
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_plotting.py +267 -9
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_public_api.py +264 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_quimb_backend.py +44 -6
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_render_performance_controls.py +128 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_show_tensor_network_throughput.py +18 -16
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_snapshot_api.py +1 -1
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_tenpy_backend.py +3 -2
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_tensor_elements.py +332 -2
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_tensor_elements_perf.py +14 -0
- tensor_network_visualization-1.6.0/src/tensor_network_viz/_core/draw/plotter.py +0 -418
- tensor_network_visualization-1.6.0/src/tensor_network_viz/_core/layout/free_directions_3d.py +0 -537
- tensor_network_visualization-1.6.0/src/tensor_network_viz/_ui_utils.py +0 -69
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/setup.cfg +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_visualization.egg-info/dependency_links.txt +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_visualization.egg-info/requires.txt +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_visualization.egg-info/top_level.txt +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_contraction_viewer_style.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/_draw_common.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/_label_format.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/_nodes_edges_common.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/axis_directions.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/contractions.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/curves.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/__init__.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/contraction_edges.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/edge_orchestration.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/edges.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/hover.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/draw/label_descriptors.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/graph.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/graph_cache.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/layout/__init__.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/layout/body.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/layout/direction_common.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/layout/geometry.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_core/layout/types.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_engine_specs.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_input_inspection.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_interaction/__init__.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_interaction/bridge.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_interaction/scheme.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_interaction/state.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_logging.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_matplotlib_state.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_registry.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_tensor_elements_payloads.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_typing.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/_widgets.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/einsum_module/__init__.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/einsum_module/_backend.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/einsum_module/_equation.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/einsum_module/_trace_state.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/einsum_module/_trace_types.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/einsum_module/contraction_cost.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/einsum_module/graph.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/einsum_module/renderer.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/einsum_module/trace.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/exceptions.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/interactive_viewer.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/py.typed +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/quimb/__init__.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/quimb/graph.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/quimb/renderer.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/snapshot.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/tenpy/__init__.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/tenpy/explicit.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/tenpy/graph.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/tenpy/renderer.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/tensor_comparison_config.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/tensor_elements.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/tensor_elements_config.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/tensorkrowch/__init__.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/tensorkrowch/_history.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/tensorkrowch/graph.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/tensornetwork/__init__.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/src/tensor_network_viz/tensornetwork/graph.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_ci_workflow.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_contraction_groups_once.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_contraction_scheme_api.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_draw_performance.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_edge_index_label_2d.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_einsum_autotrace.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_integration_einsum.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_integration_tensorkrowch.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_interaction_state.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_label_format.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_lazy_imports.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_logging_and_exceptions.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_matplotlib_state.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_node_degrees_perf.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_packaging_metadata.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/tests/test_tensor_comparison.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.2}/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.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tensor-network-visualization
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.2
|
|
4
4
|
Summary: Minimal Matplotlib visualizations for TensorKrowch, TensorNetwork, Quimb, TeNPy, and traced PyTorch/NumPy einsum tensor networks.
|
|
5
5
|
Author: Alejandro Mata Ali
|
|
6
6
|
License-Expression: MIT
|
|
@@ -156,10 +156,27 @@ fig.savefig("tensorkrowch-network.png", bbox_inches="tight")
|
|
|
156
156
|
Use `show=False` when you want to save or customize the figure yourself. Use
|
|
157
157
|
`show_controls=False` when you want a clean static figure with no embedded Matplotlib controls.
|
|
158
158
|
|
|
159
|
-
In
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
[
|
|
159
|
+
In a notebook, use this exact recipe:
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
%pip install "tensor-network-visualization[jupyter]"
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
If you just installed that extra in the current kernel, restart the kernel once. Then, in the
|
|
166
|
+
first plotting cell:
|
|
167
|
+
|
|
168
|
+
```python
|
|
169
|
+
%matplotlib widget
|
|
170
|
+
|
|
171
|
+
from tensor_network_viz import PlotConfig, show_tensor_network
|
|
172
|
+
|
|
173
|
+
fig, ax = show_tensor_network(
|
|
174
|
+
network,
|
|
175
|
+
config=PlotConfig(show_tensor_labels=True, hover_labels=True),
|
|
176
|
+
)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
See [Installation](docs/installation.md) and [User Guide](docs/guide.md) for details.
|
|
163
180
|
|
|
164
181
|
## Documentation
|
|
165
182
|
|
|
@@ -169,11 +186,38 @@ figures with embedded controls. See [Installation](docs/installation.md) and
|
|
|
169
186
|
logging.
|
|
170
187
|
- [User Guide](docs/guide.md): workflows, notebooks, exports, layouts, tensor inspection,
|
|
171
188
|
comparisons, snapshots, and performance tips.
|
|
189
|
+
- [Layout Algorithms](docs/algorithms.md): node placement and free-edge direction rules in 2D and
|
|
190
|
+
3D.
|
|
172
191
|
- [Backend Examples](docs/backends.md): copy-paste examples for TensorKrowch, TensorNetwork, Quimb,
|
|
173
192
|
TeNPy, and `einsum`.
|
|
174
193
|
- [Troubleshooting](docs/troubleshooting.md): common install, Jupyter, Matplotlib, backend, and data
|
|
175
194
|
issues.
|
|
176
195
|
- [Repository Examples](examples/README.md): command-line demo launcher and example catalog.
|
|
196
|
+
- [Demo Commands](commands.md): copy-paste commands for every repository demo.
|
|
197
|
+
|
|
198
|
+
## Demo Gallery
|
|
199
|
+
|
|
200
|
+
The repository examples are organized around the same launcher:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
python examples/run_demo.py <group> <demo>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
The gallery includes backend demos for TensorKrowch, TensorNetwork, Quimb, TeNPy, and `einsum`,
|
|
207
|
+
plus three focused groups:
|
|
208
|
+
|
|
209
|
+
- `themes overview`: compares `default`, `paper`, and `colorblind` visual modes.
|
|
210
|
+
- `placements`: shows object, list, 2D grid, 3D grid, manual positions, manual schemes, and named
|
|
211
|
+
index inputs.
|
|
212
|
+
- `geometry`: renders larger irregular, incomplete, triangular, pyramidal, circular, and
|
|
213
|
+
disconnected networks.
|
|
214
|
+
|
|
215
|
+
For batch checks, use:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
python examples/run_all_examples.py --group engines --views 2d --list
|
|
219
|
+
python examples/run_all_examples.py --group all --views 2d --output-dir .tmp/examples
|
|
220
|
+
```
|
|
177
221
|
|
|
178
222
|
## Project Links
|
|
179
223
|
|
|
@@ -1,133 +1,177 @@
|
|
|
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
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
[
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
- [
|
|
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 a notebook, use this exact recipe:
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
%pip install "tensor-network-visualization[jupyter]"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
If you just installed that extra in the current kernel, restart the kernel once. Then, in the
|
|
115
|
+
first plotting cell:
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
%matplotlib widget
|
|
119
|
+
|
|
120
|
+
from tensor_network_viz import PlotConfig, show_tensor_network
|
|
121
|
+
|
|
122
|
+
fig, ax = show_tensor_network(
|
|
123
|
+
network,
|
|
124
|
+
config=PlotConfig(show_tensor_labels=True, hover_labels=True),
|
|
125
|
+
)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
See [Installation](docs/installation.md) and [User Guide](docs/guide.md) for details.
|
|
129
|
+
|
|
130
|
+
## Documentation
|
|
131
|
+
|
|
132
|
+
- [Installation](docs/installation.md): virtual environments, optional extras, Jupyter, and local
|
|
133
|
+
editable installs.
|
|
134
|
+
- [API Reference](docs/api.md): public functions, configuration objects, snapshots, exceptions, and
|
|
135
|
+
logging.
|
|
136
|
+
- [User Guide](docs/guide.md): workflows, notebooks, exports, layouts, tensor inspection,
|
|
137
|
+
comparisons, snapshots, and performance tips.
|
|
138
|
+
- [Layout Algorithms](docs/algorithms.md): node placement and free-edge direction rules in 2D and
|
|
139
|
+
3D.
|
|
140
|
+
- [Backend Examples](docs/backends.md): copy-paste examples for TensorKrowch, TensorNetwork, Quimb,
|
|
141
|
+
TeNPy, and `einsum`.
|
|
142
|
+
- [Troubleshooting](docs/troubleshooting.md): common install, Jupyter, Matplotlib, backend, and data
|
|
143
|
+
issues.
|
|
144
|
+
- [Repository Examples](examples/README.md): command-line demo launcher and example catalog.
|
|
145
|
+
- [Demo Commands](commands.md): copy-paste commands for every repository demo.
|
|
146
|
+
|
|
147
|
+
## Demo Gallery
|
|
148
|
+
|
|
149
|
+
The repository examples are organized around the same launcher:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
python examples/run_demo.py <group> <demo>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
The gallery includes backend demos for TensorKrowch, TensorNetwork, Quimb, TeNPy, and `einsum`,
|
|
156
|
+
plus three focused groups:
|
|
157
|
+
|
|
158
|
+
- `themes overview`: compares `default`, `paper`, and `colorblind` visual modes.
|
|
159
|
+
- `placements`: shows object, list, 2D grid, 3D grid, manual positions, manual schemes, and named
|
|
160
|
+
index inputs.
|
|
161
|
+
- `geometry`: renders larger irregular, incomplete, triangular, pyramidal, circular, and
|
|
162
|
+
disconnected networks.
|
|
163
|
+
|
|
164
|
+
For batch checks, use:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
python examples/run_all_examples.py --group engines --views 2d --list
|
|
168
|
+
python examples/run_all_examples.py --group all --views 2d --output-dir .tmp/examples
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Project Links
|
|
172
|
+
|
|
173
|
+
- [Changelog](CHANGELOG.md)
|
|
174
|
+
- [Contributing](CONTRIBUTING.md)
|
|
175
|
+
- [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
176
|
+
- [Issues](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/issues)
|
|
177
|
+
- [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.6.
|
|
7
|
+
version = "1.6.2"
|
|
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"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tensor-network-visualization
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.2
|
|
4
4
|
Summary: Minimal Matplotlib visualizations for TensorKrowch, TensorNetwork, Quimb, TeNPy, and traced PyTorch/NumPy einsum tensor networks.
|
|
5
5
|
Author: Alejandro Mata Ali
|
|
6
6
|
License-Expression: MIT
|
|
@@ -156,10 +156,27 @@ fig.savefig("tensorkrowch-network.png", bbox_inches="tight")
|
|
|
156
156
|
Use `show=False` when you want to save or customize the figure yourself. Use
|
|
157
157
|
`show_controls=False` when you want a clean static figure with no embedded Matplotlib controls.
|
|
158
158
|
|
|
159
|
-
In
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
[
|
|
159
|
+
In a notebook, use this exact recipe:
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
%pip install "tensor-network-visualization[jupyter]"
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
If you just installed that extra in the current kernel, restart the kernel once. Then, in the
|
|
166
|
+
first plotting cell:
|
|
167
|
+
|
|
168
|
+
```python
|
|
169
|
+
%matplotlib widget
|
|
170
|
+
|
|
171
|
+
from tensor_network_viz import PlotConfig, show_tensor_network
|
|
172
|
+
|
|
173
|
+
fig, ax = show_tensor_network(
|
|
174
|
+
network,
|
|
175
|
+
config=PlotConfig(show_tensor_labels=True, hover_labels=True),
|
|
176
|
+
)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
See [Installation](docs/installation.md) and [User Guide](docs/guide.md) for details.
|
|
163
180
|
|
|
164
181
|
## Documentation
|
|
165
182
|
|
|
@@ -169,11 +186,38 @@ figures with embedded controls. See [Installation](docs/installation.md) and
|
|
|
169
186
|
logging.
|
|
170
187
|
- [User Guide](docs/guide.md): workflows, notebooks, exports, layouts, tensor inspection,
|
|
171
188
|
comparisons, snapshots, and performance tips.
|
|
189
|
+
- [Layout Algorithms](docs/algorithms.md): node placement and free-edge direction rules in 2D and
|
|
190
|
+
3D.
|
|
172
191
|
- [Backend Examples](docs/backends.md): copy-paste examples for TensorKrowch, TensorNetwork, Quimb,
|
|
173
192
|
TeNPy, and `einsum`.
|
|
174
193
|
- [Troubleshooting](docs/troubleshooting.md): common install, Jupyter, Matplotlib, backend, and data
|
|
175
194
|
issues.
|
|
176
195
|
- [Repository Examples](examples/README.md): command-line demo launcher and example catalog.
|
|
196
|
+
- [Demo Commands](commands.md): copy-paste commands for every repository demo.
|
|
197
|
+
|
|
198
|
+
## Demo Gallery
|
|
199
|
+
|
|
200
|
+
The repository examples are organized around the same launcher:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
python examples/run_demo.py <group> <demo>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
The gallery includes backend demos for TensorKrowch, TensorNetwork, Quimb, TeNPy, and `einsum`,
|
|
207
|
+
plus three focused groups:
|
|
208
|
+
|
|
209
|
+
- `themes overview`: compares `default`, `paper`, and `colorblind` visual modes.
|
|
210
|
+
- `placements`: shows object, list, 2D grid, 3D grid, manual positions, manual schemes, and named
|
|
211
|
+
index inputs.
|
|
212
|
+
- `geometry`: renders larger irregular, incomplete, triangular, pyramidal, circular, and
|
|
213
|
+
disconnected networks.
|
|
214
|
+
|
|
215
|
+
For batch checks, use:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
python examples/run_all_examples.py --group engines --views 2d --list
|
|
219
|
+
python examples/run_all_examples.py --group all --views 2d --output-dir .tmp/examples
|
|
220
|
+
```
|
|
177
221
|
|
|
178
222
|
## Project Links
|
|
179
223
|
|
|
@@ -18,6 +18,8 @@ src/tensor_network_viz/_registry.py
|
|
|
18
18
|
src/tensor_network_viz/_tensor_comparison_support.py
|
|
19
19
|
src/tensor_network_viz/_tensor_elements_controller.py
|
|
20
20
|
src/tensor_network_viz/_tensor_elements_data.py
|
|
21
|
+
src/tensor_network_viz/_tensor_elements_inputs.py
|
|
22
|
+
src/tensor_network_viz/_tensor_elements_models.py
|
|
21
23
|
src/tensor_network_viz/_tensor_elements_payloads.py
|
|
22
24
|
src/tensor_network_viz/_tensor_elements_rendering.py
|
|
23
25
|
src/tensor_network_viz/_tensor_elements_support.py
|
|
@@ -47,6 +49,8 @@ src/tensor_network_viz/_core/graph.py
|
|
|
47
49
|
src/tensor_network_viz/_core/graph_cache.py
|
|
48
50
|
src/tensor_network_viz/_core/graph_utils.py
|
|
49
51
|
src/tensor_network_viz/_core/layout_structure.py
|
|
52
|
+
src/tensor_network_viz/_core/layout_structure_coordinates.py
|
|
53
|
+
src/tensor_network_viz/_core/layout_structure_sparse_grid.py
|
|
50
54
|
src/tensor_network_viz/_core/renderer.py
|
|
51
55
|
src/tensor_network_viz/_core/draw/__init__.py
|
|
52
56
|
src/tensor_network_viz/_core/draw/constants.py
|
|
@@ -64,6 +68,9 @@ src/tensor_network_viz/_core/draw/label_descriptors.py
|
|
|
64
68
|
src/tensor_network_viz/_core/draw/labels_misc.py
|
|
65
69
|
src/tensor_network_viz/_core/draw/pick_distance.py
|
|
66
70
|
src/tensor_network_viz/_core/draw/plotter.py
|
|
71
|
+
src/tensor_network_viz/_core/draw/plotter_2d.py
|
|
72
|
+
src/tensor_network_viz/_core/draw/plotter_3d.py
|
|
73
|
+
src/tensor_network_viz/_core/draw/plotter_common.py
|
|
67
74
|
src/tensor_network_viz/_core/draw/render_prep.py
|
|
68
75
|
src/tensor_network_viz/_core/draw/scene_state.py
|
|
69
76
|
src/tensor_network_viz/_core/draw/tensors.py
|
|
@@ -75,6 +82,7 @@ src/tensor_network_viz/_core/layout/direction_common.py
|
|
|
75
82
|
src/tensor_network_viz/_core/layout/force_directed.py
|
|
76
83
|
src/tensor_network_viz/_core/layout/free_directions_2d.py
|
|
77
84
|
src/tensor_network_viz/_core/layout/free_directions_3d.py
|
|
85
|
+
src/tensor_network_viz/_core/layout/generic_coarsening.py
|
|
78
86
|
src/tensor_network_viz/_core/layout/geometry.py
|
|
79
87
|
src/tensor_network_viz/_core/layout/parameters.py
|
|
80
88
|
src/tensor_network_viz/_core/layout/positions.py
|
|
@@ -16,6 +16,7 @@ if TYPE_CHECKING:
|
|
|
16
16
|
from .config import (
|
|
17
17
|
EngineName,
|
|
18
18
|
PlotConfig,
|
|
19
|
+
PlotTheme,
|
|
19
20
|
TensorNetworkDiagnosticsConfig,
|
|
20
21
|
TensorNetworkFocus,
|
|
21
22
|
ViewName,
|
|
@@ -161,6 +162,7 @@ _LAZY_EXPORTS: dict[str, tuple[str, str]] = {
|
|
|
161
162
|
"NormalizedTensorGraph": (".snapshot", "NormalizedTensorGraph"),
|
|
162
163
|
"NormalizedTensorNode": (".snapshot", "NormalizedTensorNode"),
|
|
163
164
|
"PlotConfig": (".config", "PlotConfig"),
|
|
165
|
+
"PlotTheme": (".config", "PlotTheme"),
|
|
164
166
|
"TenPyTensorNetwork": (".tenpy.explicit", "TenPyTensorNetwork"),
|
|
165
167
|
"TensorComparisonConfig": (".tensor_comparison_config", "TensorComparisonConfig"),
|
|
166
168
|
"TensorAnalysisConfig": (".tensor_elements_config", "TensorAnalysisConfig"),
|
|
@@ -214,6 +216,7 @@ __all__ = [
|
|
|
214
216
|
"NormalizedTensorGraph",
|
|
215
217
|
"NormalizedTensorNode",
|
|
216
218
|
"PlotConfig",
|
|
219
|
+
"PlotTheme",
|
|
217
220
|
"TensorComparisonConfig",
|
|
218
221
|
"TensorAnalysisConfig",
|
|
219
222
|
"TensorDataError",
|
|
@@ -8,7 +8,9 @@ from matplotlib.figure import Figure
|
|
|
8
8
|
from matplotlib.text import Text
|
|
9
9
|
from matplotlib.widgets import Button, Slider
|
|
10
10
|
|
|
11
|
+
from ._ui_utils import _control_slider_handle_style, _slider_track_color, _style_control_button
|
|
11
12
|
from ._widgets import _SafeButton, _SafeSlider
|
|
13
|
+
from .config import PlotConfig
|
|
12
14
|
|
|
13
15
|
_PLAYBACK_DETAILS_BOUNDS: tuple[float, float, float, float] = (0.23, 0.116, 0.7, 0.12)
|
|
14
16
|
# Top of the cost / step-details axis; interactive chrome (checkboxes, 2d/3d) aligns to this y.
|
|
@@ -29,6 +31,7 @@ _PLAYBACK_SLIDER_HANDLE_STYLE: dict[str, Any] = {
|
|
|
29
31
|
"edgecolor": "#1d4ed8",
|
|
30
32
|
"size": 11,
|
|
31
33
|
}
|
|
34
|
+
_PLAYBACK_SLIDER_TRACK_WHITE_MIX: float = 0.82
|
|
32
35
|
_PLAYBACK_BUTTON_START_X: float = 0.73
|
|
33
36
|
_PLAYBACK_BUTTON_Y: float = 0.058
|
|
34
37
|
_PLAYBACK_BUTTON_WIDTH: float = 0.055
|
|
@@ -51,6 +54,15 @@ _CONTROL_FRAME_PROPS: dict[str, float] = {"s": 44.0, "linewidth": 0.9}
|
|
|
51
54
|
_CONTROL_CHECK_PROPS: dict[str, float] = {"s": 34.0, "linewidth": 1.0}
|
|
52
55
|
|
|
53
56
|
|
|
57
|
+
def _playback_slider_handle_style(config: PlotConfig | None) -> dict[str, Any]:
|
|
58
|
+
resolved = config if config is not None else PlotConfig()
|
|
59
|
+
return _control_slider_handle_style(
|
|
60
|
+
active_color=resolved.bond_edge_color,
|
|
61
|
+
edge_color=resolved.node_edge_color,
|
|
62
|
+
size=float(_PLAYBACK_SLIDER_HANDLE_STYLE["size"]),
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
54
66
|
def create_playback_details_panel(fig: Figure) -> tuple[Axes, Text]:
|
|
55
67
|
ax_details = fig.add_axes(_PLAYBACK_DETAILS_BOUNDS)
|
|
56
68
|
ax_details.set_xticks([])
|
|
@@ -82,8 +94,11 @@ def create_playback_slider(
|
|
|
82
94
|
*,
|
|
83
95
|
num_steps: int,
|
|
84
96
|
initial_step: int,
|
|
97
|
+
config: PlotConfig | None = None,
|
|
85
98
|
) -> Slider:
|
|
86
99
|
ax_slider = fig.add_axes(_PLAYBACK_SLIDER_BOUNDS)
|
|
100
|
+
resolved = config if config is not None else PlotConfig()
|
|
101
|
+
active_color = resolved.bond_edge_color
|
|
87
102
|
return _SafeSlider(
|
|
88
103
|
ax_slider,
|
|
89
104
|
"Step",
|
|
@@ -91,7 +106,12 @@ def create_playback_slider(
|
|
|
91
106
|
float(max(0, num_steps)),
|
|
92
107
|
valinit=float(initial_step),
|
|
93
108
|
valstep=1,
|
|
94
|
-
|
|
109
|
+
color=active_color,
|
|
110
|
+
track_color=_slider_track_color(
|
|
111
|
+
active_color,
|
|
112
|
+
white_mix=_PLAYBACK_SLIDER_TRACK_WHITE_MIX,
|
|
113
|
+
),
|
|
114
|
+
handle_style=_playback_slider_handle_style(config),
|
|
95
115
|
)
|
|
96
116
|
|
|
97
117
|
|
|
@@ -104,11 +124,12 @@ def create_playback_buttons(fig: Figure) -> tuple[Button, Button, Button]:
|
|
|
104
124
|
ax_play = fig.add_axes((bx, by, bw, bh))
|
|
105
125
|
ax_pause = fig.add_axes((bx + bw + gap, by, bw, bh))
|
|
106
126
|
ax_reset = fig.add_axes((bx + 2.0 * (bw + gap), by, _PLAYBACK_RESET_WIDTH, bh))
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
127
|
+
btn_play = _SafeButton(ax_play, "Play")
|
|
128
|
+
btn_pause = _SafeButton(ax_pause, "Pause")
|
|
129
|
+
btn_reset = _SafeButton(ax_reset, "Reset")
|
|
130
|
+
for button in (btn_play, btn_pause, btn_reset):
|
|
131
|
+
_style_control_button(button, font_size=8.8)
|
|
132
|
+
return (btn_play, btn_pause, btn_reset)
|
|
112
133
|
|
|
113
134
|
|
|
114
135
|
__all__ = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"""Internal shared rendering core for tensor network visualization."""
|
|
1
|
+
"""Internal shared rendering core for tensor network visualization."""
|