Skip to content
Gradual conversion to python
Branch: master
Clone or download
Latest commit 0072f53 Jun 26, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
binder Minot text fixes Jun 26, 2019
examples @ 54f31b0 Update examples Jun 26, 2019
pySpinW More and more setup Jun 25, 2019
src Create project make files Jun 12, 2019
.gitignore Create and tweak pangeo config. Jun 25, 2019
.gitmodules Update examples Jun 26, 2019
DockerfileLocal Fix install on all media Jun 26, 2019 Fix install on all media Jun 26, 2019 Update Jun 25, 2019
common.yml Setup for live demo Jun 25, 2019
docker-compose.yml Documentation and Ipython progress Jun 7, 2019
pySpinWBuilder.prj Create project make files Jun 12, 2019 Fix install on all media Jun 26, 2019


WARNING - Work in progress.

A live demo can be found through Pangeos instance of Binder:



pySpinW (py-spin-double-u) is a python implementation of the MATLAB library SpinW. It can optimize magnetic structures using mean field theory and calculate spin wave dispersion and spin-spin correlation function for complex crystal and magnetic structures. For details see


This is currently under development and will progress in stages.

  1. Conversion to a compiled python library. Currently in testing
  2. Conversion of symmetry, atoms, matoms etc to python. In progress
  3. Conversion of graphics modules to native python using matplotlib/VTK.
  4. Migration of auxiliary code to pure python.
  5. Migration of main classes to pure python.
  6. Convert the core spinwave code to C++


  • Currently graphics are not showing up in the Docker script.
  • The ipython interface is a bit clunky, until the ipython-magic is re-written
  • Maybe memory duplication, so not ideal for large datasets.


There are 2 supported methods, Docker for a pre-built environment or a system install

Using Docker

Use the Docker file and docker-compose as it creates a stable environment.

docker-compose build

A jupyter notebook session is started with:

docker-compose up pySpinW

Where a session is accessible at . At the moment notebook.ipynb is an example notebook.

You can also try scripting with:

docker-compose up testScript

It will execute


  • On Windows/OSX Xming or a similar window manager should be installed. Currently graphics are not working, so this is not a requirement.

Using system python3


numpy and jupyter (if you want to run notebooks).


  • Correct MATLAB library paths have to be set.
  • To start a session mlPath for your MATLAB or MATLAB Runtime (v96) installation has to be given.

Then you can run or make your own.


  • Using a conda environment crashes the interface, so it's not recommended.

Pull requests are welcome!

You can’t perform that action at this time.