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.
Files changed (168) hide show
  1. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/LICENSE +21 -21
  2. {tensor_network_visualization-1.6.3/src/tensor_network_visualization.egg-info → tensor_network_visualization-2.0.1}/PKG-INFO +58 -3
  3. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/README.md +72 -21
  4. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/pyproject.toml +6 -2
  5. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1/src/tensor_network_visualization.egg-info}/PKG-INFO +58 -3
  6. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_visualization.egg-info/SOURCES.txt +1 -0
  7. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_visualization.egg-info/requires.txt +1 -1
  8. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/__init__.py +7 -1
  9. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/__init__.py +1 -1
  10. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/disk_metrics.py +73 -73
  11. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/edge_orchestration.py +220 -220
  12. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/fonts_and_scale.py +100 -12
  13. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/graph_pipeline.py +2 -1
  14. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/pick_distance.py +82 -82
  15. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/graph_utils.py +95 -95
  16. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/direction_common.py +10 -2
  17. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/force_directed.py +247 -247
  18. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/free_directions_2d.py +38 -23
  19. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/free_directions_3d.py +13 -7
  20. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/generic_coarsening.py +65 -2
  21. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/positions.py +97 -31
  22. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout_structure.py +153 -10
  23. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_interaction/bridge.py +180 -167
  24. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_interaction/controller.py +76 -0
  25. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_interaction/tensor_inspector.py +35 -1
  26. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_interactive_scene.py +1 -1
  27. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_matplotlib_state.py +4 -0
  28. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_tensor_elements_controller.py +192 -7
  29. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_tensor_elements_rendering.py +32 -17
  30. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/config.py +7 -1
  31. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/einsum_module/contraction_cost.py +2 -2
  32. tensor_network_visualization-2.0.1/src/tensor_network_viz/tensor_elements_config.py +308 -0
  33. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensorkrowch/renderer.py +17 -17
  34. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensornetwork/renderer.py +17 -17
  35. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/viewer.py +28 -5
  36. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_bench_user_workflows.py +246 -246
  37. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_contraction_cost.py +3 -3
  38. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_contraction_viewer.py +4 -4
  39. tensor_network_visualization-2.0.1/tests/test_documentation_gallery.py +107 -0
  40. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_einsum_backend.py +6 -4
  41. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_examples.py +173 -2
  42. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_integration_tensornetwork.py +26 -26
  43. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_layout_core.py +210 -10
  44. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_packaging_metadata.py +7 -1
  45. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_plotting.py +3766 -3514
  46. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_public_api.py +158 -0
  47. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_tensor_elements.py +329 -1
  48. tensor_network_visualization-1.6.3/src/tensor_network_viz/tensor_elements_config.py +0 -148
  49. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/setup.cfg +0 -0
  50. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_visualization.egg-info/dependency_links.txt +0 -0
  51. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_visualization.egg-info/top_level.txt +0 -0
  52. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_auto_display.py +0 -0
  53. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_contraction_viewer_style.py +0 -0
  54. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_contraction_viewer_ui.py +0 -0
  55. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/_draw_common.py +0 -0
  56. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/_label_format.py +0 -0
  57. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/_nodes_edges_common.py +0 -0
  58. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/axis_directions.py +0 -0
  59. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/contractions.py +0 -0
  60. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/curves.py +0 -0
  61. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/__init__.py +0 -0
  62. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/constants.py +0 -0
  63. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/contraction_edges.py +0 -0
  64. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/contraction_scheme.py +0 -0
  65. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/dangling_self_edges.py +0 -0
  66. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/edge_labels.py +0 -0
  67. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/edges.py +0 -0
  68. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/hover.py +0 -0
  69. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/label_descriptors.py +0 -0
  70. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/labels_misc.py +0 -0
  71. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/plotter.py +0 -0
  72. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/plotter_2d.py +0 -0
  73. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/plotter_3d.py +0 -0
  74. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/plotter_common.py +0 -0
  75. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/render_prep.py +0 -0
  76. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/scene_state.py +0 -0
  77. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/tensors.py +0 -0
  78. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/vectors.py +0 -0
  79. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/draw/viewport_geometry.py +0 -0
  80. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/focus.py +0 -0
  81. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/graph.py +0 -0
  82. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/graph_cache.py +0 -0
  83. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/__init__.py +0 -0
  84. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/body.py +0 -0
  85. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/geometry.py +0 -0
  86. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/parameters.py +0 -0
  87. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout/types.py +0 -0
  88. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout_structure_coordinates.py +0 -0
  89. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/layout_structure_sparse_grid.py +0 -0
  90. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_core/renderer.py +0 -0
  91. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_engine_specs.py +0 -0
  92. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_import_state.py +0 -0
  93. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_input_inspection.py +0 -0
  94. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_interaction/__init__.py +0 -0
  95. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_interaction/controls.py +0 -0
  96. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_interaction/scheme.py +0 -0
  97. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_interaction/state.py +0 -0
  98. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_interaction/views.py +0 -0
  99. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_logging.py +0 -0
  100. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_registry.py +0 -0
  101. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_tensor_comparison_support.py +0 -0
  102. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_tensor_elements_data.py +0 -0
  103. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_tensor_elements_inputs.py +0 -0
  104. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_tensor_elements_models.py +0 -0
  105. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_tensor_elements_payloads.py +0 -0
  106. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_tensor_elements_support.py +0 -0
  107. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_typing.py +0 -0
  108. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_ui_utils.py +0 -0
  109. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/_widgets.py +0 -0
  110. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/contraction_viewer.py +0 -0
  111. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/einsum_module/__init__.py +0 -0
  112. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/einsum_module/_backend.py +0 -0
  113. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/einsum_module/_equation.py +0 -0
  114. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/einsum_module/_trace_state.py +0 -0
  115. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/einsum_module/_trace_types.py +0 -0
  116. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/einsum_module/graph.py +0 -0
  117. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/einsum_module/renderer.py +0 -0
  118. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/einsum_module/trace.py +0 -0
  119. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/exceptions.py +0 -0
  120. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/interactive_viewer.py +0 -0
  121. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/py.typed +0 -0
  122. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/quimb/__init__.py +0 -0
  123. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/quimb/graph.py +0 -0
  124. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/quimb/renderer.py +0 -0
  125. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/snapshot.py +0 -0
  126. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tenpy/__init__.py +0 -0
  127. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tenpy/explicit.py +0 -0
  128. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tenpy/graph.py +0 -0
  129. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tenpy/renderer.py +0 -0
  130. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensor_comparison.py +0 -0
  131. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensor_comparison_config.py +0 -0
  132. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensor_elements.py +0 -0
  133. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensorkrowch/__init__.py +0 -0
  134. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensorkrowch/_history.py +0 -0
  135. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensorkrowch/graph.py +0 -0
  136. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensornetwork/__init__.py +0 -0
  137. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/src/tensor_network_viz/tensornetwork/graph.py +0 -0
  138. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_ci_workflow.py +0 -0
  139. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_contraction_groups_once.py +0 -0
  140. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_contraction_scheme.py +0 -0
  141. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_contraction_scheme_api.py +0 -0
  142. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_demo_cli_scheme.py +0 -0
  143. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_draw_performance.py +0 -0
  144. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_edge_index_label_2d.py +0 -0
  145. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_edge_index_label_3d.py +0 -0
  146. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_einsum_autotrace.py +0 -0
  147. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_engine_detection.py +0 -0
  148. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_engineering_baseline.py +0 -0
  149. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_examples_structure.py +0 -0
  150. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_graph_cache.py +0 -0
  151. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_integration_einsum.py +0 -0
  152. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_integration_tensorkrowch.py +0 -0
  153. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_interaction_controls.py +0 -0
  154. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_interaction_state.py +0 -0
  155. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_label_draw_metrics_perf.py +0 -0
  156. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_label_format.py +0 -0
  157. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_lazy_imports.py +0 -0
  158. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_logging_and_exceptions.py +0 -0
  159. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_matplotlib_state.py +0 -0
  160. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_node_degrees_perf.py +0 -0
  161. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_quimb_backend.py +0 -0
  162. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_render_performance_controls.py +0 -0
  163. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_show_tensor_network_throughput.py +0 -0
  164. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_snapshot_api.py +0 -0
  165. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_tenpy_backend.py +0 -0
  166. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_tensor_comparison.py +0 -0
  167. {tensor_network_visualization-1.6.3 → tensor_network_visualization-2.0.1}/tests/test_tensor_elements_perf.py +0 -0
  168. {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: 1.6.3
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
  [![CI](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/actions/workflows/ci.yml/badge.svg)](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 `default`, `paper`, and `colorblind` visual modes.
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
- # Tensor-Network-Visualization
2
-
3
- [![CI](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/actions/workflows/ci.yml/badge.svg)](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/actions/workflows/ci.yml)
4
- [![PyPI version](https://img.shields.io/pypi/v/tensor-network-visualization.svg)](https://pypi.org/project/tensor-network-visualization/)
5
- [![Python versions](https://img.shields.io/pypi/pyversions/tensor-network-visualization.svg)](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
+ [![CI](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/actions/workflows/ci.yml/badge.svg)](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/actions/workflows/ci.yml)
12
+ [![PyPI version](https://img.shields.io/pypi/v/tensor-network-visualization.svg)](https://pypi.org/project/tensor-network-visualization/)
13
+ [![Python versions](https://img.shields.io/pypi/pyversions/tensor-network-visualization.svg)](https://pypi.org/project/tensor-network-visualization/)
6
14
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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
- ## Why This Exists
12
-
13
- Tensor-network libraries expose different Python objects. This package gives them a small shared
14
- visualization API so you can inspect structure, tensor values, contraction playback, and normalized
15
- graph exports without rewriting plotting code for every backend.
16
+ 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 `default`, `paper`, and `colorblind` visual modes.
159
- - `placements`: shows object, list, 2D grid, 3D grid, manual positions, manual schemes, and named
160
- index inputs.
161
- - `geometry`: renders larger irregular, incomplete, triangular, pyramidal, circular, and
162
- disconnected networks.
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 = "1.6.3"
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: 1.6.3
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
  [![CI](https://github.com/DOKOS-TAYOS/Tensor-Network-Visualization/actions/workflows/ci.yml/badge.svg)](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 `default`, `paper`, and `colorblind` visual modes.
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
@@ -1,6 +1,6 @@
1
1
  matplotlib>=3.7
2
2
  networkx>=3.0
3
- numpy
3
+ numpy>=2.0
4
4
 
5
5
  [dev]
6
6
  build
@@ -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 TensorAnalysisConfig, TensorElementsConfig
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
+ ]