tensor-network-visualization 1.6.3__tar.gz → 2.0.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.3 → tensor_network_visualization-2.0.1}/LICENSE +21 -21
- {tensor_network_visualization-1.6.3/src/tensor_network_visualization.egg-info → tensor_network_visualization-2.0.1}/PKG-INFO +58 -3
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/README.md +72 -21
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/pyproject.toml +6 -2
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1/src/tensor_network_visualization.egg-info}/PKG-INFO +58 -3
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_visualization.egg-info/SOURCES.txt +1 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_visualization.egg-info/requires.txt +1 -1
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/__init__.py +7 -1
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/__init__.py +1 -1
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/disk_metrics.py +73 -73
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/edge_orchestration.py +220 -220
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/fonts_and_scale.py +100 -12
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/graph_pipeline.py +2 -1
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/pick_distance.py +82 -82
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/graph_utils.py +95 -95
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/direction_common.py +10 -2
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/force_directed.py +247 -247
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/free_directions_2d.py +38 -23
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/free_directions_3d.py +13 -7
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/generic_coarsening.py +65 -2
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/positions.py +97 -31
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout_structure.py +153 -10
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_interaction/bridge.py +180 -167
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_interaction/controller.py +76 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_interaction/tensor_inspector.py +35 -1
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_interactive_scene.py +1 -1
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_matplotlib_state.py +4 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_tensor_elements_controller.py +192 -7
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_tensor_elements_rendering.py +32 -17
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/config.py +7 -1
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/einsum_module/contraction_cost.py +2 -2
- tensor_network_visualization-2.0.1/src/tensor_network_viz/tensor_elements_config.py +308 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensorkrowch/renderer.py +17 -17
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensornetwork/renderer.py +17 -17
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/viewer.py +28 -5
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_bench_user_workflows.py +246 -246
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_contraction_cost.py +3 -3
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_contraction_viewer.py +4 -4
- tensor_network_visualization-2.0.1/tests/test_documentation_gallery.py +107 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_einsum_backend.py +6 -4
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_examples.py +173 -2
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_integration_tensornetwork.py +26 -26
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_layout_core.py +210 -10
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_packaging_metadata.py +7 -1
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_plotting.py +3766 -3514
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_public_api.py +158 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_tensor_elements.py +329 -1
- tensor_network_visualization-1.6.3/src/tensor_network_viz/tensor_elements_config.py +0 -148
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/setup.cfg +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_visualization.egg-info/dependency_links.txt +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_visualization.egg-info/top_level.txt +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_auto_display.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_contraction_viewer_style.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_contraction_viewer_ui.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/_draw_common.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/_label_format.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/_nodes_edges_common.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/axis_directions.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/contractions.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/curves.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/__init__.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/constants.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/contraction_edges.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/contraction_scheme.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/dangling_self_edges.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/edge_labels.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/edges.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/hover.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/label_descriptors.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/labels_misc.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/plotter.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/plotter_2d.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/plotter_3d.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/plotter_common.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/render_prep.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/scene_state.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/tensors.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/vectors.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/viewport_geometry.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/focus.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/graph.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/graph_cache.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/__init__.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/body.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/geometry.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/parameters.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/types.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout_structure_coordinates.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout_structure_sparse_grid.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/renderer.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_engine_specs.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_import_state.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_input_inspection.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_interaction/__init__.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_interaction/controls.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_interaction/scheme.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_interaction/state.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_interaction/views.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_logging.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_registry.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_tensor_comparison_support.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_tensor_elements_data.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_tensor_elements_inputs.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_tensor_elements_models.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_tensor_elements_payloads.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_tensor_elements_support.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_typing.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_ui_utils.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_widgets.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/contraction_viewer.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/einsum_module/__init__.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/einsum_module/_backend.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/einsum_module/_equation.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/einsum_module/_trace_state.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/einsum_module/_trace_types.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/einsum_module/graph.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/einsum_module/renderer.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/einsum_module/trace.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/exceptions.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/interactive_viewer.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/py.typed +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/quimb/__init__.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/quimb/graph.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/quimb/renderer.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/snapshot.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tenpy/__init__.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tenpy/explicit.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tenpy/graph.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tenpy/renderer.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensor_comparison.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensor_comparison_config.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensor_elements.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensorkrowch/__init__.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensorkrowch/_history.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensorkrowch/graph.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensornetwork/__init__.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensornetwork/graph.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_ci_workflow.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_contraction_groups_once.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_contraction_scheme.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_contraction_scheme_api.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_demo_cli_scheme.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_draw_performance.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_edge_index_label_2d.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_edge_index_label_3d.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_einsum_autotrace.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_engine_detection.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_engineering_baseline.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_examples_structure.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_graph_cache.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_integration_einsum.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_integration_tensorkrowch.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_interaction_controls.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_interaction_state.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_label_draw_metrics_perf.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_label_format.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_lazy_imports.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_logging_and_exceptions.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_matplotlib_state.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_node_degrees_perf.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_quimb_backend.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_render_performance_controls.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_show_tensor_network_throughput.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_snapshot_api.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_tenpy_backend.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_tensor_comparison.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_tensor_elements_perf.py +0 -0
- {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_verify_script.py +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Alejandro Mata Ali
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alejandro Mata Ali
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tensor-network-visualization
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.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
|
|
@@ -10,18 +10,22 @@ Project-URL: Changelog, https://github.com/DOKOS-TAYOS/Tensor-Network-Visualizat
|
|
|
10
10
|
Project-URL: Repository, https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization
|
|
11
11
|
Project-URL: Issues, https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/issues
|
|
12
12
|
Keywords: tensor-network,visualization,pytorch,numpy,tensorkrowch,tensornetwork,quimb,tenpy,einsum,quantum-inspired,matplotlib
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
13
16
|
Classifier: Programming Language :: Python :: 3
|
|
14
17
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
21
|
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
22
|
+
Classifier: Typing :: Typed
|
|
19
23
|
Requires-Python: >=3.11
|
|
20
24
|
Description-Content-Type: text/markdown
|
|
21
25
|
License-File: LICENSE
|
|
22
26
|
Requires-Dist: matplotlib>=3.7
|
|
23
27
|
Requires-Dist: networkx>=3.0
|
|
24
|
-
Requires-Dist: numpy
|
|
28
|
+
Requires-Dist: numpy>=2.0
|
|
25
29
|
Provides-Extra: dev
|
|
26
30
|
Requires-Dist: build; extra == "dev"
|
|
27
31
|
Requires-Dist: pytest; extra == "dev"
|
|
@@ -49,6 +53,14 @@ Provides-Extra: einsum
|
|
|
49
53
|
Requires-Dist: torch; extra == "einsum"
|
|
50
54
|
Dynamic: license-file
|
|
51
55
|
|
|
56
|
+
<p align="center">
|
|
57
|
+
<img
|
|
58
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/tensor_network_visualization_logo.png"
|
|
59
|
+
alt="Tensor-Network-Visualization logo"
|
|
60
|
+
width="420"
|
|
61
|
+
>
|
|
62
|
+
</p>
|
|
63
|
+
|
|
52
64
|
# Tensor-Network-Visualization
|
|
53
65
|
|
|
54
66
|
[](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/actions/workflows/ci.yml)
|
|
@@ -59,6 +71,47 @@ Dynamic: license-file
|
|
|
59
71
|
Minimal Matplotlib visualizations for TensorKrowch, TensorNetwork, Quimb, TeNPy, and traced
|
|
60
72
|
PyTorch/NumPy `einsum` tensor networks.
|
|
61
73
|
|
|
74
|
+
## Gallery
|
|
75
|
+
|
|
76
|
+
These are exports generated with the library and the repository demos. The clean renders use
|
|
77
|
+
transparent PNGs; the controls example keeps its background so the menu stays readable.
|
|
78
|
+
|
|
79
|
+
<p align="center">
|
|
80
|
+
<img
|
|
81
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/cubic_peps_3d.png"
|
|
82
|
+
alt="Cubic PEPS 3D tensor network visualization"
|
|
83
|
+
width="230"
|
|
84
|
+
>
|
|
85
|
+
<img
|
|
86
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/mera_2d.png"
|
|
87
|
+
alt="MERA 2D tensor network visualization with labels"
|
|
88
|
+
width="230"
|
|
89
|
+
>
|
|
90
|
+
<img
|
|
91
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/tubular_grid_3d.png"
|
|
92
|
+
alt="Tubular 3D tensor network visualization"
|
|
93
|
+
width="230"
|
|
94
|
+
>
|
|
95
|
+
</p>
|
|
96
|
+
|
|
97
|
+
<p align="center">
|
|
98
|
+
<img
|
|
99
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/network_controls.png"
|
|
100
|
+
alt="MPS with controls, tensor labels, and index labels"
|
|
101
|
+
width="230"
|
|
102
|
+
>
|
|
103
|
+
<img
|
|
104
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/tensor_elements_phase.png"
|
|
105
|
+
alt="Tensor elements phase visualization"
|
|
106
|
+
width="230"
|
|
107
|
+
>
|
|
108
|
+
<img
|
|
109
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/tensor_elements_controls.png"
|
|
110
|
+
alt="Tensor elements view with the full control menus"
|
|
111
|
+
width="230"
|
|
112
|
+
>
|
|
113
|
+
</p>
|
|
114
|
+
|
|
62
115
|
## Why This Exists
|
|
63
116
|
|
|
64
117
|
Tensor-network libraries expose different Python objects. This package gives them a small shared
|
|
@@ -206,7 +259,9 @@ python examples/run_demo.py <group> <demo>
|
|
|
206
259
|
The gallery includes backend demos for TensorKrowch, TensorNetwork, Quimb, TeNPy, and `einsum`,
|
|
207
260
|
plus three focused groups:
|
|
208
261
|
|
|
209
|
-
- `themes overview`: compares
|
|
262
|
+
- `themes overview`: compares the `PlotConfig` visual presets for tensor-network figures.
|
|
263
|
+
- `themes tensor_elements`: compares the `TensorElementsConfig` presets for `show_tensor_elements(...)`
|
|
264
|
+
and the linked tensor inspector.
|
|
210
265
|
- `placements`: shows object, list, 2D grid, 3D grid, manual positions, manual schemes, and named
|
|
211
266
|
index inputs.
|
|
212
267
|
- `geometry`: renders larger irregular, incomplete, triangular, pyramidal, circular, and
|
|
@@ -1,18 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img
|
|
3
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/tensor_network_visualization_logo.png"
|
|
4
|
+
alt="Tensor-Network-Visualization logo"
|
|
5
|
+
width="420"
|
|
6
|
+
>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
# Tensor-Network-Visualization
|
|
10
|
+
|
|
11
|
+
[](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/actions/workflows/ci.yml)
|
|
12
|
+
[](https://pypi.org/project/tensor-network-visualization/)
|
|
13
|
+
[](https://pypi.org/project/tensor-network-visualization/)
|
|
6
14
|
[](https://opensource.org/licenses/MIT)
|
|
7
15
|
|
|
8
|
-
Minimal Matplotlib visualizations for TensorKrowch, TensorNetwork, Quimb, TeNPy, and traced
|
|
9
|
-
PyTorch/NumPy `einsum` tensor networks.
|
|
10
|
-
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
Minimal Matplotlib visualizations for TensorKrowch, TensorNetwork, Quimb, TeNPy, and traced
|
|
17
|
+
PyTorch/NumPy `einsum` tensor networks.
|
|
18
|
+
|
|
19
|
+
## Gallery
|
|
20
|
+
|
|
21
|
+
These are exports generated with the library and the repository demos. The clean renders use
|
|
22
|
+
transparent PNGs; the controls example keeps its background so the menu stays readable.
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
<img
|
|
26
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/cubic_peps_3d.png"
|
|
27
|
+
alt="Cubic PEPS 3D tensor network visualization"
|
|
28
|
+
width="230"
|
|
29
|
+
>
|
|
30
|
+
<img
|
|
31
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/mera_2d.png"
|
|
32
|
+
alt="MERA 2D tensor network visualization with labels"
|
|
33
|
+
width="230"
|
|
34
|
+
>
|
|
35
|
+
<img
|
|
36
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/tubular_grid_3d.png"
|
|
37
|
+
alt="Tubular 3D tensor network visualization"
|
|
38
|
+
width="230"
|
|
39
|
+
>
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
<p align="center">
|
|
43
|
+
<img
|
|
44
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/network_controls.png"
|
|
45
|
+
alt="MPS with controls, tensor labels, and index labels"
|
|
46
|
+
width="230"
|
|
47
|
+
>
|
|
48
|
+
<img
|
|
49
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/tensor_elements_phase.png"
|
|
50
|
+
alt="Tensor elements phase visualization"
|
|
51
|
+
width="230"
|
|
52
|
+
>
|
|
53
|
+
<img
|
|
54
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/tensor_elements_controls.png"
|
|
55
|
+
alt="Tensor elements view with the full control menus"
|
|
56
|
+
width="230"
|
|
57
|
+
>
|
|
58
|
+
</p>
|
|
59
|
+
|
|
60
|
+
## Why This Exists
|
|
61
|
+
|
|
62
|
+
Tensor-network libraries expose different Python objects. This package gives them a small shared
|
|
63
|
+
visualization API so you can inspect structure, tensor values, contraction playback, and normalized
|
|
64
|
+
graph exports without rewriting plotting code for every backend.
|
|
16
65
|
|
|
17
66
|
The common entry points are:
|
|
18
67
|
|
|
@@ -152,14 +201,16 @@ The repository examples are organized around the same launcher:
|
|
|
152
201
|
python examples/run_demo.py <group> <demo>
|
|
153
202
|
```
|
|
154
203
|
|
|
155
|
-
The gallery includes backend demos for TensorKrowch, TensorNetwork, Quimb, TeNPy, and `einsum`,
|
|
156
|
-
plus three focused groups:
|
|
157
|
-
|
|
158
|
-
- `themes overview`: compares
|
|
159
|
-
- `
|
|
160
|
-
|
|
161
|
-
- `
|
|
162
|
-
|
|
204
|
+
The gallery includes backend demos for TensorKrowch, TensorNetwork, Quimb, TeNPy, and `einsum`,
|
|
205
|
+
plus three focused groups:
|
|
206
|
+
|
|
207
|
+
- `themes overview`: compares the `PlotConfig` visual presets for tensor-network figures.
|
|
208
|
+
- `themes tensor_elements`: compares the `TensorElementsConfig` presets for `show_tensor_elements(...)`
|
|
209
|
+
and the linked tensor inspector.
|
|
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.
|
|
163
214
|
|
|
164
215
|
For batch checks, use:
|
|
165
216
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tensor-network-visualization"
|
|
7
|
-
version = "
|
|
7
|
+
version = "2.0.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"
|
|
@@ -15,15 +15,19 @@ keywords = ["tensor-network", "visualization", "pytorch", "numpy", "tensorkrowch
|
|
|
15
15
|
dependencies = [
|
|
16
16
|
"matplotlib>=3.7",
|
|
17
17
|
"networkx>=3.0",
|
|
18
|
-
"numpy",
|
|
18
|
+
"numpy>=2.0",
|
|
19
19
|
]
|
|
20
20
|
classifiers = [
|
|
21
|
+
"Development Status :: 5 - Production/Stable",
|
|
22
|
+
"Intended Audience :: Science/Research",
|
|
23
|
+
"Operating System :: OS Independent",
|
|
21
24
|
"Programming Language :: Python :: 3",
|
|
22
25
|
"Programming Language :: Python :: 3 :: Only",
|
|
23
26
|
"Programming Language :: Python :: 3.11",
|
|
24
27
|
"Programming Language :: Python :: 3.12",
|
|
25
28
|
"Programming Language :: Python :: 3.13",
|
|
26
29
|
"Topic :: Scientific/Engineering :: Visualization",
|
|
30
|
+
"Typing :: Typed",
|
|
27
31
|
]
|
|
28
32
|
|
|
29
33
|
[project.urls]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tensor-network-visualization
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.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
|
|
@@ -10,18 +10,22 @@ Project-URL: Changelog, https://github.com/DOKOS-TAYOS/Tensor-Network-Visualizat
|
|
|
10
10
|
Project-URL: Repository, https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization
|
|
11
11
|
Project-URL: Issues, https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/issues
|
|
12
12
|
Keywords: tensor-network,visualization,pytorch,numpy,tensorkrowch,tensornetwork,quimb,tenpy,einsum,quantum-inspired,matplotlib
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
13
16
|
Classifier: Programming Language :: Python :: 3
|
|
14
17
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
21
|
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
22
|
+
Classifier: Typing :: Typed
|
|
19
23
|
Requires-Python: >=3.11
|
|
20
24
|
Description-Content-Type: text/markdown
|
|
21
25
|
License-File: LICENSE
|
|
22
26
|
Requires-Dist: matplotlib>=3.7
|
|
23
27
|
Requires-Dist: networkx>=3.0
|
|
24
|
-
Requires-Dist: numpy
|
|
28
|
+
Requires-Dist: numpy>=2.0
|
|
25
29
|
Provides-Extra: dev
|
|
26
30
|
Requires-Dist: build; extra == "dev"
|
|
27
31
|
Requires-Dist: pytest; extra == "dev"
|
|
@@ -49,6 +53,14 @@ Provides-Extra: einsum
|
|
|
49
53
|
Requires-Dist: torch; extra == "einsum"
|
|
50
54
|
Dynamic: license-file
|
|
51
55
|
|
|
56
|
+
<p align="center">
|
|
57
|
+
<img
|
|
58
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/tensor_network_visualization_logo.png"
|
|
59
|
+
alt="Tensor-Network-Visualization logo"
|
|
60
|
+
width="420"
|
|
61
|
+
>
|
|
62
|
+
</p>
|
|
63
|
+
|
|
52
64
|
# Tensor-Network-Visualization
|
|
53
65
|
|
|
54
66
|
[](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/actions/workflows/ci.yml)
|
|
@@ -59,6 +71,47 @@ Dynamic: license-file
|
|
|
59
71
|
Minimal Matplotlib visualizations for TensorKrowch, TensorNetwork, Quimb, TeNPy, and traced
|
|
60
72
|
PyTorch/NumPy `einsum` tensor networks.
|
|
61
73
|
|
|
74
|
+
## Gallery
|
|
75
|
+
|
|
76
|
+
These are exports generated with the library and the repository demos. The clean renders use
|
|
77
|
+
transparent PNGs; the controls example keeps its background so the menu stays readable.
|
|
78
|
+
|
|
79
|
+
<p align="center">
|
|
80
|
+
<img
|
|
81
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/cubic_peps_3d.png"
|
|
82
|
+
alt="Cubic PEPS 3D tensor network visualization"
|
|
83
|
+
width="230"
|
|
84
|
+
>
|
|
85
|
+
<img
|
|
86
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/mera_2d.png"
|
|
87
|
+
alt="MERA 2D tensor network visualization with labels"
|
|
88
|
+
width="230"
|
|
89
|
+
>
|
|
90
|
+
<img
|
|
91
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/tubular_grid_3d.png"
|
|
92
|
+
alt="Tubular 3D tensor network visualization"
|
|
93
|
+
width="230"
|
|
94
|
+
>
|
|
95
|
+
</p>
|
|
96
|
+
|
|
97
|
+
<p align="center">
|
|
98
|
+
<img
|
|
99
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/network_controls.png"
|
|
100
|
+
alt="MPS with controls, tensor labels, and index labels"
|
|
101
|
+
width="230"
|
|
102
|
+
>
|
|
103
|
+
<img
|
|
104
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/tensor_elements_phase.png"
|
|
105
|
+
alt="Tensor elements phase visualization"
|
|
106
|
+
width="230"
|
|
107
|
+
>
|
|
108
|
+
<img
|
|
109
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/tensor_elements_controls.png"
|
|
110
|
+
alt="Tensor elements view with the full control menus"
|
|
111
|
+
width="230"
|
|
112
|
+
>
|
|
113
|
+
</p>
|
|
114
|
+
|
|
62
115
|
## Why This Exists
|
|
63
116
|
|
|
64
117
|
Tensor-network libraries expose different Python objects. This package gives them a small shared
|
|
@@ -206,7 +259,9 @@ python examples/run_demo.py <group> <demo>
|
|
|
206
259
|
The gallery includes backend demos for TensorKrowch, TensorNetwork, Quimb, TeNPy, and `einsum`,
|
|
207
260
|
plus three focused groups:
|
|
208
261
|
|
|
209
|
-
- `themes overview`: compares
|
|
262
|
+
- `themes overview`: compares the `PlotConfig` visual presets for tensor-network figures.
|
|
263
|
+
- `themes tensor_elements`: compares the `TensorElementsConfig` presets for `show_tensor_elements(...)`
|
|
264
|
+
and the linked tensor inspector.
|
|
210
265
|
- `placements`: shows object, list, 2D grid, 3D grid, manual positions, manual schemes, and named
|
|
211
266
|
index inputs.
|
|
212
267
|
- `geometry`: renders larger irregular, incomplete, triangular, pyramidal, circular, and
|
|
@@ -128,6 +128,7 @@ tests/test_contraction_scheme.py
|
|
|
128
128
|
tests/test_contraction_scheme_api.py
|
|
129
129
|
tests/test_contraction_viewer.py
|
|
130
130
|
tests/test_demo_cli_scheme.py
|
|
131
|
+
tests/test_documentation_gallery.py
|
|
131
132
|
tests/test_draw_performance.py
|
|
132
133
|
tests/test_edge_index_label_2d.py
|
|
133
134
|
tests/test_edge_index_label_3d.py
|
|
@@ -48,7 +48,11 @@ if TYPE_CHECKING:
|
|
|
48
48
|
from .tensor_comparison import show_tensor_comparison
|
|
49
49
|
from .tensor_comparison_config import TensorComparisonConfig
|
|
50
50
|
from .tensor_elements import show_tensor_elements
|
|
51
|
-
from .tensor_elements_config import
|
|
51
|
+
from .tensor_elements_config import (
|
|
52
|
+
TensorAnalysisConfig,
|
|
53
|
+
TensorElementsConfig,
|
|
54
|
+
TensorElementsTheme,
|
|
55
|
+
)
|
|
52
56
|
from .viewer import show_tensor_network
|
|
53
57
|
else:
|
|
54
58
|
|
|
@@ -169,6 +173,7 @@ _LAZY_EXPORTS: dict[str, tuple[str, str]] = {
|
|
|
169
173
|
"TensorDataError": (".exceptions", "TensorDataError"),
|
|
170
174
|
"TensorDataTypeError": (".exceptions", "TensorDataTypeError"),
|
|
171
175
|
"TensorElementsConfig": (".tensor_elements_config", "TensorElementsConfig"),
|
|
176
|
+
"TensorElementsTheme": (".tensor_elements_config", "TensorElementsTheme"),
|
|
172
177
|
"TensorNetworkDiagnosticsConfig": (".config", "TensorNetworkDiagnosticsConfig"),
|
|
173
178
|
"TensorNetworkFocus": (".config", "TensorNetworkFocus"),
|
|
174
179
|
"TensorNetworkLayoutSnapshot": (".snapshot", "TensorNetworkLayoutSnapshot"),
|
|
@@ -222,6 +227,7 @@ __all__ = [
|
|
|
222
227
|
"TensorDataError",
|
|
223
228
|
"TensorDataTypeError",
|
|
224
229
|
"TensorElementsConfig",
|
|
230
|
+
"TensorElementsTheme",
|
|
225
231
|
"TensorNetworkDiagnosticsConfig",
|
|
226
232
|
"TensorNetworkFocus",
|
|
227
233
|
"TensorNetworkLayoutSnapshot",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"""Internal shared rendering core for tensor network visualization."""
|
|
1
|
+
"""Internal shared rendering core for tensor network visualization."""
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import math
|
|
4
|
-
from typing import Any, Literal, cast
|
|
5
|
-
|
|
6
|
-
import numpy as np
|
|
7
|
-
from matplotlib.axes import Axes
|
|
8
|
-
from mpl_toolkits.mplot3d import proj3d
|
|
9
|
-
|
|
10
|
-
from .fonts_and_scale import _DrawScaleParams
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def _tensor_disk_radius_px_3d_nominal(ax: Any, p: _DrawScaleParams) -> float:
|
|
14
|
-
"""Pixels per data unit from axis spans only (no per-point projection); ``r`` in data units."""
|
|
15
|
-
from .viewport_geometry import _nominal_figure_px_per_data_unit_3d
|
|
16
|
-
|
|
17
|
-
k = _nominal_figure_px_per_data_unit_3d(ax)
|
|
18
|
-
return float(max(float(p.r) * k, 1e-9))
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def _display_disk_radius_px_2d(ax: Axes, center: np.ndarray, r_data: float) -> float:
|
|
22
|
-
"""Pixel radius for horizontal *r_data* at *center* (equal-aspect 2D)."""
|
|
23
|
-
c = np.asarray(center[:2], dtype=float)
|
|
24
|
-
row0 = c.reshape(1, -1)
|
|
25
|
-
row1 = (c + np.array([float(r_data), 0.0], dtype=float)).reshape(1, -1)
|
|
26
|
-
t0 = ax.transData.transform(row0)[0]
|
|
27
|
-
t1 = ax.transData.transform(row1)[0]
|
|
28
|
-
return float(np.hypot(float(t0[0] - t1[0]), float(t0[1] - t1[1])))
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def _display_disk_radius_px_3d(ax: Any, center: np.ndarray, r_data: float) -> float:
|
|
32
|
-
"""Conservative screen radius for data-space sphere *r_data* (current 3D view)."""
|
|
33
|
-
c = np.asarray(center, dtype=float)
|
|
34
|
-
r = float(r_data)
|
|
35
|
-
M = ax.get_proj()
|
|
36
|
-
xs0, ys0, _zs0 = proj3d.proj_transform(c[0], c[1], c[2], M)
|
|
37
|
-
pt_center = ax.transData.transform((xs0, ys0))
|
|
38
|
-
md = math.inf
|
|
39
|
-
for ex, ey, ez in (
|
|
40
|
-
(1.0, 0.0, 0.0),
|
|
41
|
-
(-1.0, 0.0, 0.0),
|
|
42
|
-
(0.0, 1.0, 0.0),
|
|
43
|
-
(0.0, -1.0, 0.0),
|
|
44
|
-
(0.0, 0.0, 1.0),
|
|
45
|
-
(0.0, 0.0, -1.0),
|
|
46
|
-
):
|
|
47
|
-
p = c + r * np.array([ex, ey, ez], dtype=float)
|
|
48
|
-
xs, ys, _zs = proj3d.proj_transform(p[0], p[1], p[2], M)
|
|
49
|
-
pt = ax.transData.transform((xs, ys))
|
|
50
|
-
d = float(np.hypot(pt[0] - pt_center[0], pt[1] - pt_center[1]))
|
|
51
|
-
md = min(md, d)
|
|
52
|
-
if not math.isfinite(md):
|
|
53
|
-
return 0.0
|
|
54
|
-
return float(md)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
def _tensor_disk_radius_px(
|
|
58
|
-
ax: Any,
|
|
59
|
-
anchor: np.ndarray,
|
|
60
|
-
p: _DrawScaleParams,
|
|
61
|
-
dimensions: Literal[2, 3],
|
|
62
|
-
) -> float:
|
|
63
|
-
if dimensions == 2:
|
|
64
|
-
return _display_disk_radius_px_2d(cast(Axes, ax), anchor, p.r)
|
|
65
|
-
return _display_disk_radius_px_3d(ax, anchor, p.r)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
__all__ = [
|
|
69
|
-
"_display_disk_radius_px_2d",
|
|
70
|
-
"_display_disk_radius_px_3d",
|
|
71
|
-
"_tensor_disk_radius_px",
|
|
72
|
-
"_tensor_disk_radius_px_3d_nominal",
|
|
73
|
-
]
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import math
|
|
4
|
+
from typing import Any, Literal, cast
|
|
5
|
+
|
|
6
|
+
import numpy as np
|
|
7
|
+
from matplotlib.axes import Axes
|
|
8
|
+
from mpl_toolkits.mplot3d import proj3d
|
|
9
|
+
|
|
10
|
+
from .fonts_and_scale import _DrawScaleParams
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _tensor_disk_radius_px_3d_nominal(ax: Any, p: _DrawScaleParams) -> float:
|
|
14
|
+
"""Pixels per data unit from axis spans only (no per-point projection); ``r`` in data units."""
|
|
15
|
+
from .viewport_geometry import _nominal_figure_px_per_data_unit_3d
|
|
16
|
+
|
|
17
|
+
k = _nominal_figure_px_per_data_unit_3d(ax)
|
|
18
|
+
return float(max(float(p.r) * k, 1e-9))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _display_disk_radius_px_2d(ax: Axes, center: np.ndarray, r_data: float) -> float:
|
|
22
|
+
"""Pixel radius for horizontal *r_data* at *center* (equal-aspect 2D)."""
|
|
23
|
+
c = np.asarray(center[:2], dtype=float)
|
|
24
|
+
row0 = c.reshape(1, -1)
|
|
25
|
+
row1 = (c + np.array([float(r_data), 0.0], dtype=float)).reshape(1, -1)
|
|
26
|
+
t0 = ax.transData.transform(row0)[0]
|
|
27
|
+
t1 = ax.transData.transform(row1)[0]
|
|
28
|
+
return float(np.hypot(float(t0[0] - t1[0]), float(t0[1] - t1[1])))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _display_disk_radius_px_3d(ax: Any, center: np.ndarray, r_data: float) -> float:
|
|
32
|
+
"""Conservative screen radius for data-space sphere *r_data* (current 3D view)."""
|
|
33
|
+
c = np.asarray(center, dtype=float)
|
|
34
|
+
r = float(r_data)
|
|
35
|
+
M = ax.get_proj()
|
|
36
|
+
xs0, ys0, _zs0 = proj3d.proj_transform(c[0], c[1], c[2], M)
|
|
37
|
+
pt_center = ax.transData.transform((xs0, ys0))
|
|
38
|
+
md = math.inf
|
|
39
|
+
for ex, ey, ez in (
|
|
40
|
+
(1.0, 0.0, 0.0),
|
|
41
|
+
(-1.0, 0.0, 0.0),
|
|
42
|
+
(0.0, 1.0, 0.0),
|
|
43
|
+
(0.0, -1.0, 0.0),
|
|
44
|
+
(0.0, 0.0, 1.0),
|
|
45
|
+
(0.0, 0.0, -1.0),
|
|
46
|
+
):
|
|
47
|
+
p = c + r * np.array([ex, ey, ez], dtype=float)
|
|
48
|
+
xs, ys, _zs = proj3d.proj_transform(p[0], p[1], p[2], M)
|
|
49
|
+
pt = ax.transData.transform((xs, ys))
|
|
50
|
+
d = float(np.hypot(pt[0] - pt_center[0], pt[1] - pt_center[1]))
|
|
51
|
+
md = min(md, d)
|
|
52
|
+
if not math.isfinite(md):
|
|
53
|
+
return 0.0
|
|
54
|
+
return float(md)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _tensor_disk_radius_px(
|
|
58
|
+
ax: Any,
|
|
59
|
+
anchor: np.ndarray,
|
|
60
|
+
p: _DrawScaleParams,
|
|
61
|
+
dimensions: Literal[2, 3],
|
|
62
|
+
) -> float:
|
|
63
|
+
if dimensions == 2:
|
|
64
|
+
return _display_disk_radius_px_2d(cast(Axes, ax), anchor, p.r)
|
|
65
|
+
return _display_disk_radius_px_3d(ax, anchor, p.r)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
__all__ = [
|
|
69
|
+
"_display_disk_radius_px_2d",
|
|
70
|
+
"_display_disk_radius_px_3d",
|
|
71
|
+
"_tensor_disk_radius_px",
|
|
72
|
+
"_tensor_disk_radius_px_3d_nominal",
|
|
73
|
+
]
|