Jupyter Integration
Energy Language provides IPython magics and interactive widgets for Jupyter notebooks.
Setup
bash
pip install qriton-hlm[jupyter]python
%load_ext qriton_hlm.jupyterMagics
%hlm_load — Load a checkpoint
python
surgeon = %hlm_load model.ptThis creates a surgeon variable in your notebook namespace.
%hlm — Run a single command
python
%hlm survey 0
%hlm inject 0 42 0.1
%hlm verify 0 42%%hlm — Run multiple commands
python
%%hlm
capture 5 polite Thank you so much
capture 5 polite I really appreciate it
inject-concept 5 polite 0.1
apply 5%hlm_survey — Survey with visualization
python
%hlm_survey 0Renders an interactive Plotly chart showing basin energies and populations.
%hlm_landscape — Full landscape visualization
python
%hlm_landscape 0Shows a 2D PCA projection of basin locations with energy coloring.
%hlm_concepts — Visualize concept space
python
%hlm_conceptsPCA projection of all captured concepts and their centroids.
Interactive Widget
python
from qriton_hlm.jupyter import basin_explorer
basin_explorer(surgeon, layer=0)Provides layer/inits sliders with a survey button for interactive exploration.
Visualization Functions
Available for custom notebooks:
python
from qriton_hlm.jupyter import (
plot_landscape, # Basin energy + population bars
plot_landscape_2d, # PCA projection
plot_surgery_diff, # Before/after comparison
plot_convergence, # Energy over iterations
plot_concept_space, # Concept PCA visualization
)Notebooks
Five progressive tutorials are included in the Jupyter/ directory:
| Notebook | Topic |
|---|---|
01_quickstart | Survey, inject, verify — synthetic W |
02_concept_surgery | Capture, inject, blend concepts |
03_landscape_visualization | Interactive Plotly plots |
04_model_comparison | Compare models, transplant concepts |
05_hlm_scripts | IPython magics, .hlm scripts |