Interactive visualization of the Weierstrass β function running entirely in your browser
π Try it now: https://litlfred.github.io/notebooks/
- Zero Installation: Works immediately in any modern web browser
- Powered by Pyodide: Full Python + NumPy + Matplotlib running via WebAssembly
- Mobile Friendly: Responsive design works on phones and tablets
- Dynamic Visualizations: Re-renders when browser is resized
- Interactive parameter controls with real-time visual feedback
- Multiple visualization modes: Two-panel, three-panel, and five-panel layouts
- Particle trajectory integration following z''(t) = -β(z(t)) * z(t)
- Lattice trajectory visualization option for exploring periodic structure
- Dynamic rendering with visual indicators during re-computation
- PNG export functionality for high-quality visualizations
- Comprehensive help system with mathematical background
The Weierstrass β function is implemented using a truncated lattice sum:
β(z) = 1/zΒ² + Ξ£[1/(z-Ο)Β² - 1/ΟΒ²]
where the sum runs over non-zero lattice points Ο β Ξ = β€p + β€iq within truncation bound N.
Particle trajectories follow the second-order differential equation: z''(t) = -β(z(t)) * z(t)
Integration uses RK4 method with automatic blow-up detection near poles.
- Visit https://litlfred.github.io/notebooks/
- Wait for Pyodide to load (~30 seconds first time)
- Try default settings: p=11, q=5, N=3
- Click "Render" to generate visualization
- Experiment with different particles: zβ =
5+2j
, vβ =0+1j
- Resize your browser window to see dynamic re-rendering
This repository contains a comprehensive widget framework for interactive mathematical computing:
βββ src/weierstrass_playground/ # Main Python package
β βββ __init__.py # Package initialization
β βββ core.py # Core mathematical functions
β βββ visualization.py # Visualization and plotting
β βββ integration.py # Trajectory integration and ODEs
β βββ browser.py # Browser-specific adaptations
βββ docs/ # Widget framework & GitHub Pages
β βββ index.html # Main web interface
β βββ schema/ # Widget Schema & JSON-LD Framework
β β βββ weierstrass/ # Weierstrass β function widgets
β β βββ pq-torus/ # Prime lattice torus widgets
β β βββ sticky-note/ # Markdown note widgets
β β βββ common/ # Shared schemas
β β βββ ontology/ # JSON-LD contexts
β β βββ README.md # Schema documentation
β βββ weierstrass-playground/ # Interactive blackboard system
β β βββ board.html # β Weierstrass Playground interface
β β βββ widgets/ # Widget implementations
β β βββ widget-schemas.json # Widget registry
β βββ widget-framework.md # Complete framework documentation
β βββ json-schema-specification.md # Schema specifications
β βββ architecture-examples.md # Implementation examples
β βββ migration-guide.md # Migration strategy
βββ legacy/ # Legacy implementations (migrated to libraries/)
β βββ weierstrass_lib.py # β libraries/pq-torus/weierstrass_math.py
β βββ weierstrass_ui.py # β modern widget system
β βββ weierstrass_preamble.py # β setup documentation
β βββ weierstrass_playground.ipynb # β JSON-LD notebooks
βββ setup.py & pyproject.toml # Package configuration
βββ requirements.txt # Dependencies
The repository includes a complete production-ready widget framework for building interactive mathematical computing environments:
- π― Schema-Based Design: JSON Schema validation with named, reusable schemas hosted on GitHub Pages
- π JSON-LD & PROV-O Integration: Full provenance tracking for computational workflows and mathematical dependencies
- π§© Visual Programming Interface: Drag-and-drop widget blackboard with dependency management between widgets
- π Mathematical Focus: Specialized widgets for computational mathematics (lattice theory, complex analysis, etc.)
- π Zero-Install Deployment: All schemas accessible via HTTPS URLs, works entirely in browser via Pyodide
- π Extensible Architecture: Six-file schema pattern (input/output/widget Γ JSON Schema/JSON-LD) for easy widget development
The framework provides several specialized mathematical widgets:
- π Sticky Note: Markdown content widgets with LaTeX support for mathematical annotations
- π΄ PQ-Torus: Prime lattice torus definition widgets (T = β / L where L = β€p + β€qi) for complex analysis
- β Weierstrass Functions: β(z) visualization and analysis widgets for elliptic function theory
- π Python Code: Interactive code execution widgets with full NumPy/Matplotlib support
- π Data Visualization: Advanced plotting and data generation widgets with real-time updates
The framework supports sophisticated mathematical workflows through widget dependencies and provenance tracking:
graph LR
A[PQ-Torus Widget] --> B[Weierstrass Widget]
B --> C[Visualization Widget]
D[Sticky Note] --> B
B --> E[Python Code Widget]
Example Mathematical Pipeline:
- PQ-Torus Widget: Define prime lattice parameters (p=11, q=5)
- Weierstrass Widget: Use parameters for β-function computation with lattice Ξ = β€p + β€qi
- Visualization Widget: Generate complex plane visualizations with particle trajectories
- Python Code Widget: Custom analysis or parameter exploration
Each widget interaction is tracked via PROV-O provenance graphs, enabling reproducible mathematical workflows.
π Try the widget framework: https://litlfred.github.io/notebooks/weierstrass-playground/board.html
This repository implements a dual-system architecture combining traditional Jupyter notebooks with an advanced widget framework:
Four-File Pattern: Each notebook follows a modular architecture for maintainability and reusability:
notebook_name.ipynb # MINIMAL notebook (imports + UI display only)
notebook_name_lib.py # Mathematical/computational logic
notebook_name_ui.py # UI widgets and layout code
notebook_name_preamble.py # Documentation and setup (optional)
Key Benefits:
- Separation of Concerns: Math logic separated from UI code
- Reusable Components: Library functions can be imported by other notebooks
- Clean Notebooks: Jupyter files contain only essential display code
- Testable Code: Mathematical functions can be unit tested independently
Schema-Driven Architecture: Production-ready system for building complex mathematical workflows:
docs/schema/{widget-name}/
βββ input.schema.json # JSON Schema for input validation
βββ input.jsonld # JSON-LD context for semantic web
βββ output.schema.json # JSON Schema for output validation
βββ output.jsonld # JSON-LD context for provenance
βββ widget.schema.json # Widget instance configuration
βββ widget.jsonld # Widget semantic definition
Key Features:
- GitHub Pages Integration: All schemas served as HTTPS URLs
- PROV-O Compliance: Full provenance tracking for computational workflows
- Dependency Management: Widgets can consume outputs from other widgets
- Type Safety: JSON Schema validation for all inputs and outputs
Both systems work together seamlessly:
- Notebooks provide exploratory mathematical environments
- Widget Framework enables building reusable, shareable mathematical tools
- Shared Libraries: Common mathematical functions used by both systems
- Browser Deployment: Both run entirely in browser via Pyodide + WebAssembly
Install the Python package locally:
# Development installation
pip install -e .
# Or install from PyPI (when published)
pip install weierstrass-playground
import weierstrass_playground as wp
# Basic function evaluation
z = 2.0 + 1.5j
p, q, N = 11.0, 5.0, 3
wp_val = wp.wp_rect(z, p, q, N)
# Create visualization
fig = wp.browser.create_complete_visualization(
mode='two_panel', p=p, q=q, N=N,
nx=100, ny=100, particles=[(5+0j, 0+1j)],
# ... other parameters
)
For local development and contributions:
# Clone repository
git clone https://github.com/litlfred/notebooks.git
cd notebooks
# Install dependencies
pip install -r requirements.txt
# Run local development server
cd docs
python -m http.server 8000
# Visit http://localhost:8000
CONTRIBUTING.md
- Complete contribution workflow, branch naming conventions, and development standards.github/copilot-instructions.md
- AI agent and Copilot-specific guidelinesdocs/widget-overview.md
- Comprehensive widget framework documentationdocs/schema/README.md
- JSON Schema and JSON-LD technical specifications
For detailed technical information, see the comprehensive documentation linked above. The repository maintains high code quality standards with extensive testing, modular architecture, and clear separation between mathematical logic, UI components, and configuration.