rom-operator-inference-Python3 icon indicating copy to clipboard operation
rom-operator-inference-Python3 copied to clipboard

Hamiltonian Operator Inference

Open shanemcq18 opened this issue 2 years ago • 1 comments

New feature: Hamiltonian Operator Inference from the paper Hamiltonian operator inference: Physics-preserving learning of reduced-order models for canonical Hamiltonian systems by Harsh Sharma (@harsh5332392), Zhu Wang, and Boris Kramer (@bokramer). The goal is to use Operator Inference for a canonical Hamiltonian system to learn a ROM that

  1. is a canonical Hamiltonian system;
  2. retains the physical interpretation of the state variables and preserves the coupling structure; and
  3. respects the symmetric property of structure-preserving space discretizations.

@harsh5332392 will take the lead on this. To begin, the main steps will be creating a SymplecticBasis class (cotangent lift algorithm) and a HamiltonianModel class that does the constrained optimization in fit() and symplectic integration in predict().

Suggested implementation steps:

Basis

  • [ ] Create a new file, /src/opinf/basis/_symplectic.py
  • [ ] Write a SymplecticBasis class that inherits from opinf.basis.LinearBasis and implement fit(). Or, you might be able to do this quickly by inheriting from the PODBasisMulti class, which represents a block diagonal POD (one POD for each variable).
  • [ ] Import the new class in /src/opinf/basis/__init__.py.
  • [ ] Write and run tests for the new classes in a new file /tests/basis/test_symplectic.py.
  • [ ] Compile the docs (make docs) and check that the automatically generated documentation page looks good.
  • [ ] If possible, write a short section about this class in docs/source/guides/reduction.md. We should probably turn this into a notebook that shows the different kinds of basis functions you get from POD and the symplectic approach.

Model Class

  • [ ] Create a new file, /src/opinf/models/multi/_hamiltonian.py.
  • [ ] Write a HamiltonianModel class in the new file.
    • [ ] The fit() method should take in the data matrices, do the constrained optimizations, and initialize the operators of the ROM.
    • [ ] Implement the predict() method with a symplectic integrator.
  • [ ] Write and run tests for the new class in a new file /tests/models/multi/test_hamiltonian.py
  • [ ] Compile the docs and check that the automatically generated documentation page looks good.
  • [ ] Write a tutorial as a new Jupyter Notebook, docs/source/tutorials/hamiltonian.ipynb with the linear wave equation example.

shanemcq18 avatar Aug 23 '23 15:08 shanemcq18

Some of this is now implemented in this repository, specifically models.py.

shanemcq18 avatar Jun 17 '25 23:06 shanemcq18