How josquantum/hyvis works
Project type and purpose
• This is a Python‑based visualization library (“hyvis”) for exploring and rendering high‑dimensional function landscapes (especially quantum‑classical hybrid systems).
• It ships as a pip‑installable package, provides core modules, and includes example Jupyter notebooks demonstrating its features.
File structure
• Top‑level folders and files:
• src/hyvis/ ← core Python modules
• notebooks/ ← Jupyter notebooks for demos
• pictures/ ← sample output images/gifs
• dist/ ← built distribution artifacts (wheel, sdist)
• pyproject.toml ← packaging/metadata configuration
• README.md, LICENSE ← documentation & legal
• No separate “frontend/backend” layers—this is a library supporting both computation and visualization.
• Key modules:
• dr_tools.py ← tools for defining affine linear subspaces
• native_landscapes.py ← landscape scanning & Hessian calculations
• video_scans.py ← video generation of trajectories
• Packaging pipeline: pyproject.toml → build → dist/
README for additional insights
• Features: subspace creation, scanning, Hessian‑based visualization, video output.
• Dependencies (implicit): numpy, matplotlib (for plotting), moviepy or ffmpeg (for GIF/video).
• Usage model: users write code or open notebooks that import hyvis.* functions.
a. Main components
1. User Layer
• Jupyter notebooks & user scripts
2. hyvis Core Library
• dr_tools module
• native_landscapes module
• video_scans module
3. Visualization Engine
• matplotlib (plots)
• moviepy/ffmpeg (animations)
4. Packaging/Distribution
• pyproject.toml build process
• dist artifacts on PyPI
b. Relationships and interactions
• Notebooks & scripts → import → hyvis core modules
• dr_tools → supplies subspace definitions → native_landscapes
• native_landscapes → computes scans/Hessians → passes data to video_scans or plotting
• video_scans → invokes external video library → produces .gif/.mp4
• Packaging tool → reads pyproject.toml → outputs wheel & sdist → deployed to PyPI
c. Architectural patterns & principles
• Modular library design: each major feature lives in its own module
• Separation of concerns: computation (landscapes) vs. visualization vs. packaging
• Demonstration layer (notebooks) decoupled from core logic
d. Key technologies/frameworks
• Python
• NumPy (numerical arrays)
• Matplotlib (2D/3D plots)
• MoviePy/FFmpeg (video)
• setuptools/poetry (packaging via pyproject.toml)