tensor-network-visualization 1.6.0__tar.gz → 1.6.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tensor_network_visualization-1.6.0/src/tensor_network_visualization.egg-info → tensor_network_visualization-1.6.1}/PKG-INFO +28 -1
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/README.md +160 -133
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/pyproject.toml +1 -1
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1/src/tensor_network_visualization.egg-info}/PKG-INFO +28 -1
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_visualization.egg-info/SOURCES.txt +1 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/__init__.py +3 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_contraction_viewer_ui.py +27 -6
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/constants.py +1 -1
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/contraction_scheme.py +157 -16
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/edge_orchestration.py +220 -220
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/labels_misc.py +18 -9
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/plotter.py +60 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/render_prep.py +21 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/tensors.py +21 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/vectors.py +39 -33
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout/force_directed.py +247 -227
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout/free_directions_2d.py +12 -23
- tensor_network_visualization-1.6.1/src/tensor_network_viz/_core/layout/free_directions_3d.py +798 -0
- tensor_network_visualization-1.6.1/src/tensor_network_viz/_core/layout/generic_coarsening.py +716 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout/parameters.py +1 -1
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout/positions.py +242 -27
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout_structure.py +452 -4
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/renderer.py +7 -3
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_interaction/controller.py +8 -1
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_interaction/controls.py +2 -2
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_tensor_elements_controller.py +16 -1
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_tensor_elements_rendering.py +38 -5
- tensor_network_visualization-1.6.1/src/tensor_network_viz/_ui_utils.py +157 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/config.py +347 -161
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/contraction_viewer.py +312 -2
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/viewer.py +18 -4
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_contraction_cost.py +85 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_contraction_scheme.py +31 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_contraction_viewer.py +257 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_demo_cli_scheme.py +41 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_edge_index_label_3d.py +15 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_engine_detection.py +22 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_examples.py +254 -55
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_examples_structure.py +14 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_interaction_controls.py +37 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_layout_core.py +1307 -95
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_plotting.py +130 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_public_api.py +264 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_quimb_backend.py +41 -4
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_show_tensor_network_throughput.py +18 -16
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_snapshot_api.py +1 -1
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_tensor_elements.py +121 -1
- 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.1}/LICENSE +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/setup.cfg +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_visualization.egg-info/dependency_links.txt +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_visualization.egg-info/requires.txt +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_visualization.egg-info/top_level.txt +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_contraction_viewer_style.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/__init__.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/_draw_common.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/_label_format.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/_nodes_edges_common.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/axis_directions.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/contractions.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/curves.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/__init__.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/contraction_edges.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/dangling_self_edges.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/disk_metrics.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/edge_labels.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/edges.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/fonts_and_scale.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/graph_pipeline.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/hover.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/label_descriptors.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/pick_distance.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/scene_state.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/draw/viewport_geometry.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/focus.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/graph.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/graph_cache.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/graph_utils.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout/__init__.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout/body.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout/direction_common.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout/geometry.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_core/layout/types.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_engine_specs.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_input_inspection.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_interaction/__init__.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_interaction/bridge.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_interaction/scheme.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_interaction/state.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_interaction/tensor_inspector.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_interaction/views.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_interactive_scene.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_logging.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_matplotlib_state.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_registry.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_tensor_comparison_support.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_tensor_elements_data.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_tensor_elements_payloads.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_tensor_elements_support.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_typing.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/_widgets.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/einsum_module/__init__.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/einsum_module/_backend.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/einsum_module/_equation.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/einsum_module/_trace_state.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/einsum_module/_trace_types.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/einsum_module/contraction_cost.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/einsum_module/graph.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/einsum_module/renderer.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/einsum_module/trace.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/exceptions.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/interactive_viewer.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/py.typed +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/quimb/__init__.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/quimb/graph.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/quimb/renderer.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/snapshot.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tenpy/__init__.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tenpy/explicit.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tenpy/graph.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tenpy/renderer.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensor_comparison.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensor_comparison_config.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensor_elements.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensor_elements_config.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensorkrowch/__init__.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensorkrowch/_history.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensorkrowch/graph.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensorkrowch/renderer.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensornetwork/__init__.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensornetwork/graph.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/src/tensor_network_viz/tensornetwork/renderer.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_ci_workflow.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_contraction_groups_once.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_contraction_scheme_api.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_draw_performance.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_edge_index_label_2d.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_einsum_autotrace.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_einsum_backend.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_engineering_baseline.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_graph_cache.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_integration_einsum.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_integration_tensorkrowch.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_integration_tensornetwork.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_interaction_state.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_label_draw_metrics_perf.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_label_format.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_lazy_imports.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_logging_and_exceptions.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_matplotlib_state.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_node_degrees_perf.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_packaging_metadata.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_render_performance_controls.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_tenpy_backend.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_tensor_comparison.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_tensor_elements_perf.py +0 -0
- {tensor_network_visualization-1.6.0 → tensor_network_visualization-1.6.1}/tests/test_verify_script.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tensor-network-visualization
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.1
|
|
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
|
|
@@ -169,11 +169,38 @@ figures with embedded controls. See [Installation](docs/installation.md) and
|
|
|
169
169
|
logging.
|
|
170
170
|
- [User Guide](docs/guide.md): workflows, notebooks, exports, layouts, tensor inspection,
|
|
171
171
|
comparisons, snapshots, and performance tips.
|
|
172
|
+
- [Layout Algorithms](docs/algorithms.md): node placement and free-edge direction rules in 2D and
|
|
173
|
+
3D.
|
|
172
174
|
- [Backend Examples](docs/backends.md): copy-paste examples for TensorKrowch, TensorNetwork, Quimb,
|
|
173
175
|
TeNPy, and `einsum`.
|
|
174
176
|
- [Troubleshooting](docs/troubleshooting.md): common install, Jupyter, Matplotlib, backend, and data
|
|
175
177
|
issues.
|
|
176
178
|
- [Repository Examples](examples/README.md): command-line demo launcher and example catalog.
|
|
179
|
+
- [Demo Commands](commands.md): copy-paste commands for every repository demo.
|
|
180
|
+
|
|
181
|
+
## Demo Gallery
|
|
182
|
+
|
|
183
|
+
The repository examples are organized around the same launcher:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
python examples/run_demo.py <group> <demo>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
The gallery includes backend demos for TensorKrowch, TensorNetwork, Quimb, TeNPy, and `einsum`,
|
|
190
|
+
plus three focused groups:
|
|
191
|
+
|
|
192
|
+
- `themes overview`: compares `default`, `paper`, and `colorblind` visual modes.
|
|
193
|
+
- `placements`: shows object, list, 2D grid, 3D grid, manual positions, manual schemes, and named
|
|
194
|
+
index inputs.
|
|
195
|
+
- `geometry`: renders larger irregular, incomplete, triangular, pyramidal, circular, and
|
|
196
|
+
disconnected networks.
|
|
197
|
+
|
|
198
|
+
For batch checks, use:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
python examples/run_all_examples.py --group engines --views 2d --list
|
|
202
|
+
python examples/run_all_examples.py --group all --views 2d --output-dir .tmp/examples
|
|
203
|
+
```
|
|
177
204
|
|
|
178
205
|
## Project Links
|
|
179
206
|
|
|
@@ -1,133 +1,160 @@
|
|
|
1
|
-
# Tensor-Network-Visualization
|
|
2
|
-
|
|
3
|
-
[](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/actions/workflows/ci.yml)
|
|
4
|
-
[](https://pypi.org/project/tensor-network-visualization/)
|
|
5
|
-
[](https://pypi.org/project/tensor-network-visualization/)
|
|
6
|
-
[](https://opensource.org/licenses/MIT)
|
|
7
|
-
|
|
8
|
-
Minimal Matplotlib visualizations for TensorKrowch, TensorNetwork, Quimb, TeNPy, and traced
|
|
9
|
-
PyTorch/NumPy `einsum` tensor networks.
|
|
10
|
-
|
|
11
|
-
## Why This Exists
|
|
12
|
-
|
|
13
|
-
Tensor-network libraries expose different Python objects. This package gives them a small shared
|
|
14
|
-
visualization API so you can inspect structure, tensor values, contraction playback, and normalized
|
|
15
|
-
graph exports without rewriting plotting code for every backend.
|
|
16
|
-
|
|
17
|
-
The common entry points are:
|
|
18
|
-
|
|
19
|
-
```python
|
|
20
|
-
show_tensor_network(...)
|
|
21
|
-
show_tensor_elements(...)
|
|
22
|
-
show_tensor_comparison(...)
|
|
23
|
-
normalize_tensor_network(...)
|
|
24
|
-
export_tensor_network_snapshot(...)
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Install
|
|
28
|
-
|
|
29
|
-
- PyPI package name: `tensor-network-visualization`
|
|
30
|
-
- Import package: `tensor_network_viz`
|
|
31
|
-
- Requires Python 3.11 or newer.
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
python -m pip install tensor-network-visualization
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
The base install only depends on `numpy`, `matplotlib`, and `networkx`.
|
|
38
|
-
|
|
39
|
-
For interactive Jupyter figures:
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
python -m pip install "tensor-network-visualization[jupyter]"
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
For backend-specific packages, install the matching extra, for example:
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
python -m pip install "tensor-network-visualization[quimb]"
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
See [docs/installation.md](docs/installation.md) for virtual environments, all optional extras, and
|
|
52
|
-
local development installs.
|
|
53
|
-
|
|
54
|
-
## Basic Usage
|
|
55
|
-
|
|
56
|
-
### NumPy `einsum` trace (base install)
|
|
57
|
-
|
|
58
|
-
This example uses only base dependencies and a NumPy-backed `EinsumTrace`.
|
|
59
|
-
|
|
60
|
-
```python
|
|
61
|
-
import numpy as np
|
|
62
|
-
from tensor_network_viz import EinsumTrace, PlotConfig, einsum, show_tensor_network
|
|
63
|
-
|
|
64
|
-
trace = EinsumTrace()
|
|
65
|
-
a = np.ones((2, 3), dtype=float)
|
|
66
|
-
x = np.array([1.0, -0.5, 0.25], dtype=float)
|
|
67
|
-
|
|
68
|
-
trace.bind("A", a)
|
|
69
|
-
trace.bind("x", x)
|
|
70
|
-
einsum("ab,b->a", a, x, trace=trace, backend="numpy")
|
|
71
|
-
|
|
72
|
-
fig, ax = show_tensor_network(
|
|
73
|
-
trace,
|
|
74
|
-
config=PlotConfig(show_tensor_labels=True, hover_labels=True),
|
|
75
|
-
show=False,
|
|
76
|
-
)
|
|
77
|
-
fig.savefig("einsum-network.png", bbox_inches="tight")
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### TensorKrowch
|
|
81
|
-
|
|
82
|
-
Install the TensorKrowch extra (see [Installation](docs/installation.md) for details):
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
python -m pip install "tensor-network-visualization[tensorkrowch]"
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
```python
|
|
89
|
-
import tensorkrowch as tk
|
|
90
|
-
from tensor_network_viz import PlotConfig, show_tensor_network
|
|
91
|
-
|
|
92
|
-
network = tk.TensorNetwork(name="demo")
|
|
93
|
-
left = tk.Node(shape=(2, 2), axes_names=("a", "b"), name="L", network=network)
|
|
94
|
-
right = tk.Node(shape=(2, 2), axes_names=("b", "c"), name="R", network=network)
|
|
95
|
-
left["b"] ^ right["b"]
|
|
96
|
-
|
|
97
|
-
fig, ax = show_tensor_network(
|
|
98
|
-
network,
|
|
99
|
-
config=PlotConfig(show_tensor_labels=True, show_index_labels=False),
|
|
100
|
-
show=False,
|
|
101
|
-
)
|
|
102
|
-
fig.savefig("tensorkrowch-network.png", bbox_inches="tight")
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Use `show=False` when you want to save or customize the figure yourself. Use
|
|
106
|
-
`show_controls=False` when you want a clean static figure with no embedded Matplotlib controls.
|
|
107
|
-
|
|
108
|
-
In Jupyter, install `"tensor-network-visualization[jupyter]"`, run `%matplotlib widget` before
|
|
109
|
-
plotting, then call `show_tensor_network` as usual (default `show_controls=True`) for interactive
|
|
110
|
-
figures with embedded controls. See [Installation](docs/installation.md) and
|
|
111
|
-
[User Guide](docs/guide.md) for details.
|
|
112
|
-
|
|
113
|
-
## Documentation
|
|
114
|
-
|
|
115
|
-
- [Installation](docs/installation.md): virtual environments, optional extras, Jupyter, and local
|
|
116
|
-
editable installs.
|
|
117
|
-
- [API Reference](docs/api.md): public functions, configuration objects, snapshots, exceptions, and
|
|
118
|
-
logging.
|
|
119
|
-
- [User Guide](docs/guide.md): workflows, notebooks, exports, layouts, tensor inspection,
|
|
120
|
-
comparisons, snapshots, and performance tips.
|
|
121
|
-
- [
|
|
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 Jupyter, install `"tensor-network-visualization[jupyter]"`, run `%matplotlib widget` before
|
|
109
|
+
plotting, then call `show_tensor_network` as usual (default `show_controls=True`) for interactive
|
|
110
|
+
figures with embedded controls. See [Installation](docs/installation.md) and
|
|
111
|
+
[User Guide](docs/guide.md) for details.
|
|
112
|
+
|
|
113
|
+
## Documentation
|
|
114
|
+
|
|
115
|
+
- [Installation](docs/installation.md): virtual environments, optional extras, Jupyter, and local
|
|
116
|
+
editable installs.
|
|
117
|
+
- [API Reference](docs/api.md): public functions, configuration objects, snapshots, exceptions, and
|
|
118
|
+
logging.
|
|
119
|
+
- [User Guide](docs/guide.md): workflows, notebooks, exports, layouts, tensor inspection,
|
|
120
|
+
comparisons, snapshots, and performance tips.
|
|
121
|
+
- [Layout Algorithms](docs/algorithms.md): node placement and free-edge direction rules in 2D and
|
|
122
|
+
3D.
|
|
123
|
+
- [Backend Examples](docs/backends.md): copy-paste examples for TensorKrowch, TensorNetwork, Quimb,
|
|
124
|
+
TeNPy, and `einsum`.
|
|
125
|
+
- [Troubleshooting](docs/troubleshooting.md): common install, Jupyter, Matplotlib, backend, and data
|
|
126
|
+
issues.
|
|
127
|
+
- [Repository Examples](examples/README.md): command-line demo launcher and example catalog.
|
|
128
|
+
- [Demo Commands](commands.md): copy-paste commands for every repository demo.
|
|
129
|
+
|
|
130
|
+
## Demo Gallery
|
|
131
|
+
|
|
132
|
+
The repository examples are organized around the same launcher:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
python examples/run_demo.py <group> <demo>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
The gallery includes backend demos for TensorKrowch, TensorNetwork, Quimb, TeNPy, and `einsum`,
|
|
139
|
+
plus three focused groups:
|
|
140
|
+
|
|
141
|
+
- `themes overview`: compares `default`, `paper`, and `colorblind` visual modes.
|
|
142
|
+
- `placements`: shows object, list, 2D grid, 3D grid, manual positions, manual schemes, and named
|
|
143
|
+
index inputs.
|
|
144
|
+
- `geometry`: renders larger irregular, incomplete, triangular, pyramidal, circular, and
|
|
145
|
+
disconnected networks.
|
|
146
|
+
|
|
147
|
+
For batch checks, use:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
python examples/run_all_examples.py --group engines --views 2d --list
|
|
151
|
+
python examples/run_all_examples.py --group all --views 2d --output-dir .tmp/examples
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Project Links
|
|
155
|
+
|
|
156
|
+
- [Changelog](CHANGELOG.md)
|
|
157
|
+
- [Contributing](CONTRIBUTING.md)
|
|
158
|
+
- [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
159
|
+
- [Issues](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/issues)
|
|
160
|
+
- [Repository](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization)
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tensor-network-visualization"
|
|
7
|
-
version = "1.6.
|
|
7
|
+
version = "1.6.1"
|
|
8
8
|
description = "Minimal Matplotlib visualizations for TensorKrowch, TensorNetwork, Quimb, TeNPy, and traced PyTorch/NumPy einsum tensor networks."
|
|
9
9
|
authors = [{ name = "Alejandro Mata Ali" }]
|
|
10
10
|
readme = "README.md"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tensor-network-visualization
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.1
|
|
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
|
|
@@ -169,11 +169,38 @@ figures with embedded controls. See [Installation](docs/installation.md) and
|
|
|
169
169
|
logging.
|
|
170
170
|
- [User Guide](docs/guide.md): workflows, notebooks, exports, layouts, tensor inspection,
|
|
171
171
|
comparisons, snapshots, and performance tips.
|
|
172
|
+
- [Layout Algorithms](docs/algorithms.md): node placement and free-edge direction rules in 2D and
|
|
173
|
+
3D.
|
|
172
174
|
- [Backend Examples](docs/backends.md): copy-paste examples for TensorKrowch, TensorNetwork, Quimb,
|
|
173
175
|
TeNPy, and `einsum`.
|
|
174
176
|
- [Troubleshooting](docs/troubleshooting.md): common install, Jupyter, Matplotlib, backend, and data
|
|
175
177
|
issues.
|
|
176
178
|
- [Repository Examples](examples/README.md): command-line demo launcher and example catalog.
|
|
179
|
+
- [Demo Commands](commands.md): copy-paste commands for every repository demo.
|
|
180
|
+
|
|
181
|
+
## Demo Gallery
|
|
182
|
+
|
|
183
|
+
The repository examples are organized around the same launcher:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
python examples/run_demo.py <group> <demo>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
The gallery includes backend demos for TensorKrowch, TensorNetwork, Quimb, TeNPy, and `einsum`,
|
|
190
|
+
plus three focused groups:
|
|
191
|
+
|
|
192
|
+
- `themes overview`: compares `default`, `paper`, and `colorblind` visual modes.
|
|
193
|
+
- `placements`: shows object, list, 2D grid, 3D grid, manual positions, manual schemes, and named
|
|
194
|
+
index inputs.
|
|
195
|
+
- `geometry`: renders larger irregular, incomplete, triangular, pyramidal, circular, and
|
|
196
|
+
disconnected networks.
|
|
197
|
+
|
|
198
|
+
For batch checks, use:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
python examples/run_all_examples.py --group engines --views 2d --list
|
|
202
|
+
python examples/run_all_examples.py --group all --views 2d --output-dir .tmp/examples
|
|
203
|
+
```
|
|
177
204
|
|
|
178
205
|
## Project Links
|
|
179
206
|
|
|
@@ -75,6 +75,7 @@ src/tensor_network_viz/_core/layout/direction_common.py
|
|
|
75
75
|
src/tensor_network_viz/_core/layout/force_directed.py
|
|
76
76
|
src/tensor_network_viz/_core/layout/free_directions_2d.py
|
|
77
77
|
src/tensor_network_viz/_core/layout/free_directions_3d.py
|
|
78
|
+
src/tensor_network_viz/_core/layout/generic_coarsening.py
|
|
78
79
|
src/tensor_network_viz/_core/layout/geometry.py
|
|
79
80
|
src/tensor_network_viz/_core/layout/parameters.py
|
|
80
81
|
src/tensor_network_viz/_core/layout/positions.py
|
|
@@ -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__ = [
|
|
@@ -6,7 +6,7 @@ import numpy as np
|
|
|
6
6
|
|
|
7
7
|
# Multiedge separation; keep in sync with
|
|
8
8
|
# `_LAYOUT_BOND_CURVE_OFFSET_FACTOR` in `layout/parameters.py`.
|
|
9
|
-
_CURVE_OFFSET_FACTOR: float = 0.
|
|
9
|
+
_CURVE_OFFSET_FACTOR: float = 0.10
|
|
10
10
|
# Blends with chord length so multiedges keep visible separation when endpoints are close.
|
|
11
11
|
_CURVE_NEAR_PAIR_REF: float = 0.28
|
|
12
12
|
# Extra radius + offset so index captions sit just outside tensor disks (data units).
|