tensor-network-visualization 2.0.1__tar.gz → 2.0.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-2.0.1 → tensor_network_visualization-2.0.2}/LICENSE +21 -21
- {tensor_network_visualization-2.0.1/src/tensor_network_visualization.egg-info → tensor_network_visualization-2.0.2}/PKG-INFO +16 -3
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/README.md +91 -78
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/pyproject.toml +1 -1
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2/src/tensor_network_visualization.egg-info}/PKG-INFO +16 -3
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_visualization.egg-info/SOURCES.txt +4 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/__init__.py +23 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/__init__.py +1 -1
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/disk_metrics.py +73 -73
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/edge_orchestration.py +220 -220
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/pick_distance.py +82 -82
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/graph_utils.py +95 -95
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_engine_specs.py +1 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_interaction/bridge.py +180 -180
- tensor_network_visualization-2.0.2/src/tensor_network_viz/_translation_codegen.py +322 -0
- tensor_network_visualization-2.0.2/src/tensor_network_viz/_translation_models.py +41 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/tensor_elements_config.py +308 -308
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/tensorkrowch/renderer.py +17 -17
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/tensornetwork/renderer.py +17 -17
- tensor_network_visualization-2.0.2/src/tensor_network_viz/translation.py +262 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_documentation_gallery.py +107 -107
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_examples.py +134 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_examples_structure.py +10 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_integration_tensornetwork.py +26 -26
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_plotting.py +3766 -3766
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_public_api.py +26 -0
- tensor_network_visualization-2.0.2/tests/test_translation_api.py +300 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/setup.cfg +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_visualization.egg-info/dependency_links.txt +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_visualization.egg-info/requires.txt +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_visualization.egg-info/top_level.txt +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_auto_display.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_contraction_viewer_style.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_contraction_viewer_ui.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/_draw_common.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/_label_format.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/_nodes_edges_common.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/axis_directions.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/contractions.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/curves.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/__init__.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/constants.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/contraction_edges.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/contraction_scheme.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/dangling_self_edges.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/edge_labels.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/edges.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/fonts_and_scale.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/graph_pipeline.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/hover.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/label_descriptors.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/labels_misc.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/plotter.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/plotter_2d.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/plotter_3d.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/plotter_common.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/render_prep.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/scene_state.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/tensors.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/vectors.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/draw/viewport_geometry.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/focus.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/graph.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/graph_cache.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/layout/__init__.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/layout/body.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/layout/direction_common.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/layout/force_directed.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/layout/free_directions_2d.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/layout/free_directions_3d.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/layout/generic_coarsening.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/layout/geometry.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/layout/parameters.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/layout/positions.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/layout/types.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/layout_structure.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/layout_structure_coordinates.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/layout_structure_sparse_grid.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_core/renderer.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_import_state.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_input_inspection.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_interaction/__init__.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_interaction/controller.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_interaction/controls.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_interaction/scheme.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_interaction/state.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_interaction/tensor_inspector.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_interaction/views.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_interactive_scene.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_logging.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_matplotlib_state.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_registry.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_tensor_comparison_support.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_tensor_elements_controller.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_tensor_elements_data.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_tensor_elements_inputs.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_tensor_elements_models.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_tensor_elements_payloads.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_tensor_elements_rendering.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_tensor_elements_support.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_typing.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_ui_utils.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/_widgets.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/config.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/contraction_viewer.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/einsum_module/__init__.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/einsum_module/_backend.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/einsum_module/_equation.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/einsum_module/_trace_state.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/einsum_module/_trace_types.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/einsum_module/contraction_cost.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/einsum_module/graph.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/einsum_module/renderer.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/einsum_module/trace.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/exceptions.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/interactive_viewer.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/py.typed +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/quimb/__init__.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/quimb/graph.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/quimb/renderer.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/snapshot.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/tenpy/__init__.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/tenpy/explicit.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/tenpy/graph.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/tenpy/renderer.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/tensor_comparison.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/tensor_comparison_config.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/tensor_elements.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/tensorkrowch/__init__.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/tensorkrowch/_history.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/tensorkrowch/graph.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/tensornetwork/__init__.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/tensornetwork/graph.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/src/tensor_network_viz/viewer.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_bench_user_workflows.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_ci_workflow.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_contraction_cost.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_contraction_groups_once.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_contraction_scheme.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_contraction_scheme_api.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_contraction_viewer.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_demo_cli_scheme.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_draw_performance.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_edge_index_label_2d.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_edge_index_label_3d.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_einsum_autotrace.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_einsum_backend.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_engine_detection.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_engineering_baseline.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_graph_cache.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_integration_einsum.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_integration_tensorkrowch.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_interaction_controls.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_interaction_state.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_label_draw_metrics_perf.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_label_format.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_layout_core.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_lazy_imports.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_logging_and_exceptions.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_matplotlib_state.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_node_degrees_perf.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_packaging_metadata.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_quimb_backend.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_render_performance_controls.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_show_tensor_network_throughput.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_snapshot_api.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_tenpy_backend.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_tensor_comparison.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_tensor_elements.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.2}/tests/test_tensor_elements_perf.py +0 -0
- {tensor_network_visualization-2.0.1 → tensor_network_visualization-2.0.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: 2.0.
|
|
3
|
+
Version: 2.0.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
|
|
@@ -73,8 +73,7 @@ PyTorch/NumPy `einsum` tensor networks.
|
|
|
73
73
|
|
|
74
74
|
## Gallery
|
|
75
75
|
|
|
76
|
-
These are exports generated with the library and the repository demos.
|
|
77
|
-
transparent PNGs; the controls example keeps its background so the menu stays readable.
|
|
76
|
+
These are exports generated with the library and the repository demos.
|
|
78
77
|
|
|
79
78
|
<p align="center">
|
|
80
79
|
<img
|
|
@@ -124,10 +123,15 @@ The common entry points are:
|
|
|
124
123
|
show_tensor_network(...)
|
|
125
124
|
show_tensor_elements(...)
|
|
126
125
|
show_tensor_comparison(...)
|
|
126
|
+
translate_tensor_network(...)
|
|
127
127
|
normalize_tensor_network(...)
|
|
128
128
|
export_tensor_network_snapshot(...)
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
+
If you want code for another backend rather than a figure, `translate_tensor_network(...)` can turn
|
|
132
|
+
supported TensorKrowch, TensorNetwork, Quimb, TeNPy, and traced `einsum` inputs into executable
|
|
133
|
+
Python for `tensornetwork`, `quimb`, `einsum`, or `tensorkrowch`.
|
|
134
|
+
|
|
131
135
|
## Install
|
|
132
136
|
|
|
133
137
|
- PyPI package name: `tensor-network-visualization`
|
|
@@ -267,6 +271,15 @@ plus three focused groups:
|
|
|
267
271
|
- `geometry`: renders larger irregular, incomplete, triangular, pyramidal, circular, and
|
|
268
272
|
disconnected networks.
|
|
269
273
|
|
|
274
|
+
There is also a dedicated translation demo:
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
python examples/translate_demo.py --source-engine tensornetwork --target-engine quimb --example mps
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
It generates Python code for the translated tensor network and can render the original and
|
|
281
|
+
translated versions side by side for comparison.
|
|
282
|
+
|
|
270
283
|
For batch checks, use:
|
|
271
284
|
|
|
272
285
|
```bash
|
|
@@ -1,77 +1,81 @@
|
|
|
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/)
|
|
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/)
|
|
14
14
|
[](https://opensource.org/licenses/MIT)
|
|
15
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.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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.
|
|
22
|
+
|
|
23
|
+
<p align="center">
|
|
24
|
+
<img
|
|
25
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/cubic_peps_3d.png"
|
|
26
|
+
alt="Cubic PEPS 3D tensor network visualization"
|
|
27
|
+
width="230"
|
|
28
|
+
>
|
|
29
|
+
<img
|
|
30
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/mera_2d.png"
|
|
31
|
+
alt="MERA 2D tensor network visualization with labels"
|
|
32
|
+
width="230"
|
|
33
|
+
>
|
|
34
|
+
<img
|
|
35
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/tubular_grid_3d.png"
|
|
36
|
+
alt="Tubular 3D tensor network visualization"
|
|
37
|
+
width="230"
|
|
38
|
+
>
|
|
39
|
+
</p>
|
|
40
|
+
|
|
41
|
+
<p align="center">
|
|
42
|
+
<img
|
|
43
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/network_controls.png"
|
|
44
|
+
alt="MPS with controls, tensor labels, and index labels"
|
|
45
|
+
width="230"
|
|
46
|
+
>
|
|
47
|
+
<img
|
|
48
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/tensor_elements_phase.png"
|
|
49
|
+
alt="Tensor elements phase visualization"
|
|
50
|
+
width="230"
|
|
51
|
+
>
|
|
52
|
+
<img
|
|
53
|
+
src="https://raw.githubusercontent.com/DOKOS-TAYOS/Tensor-Network-Visualization/main/images/gallery/tensor_elements_controls.png"
|
|
54
|
+
alt="Tensor elements view with the full control menus"
|
|
55
|
+
width="230"
|
|
56
|
+
>
|
|
57
|
+
</p>
|
|
58
|
+
|
|
59
|
+
## Why This Exists
|
|
60
|
+
|
|
61
|
+
Tensor-network libraries expose different Python objects. This package gives them a small shared
|
|
62
|
+
visualization API so you can inspect structure, tensor values, contraction playback, and normalized
|
|
63
|
+
graph exports without rewriting plotting code for every backend.
|
|
64
|
+
|
|
65
|
+
The common entry points are:
|
|
41
66
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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>
|
|
67
|
+
```python
|
|
68
|
+
show_tensor_network(...)
|
|
69
|
+
show_tensor_elements(...)
|
|
70
|
+
show_tensor_comparison(...)
|
|
71
|
+
translate_tensor_network(...)
|
|
72
|
+
normalize_tensor_network(...)
|
|
73
|
+
export_tensor_network_snapshot(...)
|
|
74
|
+
```
|
|
59
75
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
visualization API so you can inspect structure, tensor values, contraction playback, and normalized
|
|
64
|
-
graph exports without rewriting plotting code for every backend.
|
|
65
|
-
|
|
66
|
-
The common entry points are:
|
|
67
|
-
|
|
68
|
-
```python
|
|
69
|
-
show_tensor_network(...)
|
|
70
|
-
show_tensor_elements(...)
|
|
71
|
-
show_tensor_comparison(...)
|
|
72
|
-
normalize_tensor_network(...)
|
|
73
|
-
export_tensor_network_snapshot(...)
|
|
74
|
-
```
|
|
76
|
+
If you want code for another backend rather than a figure, `translate_tensor_network(...)` can turn
|
|
77
|
+
supported TensorKrowch, TensorNetwork, Quimb, TeNPy, and traced `einsum` inputs into executable
|
|
78
|
+
Python for `tensornetwork`, `quimb`, `einsum`, or `tensorkrowch`.
|
|
75
79
|
|
|
76
80
|
## Install
|
|
77
81
|
|
|
@@ -203,16 +207,25 @@ python examples/run_demo.py <group> <demo>
|
|
|
203
207
|
|
|
204
208
|
The gallery includes backend demos for TensorKrowch, TensorNetwork, Quimb, TeNPy, and `einsum`,
|
|
205
209
|
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.
|
|
210
|
+
|
|
211
|
+
- `themes overview`: compares the `PlotConfig` visual presets for tensor-network figures.
|
|
212
|
+
- `themes tensor_elements`: compares the `TensorElementsConfig` presets for `show_tensor_elements(...)`
|
|
213
|
+
and the linked tensor inspector.
|
|
214
|
+
- `placements`: shows object, list, 2D grid, 3D grid, manual positions, manual schemes, and named
|
|
215
|
+
index inputs.
|
|
212
216
|
- `geometry`: renders larger irregular, incomplete, triangular, pyramidal, circular, and
|
|
213
217
|
disconnected networks.
|
|
214
|
-
|
|
215
|
-
|
|
218
|
+
|
|
219
|
+
There is also a dedicated translation demo:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
python examples/translate_demo.py --source-engine tensornetwork --target-engine quimb --example mps
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
It generates Python code for the translated tensor network and can render the original and
|
|
226
|
+
translated versions side by side for comparison.
|
|
227
|
+
|
|
228
|
+
For batch checks, use:
|
|
216
229
|
|
|
217
230
|
```bash
|
|
218
231
|
python examples/run_all_examples.py --group engines --views 2d --list
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tensor-network-visualization"
|
|
7
|
-
version = "2.0.
|
|
7
|
+
version = "2.0.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: 2.0.
|
|
3
|
+
Version: 2.0.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
|
|
@@ -73,8 +73,7 @@ PyTorch/NumPy `einsum` tensor networks.
|
|
|
73
73
|
|
|
74
74
|
## Gallery
|
|
75
75
|
|
|
76
|
-
These are exports generated with the library and the repository demos.
|
|
77
|
-
transparent PNGs; the controls example keeps its background so the menu stays readable.
|
|
76
|
+
These are exports generated with the library and the repository demos.
|
|
78
77
|
|
|
79
78
|
<p align="center">
|
|
80
79
|
<img
|
|
@@ -124,10 +123,15 @@ The common entry points are:
|
|
|
124
123
|
show_tensor_network(...)
|
|
125
124
|
show_tensor_elements(...)
|
|
126
125
|
show_tensor_comparison(...)
|
|
126
|
+
translate_tensor_network(...)
|
|
127
127
|
normalize_tensor_network(...)
|
|
128
128
|
export_tensor_network_snapshot(...)
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
+
If you want code for another backend rather than a figure, `translate_tensor_network(...)` can turn
|
|
132
|
+
supported TensorKrowch, TensorNetwork, Quimb, TeNPy, and traced `einsum` inputs into executable
|
|
133
|
+
Python for `tensornetwork`, `quimb`, `einsum`, or `tensorkrowch`.
|
|
134
|
+
|
|
131
135
|
## Install
|
|
132
136
|
|
|
133
137
|
- PyPI package name: `tensor-network-visualization`
|
|
@@ -267,6 +271,15 @@ plus three focused groups:
|
|
|
267
271
|
- `geometry`: renders larger irregular, incomplete, triangular, pyramidal, circular, and
|
|
268
272
|
disconnected networks.
|
|
269
273
|
|
|
274
|
+
There is also a dedicated translation demo:
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
python examples/translate_demo.py --source-engine tensornetwork --target-engine quimb --example mps
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
It generates Python code for the translated tensor network and can render the original and
|
|
281
|
+
translated versions side by side for comparison.
|
|
282
|
+
|
|
270
283
|
For batch checks, use:
|
|
271
284
|
|
|
272
285
|
```bash
|
|
@@ -25,6 +25,8 @@ src/tensor_network_viz/_tensor_elements_models.py
|
|
|
25
25
|
src/tensor_network_viz/_tensor_elements_payloads.py
|
|
26
26
|
src/tensor_network_viz/_tensor_elements_rendering.py
|
|
27
27
|
src/tensor_network_viz/_tensor_elements_support.py
|
|
28
|
+
src/tensor_network_viz/_translation_codegen.py
|
|
29
|
+
src/tensor_network_viz/_translation_models.py
|
|
28
30
|
src/tensor_network_viz/_typing.py
|
|
29
31
|
src/tensor_network_viz/_ui_utils.py
|
|
30
32
|
src/tensor_network_viz/_widgets.py
|
|
@@ -38,6 +40,7 @@ src/tensor_network_viz/tensor_comparison.py
|
|
|
38
40
|
src/tensor_network_viz/tensor_comparison_config.py
|
|
39
41
|
src/tensor_network_viz/tensor_elements.py
|
|
40
42
|
src/tensor_network_viz/tensor_elements_config.py
|
|
43
|
+
src/tensor_network_viz/translation.py
|
|
41
44
|
src/tensor_network_viz/viewer.py
|
|
42
45
|
src/tensor_network_viz/_core/__init__.py
|
|
43
46
|
src/tensor_network_viz/_core/_draw_common.py
|
|
@@ -162,4 +165,5 @@ tests/test_tenpy_backend.py
|
|
|
162
165
|
tests/test_tensor_comparison.py
|
|
163
166
|
tests/test_tensor_elements.py
|
|
164
167
|
tests/test_tensor_elements_perf.py
|
|
168
|
+
tests/test_translation_api.py
|
|
165
169
|
tests/test_verify_script.py
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from importlib import import_module
|
|
6
|
+
from os import PathLike
|
|
6
7
|
from typing import TYPE_CHECKING, Any
|
|
7
8
|
|
|
8
9
|
from . import _logging as _package_logging
|
|
@@ -19,6 +20,7 @@ if TYPE_CHECKING:
|
|
|
19
20
|
PlotTheme,
|
|
20
21
|
TensorNetworkDiagnosticsConfig,
|
|
21
22
|
TensorNetworkFocus,
|
|
23
|
+
TranslationTargetName,
|
|
22
24
|
ViewName,
|
|
23
25
|
)
|
|
24
26
|
from .contraction_viewer import ContractionViewer2D, ContractionViewer3D
|
|
@@ -53,6 +55,7 @@ if TYPE_CHECKING:
|
|
|
53
55
|
TensorElementsConfig,
|
|
54
56
|
TensorElementsTheme,
|
|
55
57
|
)
|
|
58
|
+
from .translation import translate_tensor_network
|
|
56
59
|
from .viewer import show_tensor_network
|
|
57
60
|
else:
|
|
58
61
|
|
|
@@ -152,6 +155,23 @@ else:
|
|
|
152
155
|
show=show,
|
|
153
156
|
)
|
|
154
157
|
|
|
158
|
+
def translate_tensor_network(
|
|
159
|
+
network: Any,
|
|
160
|
+
*,
|
|
161
|
+
engine: EngineName | None = None,
|
|
162
|
+
target_engine: TranslationTargetName,
|
|
163
|
+
path: str | PathLike[str] | None = None,
|
|
164
|
+
) -> str:
|
|
165
|
+
"""Lazily dispatch to :func:`tensor_network_viz.translation.translate_tensor_network`."""
|
|
166
|
+
from .translation import translate_tensor_network as _translate_tensor_network
|
|
167
|
+
|
|
168
|
+
return _translate_tensor_network(
|
|
169
|
+
network,
|
|
170
|
+
engine=engine,
|
|
171
|
+
target_engine=target_engine,
|
|
172
|
+
path=path,
|
|
173
|
+
)
|
|
174
|
+
|
|
155
175
|
|
|
156
176
|
_LAZY_EXPORTS: dict[str, tuple[str, str]] = {
|
|
157
177
|
"AxisConfigurationError": (".exceptions", "AxisConfigurationError"),
|
|
@@ -167,6 +187,7 @@ _LAZY_EXPORTS: dict[str, tuple[str, str]] = {
|
|
|
167
187
|
"NormalizedTensorNode": (".snapshot", "NormalizedTensorNode"),
|
|
168
188
|
"PlotConfig": (".config", "PlotConfig"),
|
|
169
189
|
"PlotTheme": (".config", "PlotTheme"),
|
|
190
|
+
"TranslationTargetName": ("._engine_specs", "TranslationTargetName"),
|
|
170
191
|
"TenPyTensorNetwork": (".tenpy.explicit", "TenPyTensorNetwork"),
|
|
171
192
|
"TensorComparisonConfig": (".tensor_comparison_config", "TensorComparisonConfig"),
|
|
172
193
|
"TensorAnalysisConfig": (".tensor_elements_config", "TensorAnalysisConfig"),
|
|
@@ -222,6 +243,7 @@ __all__ = [
|
|
|
222
243
|
"NormalizedTensorNode",
|
|
223
244
|
"PlotConfig",
|
|
224
245
|
"PlotTheme",
|
|
246
|
+
"TranslationTargetName",
|
|
225
247
|
"TensorComparisonConfig",
|
|
226
248
|
"TensorAnalysisConfig",
|
|
227
249
|
"TensorDataError",
|
|
@@ -248,6 +270,7 @@ __all__ = [
|
|
|
248
270
|
"show_tensor_comparison",
|
|
249
271
|
"show_tensor_elements",
|
|
250
272
|
"show_tensor_network",
|
|
273
|
+
"translate_tensor_network",
|
|
251
274
|
]
|
|
252
275
|
|
|
253
276
|
_ = _package_logging
|
|
@@ -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
|
+
]
|