Skip to content


Repository files navigation


Large Eigensystem Generator for One-dimensional pLASmas

unit testsregression pylbo docs codecov GitHub release (latest by date) Slack

Table of contents

  1. About
  2. Documentation
  3. Versions
  4. Using Legolas


Legolas is a modern and user-friendly large-scale object oriented framework, capable of solving (subsets of) the full set of linearised magnetohydrodynamic equations for a general three-dimensional state with one-dimensional variation in either Cartesian or cylindrical geometries. Fourier modes are imposed in the other coordinates. The code is written in modern Fortran and relies on a Finite Element treatment to reduce the resulting system of differential equations to a large-scale complex, non-Hermitian eigenvalue problem. Legolas interfaces with the BLAS/LAPACK/ARPACK libraries, resulting in detailed eigenspectrum calculations with corresponding eigenfunctions. An efficient treatment of the underlying datastructure allows the code to run on regular laptops at high resolutions, and a complementary post-processing framework is provided for interactive visualisation and analysis of the results.

Legolas supports the inclusion of background flows, external gravity, anisotropic thermal conduction, resistivity, optically thin radiative losses, heating, viscosity, and full Hall MHD; most of these are fully customisable by the user.

Legolas is being developed and maintained at the Centre for mathematical Plasma-Astrophysics, KU Leuven, Belgium.


We have a dedicated website on which contains a detailed guide on how to install, compile and use the code. Source code documentation is regenerated automatically with each commit on both the master and develop branches.


We (try to) ensure that the master branch of this repository is always stable and ready for use. If you would like to check out the latest development goodies instead you can take a look at the develop branch, but note that since there may be some time between major releases it is possible that the development branch differs from the latest stable release. The development version of Legolas has its own dedicated website at, for those who want to use the bleeding-edge version of the code. Note that while everything on the develop branch should be stable, it is possible that some features there are still under development and/or not yet fully tested or documented.

Using Legolas

⚠️ Please note

Legolas has taken (and still takes up) a lot of effort and time to test, develop and maintain. Since the code is relatively new we would like to know how it is used and provide guidance if possible. To that end, we kindly ask that the the first published peer-reviewed paper from applying Legolas is done in co-authorship with at least one of the original authors. The BibTex citation to our ApJS method paper can be found here.