B&S2026 Figure 2 Trilinos-side eigenvalues

User

Please start work on TASK-023.

Assistant

Started TASK-023 and assigned it to @pi.

Current implementation plan is already recorded on the task:

  1. Inspect LOCA C++ model, Sacado residual Jacobian path, CMake/Trilinos configuration, and Teuchos availability.
  2. Add separate C++ physical vector-field function matching Python physical ODE RHS.
  3. Add Sacado physical Jacobian path with respect to physical (n, q, s).
  4. Implement backend dense eigenvalue computation via Teuchos::LAPACK GEEV, documenting fallback if needed.
  5. Extend Figure 2 LOCA output with canonical physical eigenvalues/regime/stability and separate Jacobian diagnostics.
  6. Add tests comparing LOCA Jacobian/eigenvalues to Python reference and smoke-test output schema/range.
Show remaining 2 lines

Please confirm this plan, and I’ll proceed with implementation.

User

Go ahead (remember that the Trilinos CMake settings are in loca/CMakeLists.txt).

Assistant

Completed TASK-023 and marked it Done.

Changed:

  • loca/include/bergner_spichtinger_2026_loca/model.hpp
  • Added separate physical vector field.
  • Added Sacado physical Jacobian for (n, q, s).
  • loca/src/model_cli.cpp
  • Added physical-rhs, physical-jacobian, and eigenvalues CLI commands.
  • Added Teuchos::LAPACK GEEV eigenvalue workflow.
  • Added canonical eigenvalue ordering, regime, and stability classification.
Show remaining 11 lines
  • episodes/005-figure2-eigenvalues/scripts/run_loca_figure2_eigenvalues.py
  • New LOCA Figure 2 orchestration script.
  • Writes dense 400+ point branch/eigenvalue outputs and separate physical-Jacobian diagnostics.
  • Tests:
  • tests/test_loca_model_core.py
  • tests/test_episode5_loca_figure2.py

Validation:

  • uv run pytest -q
  • Result: 70 passed, 1 warning

Warning is the existing Python Figure 2 overflow RuntimeWarning during continuation probing.

User

There is no output from the LOCA code yet. Is that intentional?

Assistant

Not intentional as a final state — I had only smoke-tested the LOCA output under [REDACTED_TEMP_PATH], not written the episode-local outputs.

I’ve now run the default LOCA Figure 2 script. Outputs are at:

episodes/005-figure2-eigenvalues/outputs/figure2_loca_eigenvalues/

Files:

  • loca_figure2_branch_points.csv
  • loca_figure2_eigenvalues.csv
  • loca_figure2_physical_jacobian_diagnostics.csv
Show remaining 6 lines
  • loca_figure2_summary.json
  • run_metadata.json
  • raw/bs2026_loca_figure2_raw.csv
  • raw/bs2026_loca_figure2.stderr.txt

The warning during generation is the same existing Python-side overflow warning from initial equilibrium probing, not a LOCA failure.

User

Can you generate plots for the AUTO and LOCA outputs like you did for the Python version?

Assistant

Yes — generated them.

New plots:

  • episodes/005-figure2-eigenvalues/outputs/figure2_auto_eigenvalues/auto_figure2_eigenvalues.png
  • episodes/005-figure2-eigenvalues/outputs/figure2_loca_eigenvalues/loca_figure2_eigenvalues.png

I also added a reusable plotting script:

  • episodes/005-figure2-eigenvalues/scripts/plot_figure2_eigenvalue_outputs.py

Usage:

Show remaining 6 lines
uv run python episodes/005-figure2-eigenvalues/scripts/plot_figure2_eigenvalue_outputs.py auto
uv run python episodes/005-figure2-eigenvalues/scripts/plot_figure2_eigenvalue_outputs.py loca

It uses the same Figure 2-style real/imag tracked-eigenvalue layout as the Python plot.

User

OK, good. Please commit the changes.

Assistant

Committed changes.

Commit:

  • f79e1a4 Implement LOCA Figure 2 eigenvalue workflow

Working tree is clean.