pySDC
pySDC is a Python implementation of the spectral deferred correction approach and its flavors, esp. the parallel-in-time extension PFASST. It is intended for rapid prototyping and educational purposes. New ideas can be tested and first toy problems can be easily implemented.
Cite this software
Description
Welcome to pySDC!
The pySDC project is a Python implementation of the
spectral deferred correction (SDC) approach and its flavors, esp. the
multilevel extension MLSDC and PFASST. It is intended for rapid
prototyping and educational purposes. New ideas like e.g. sweepers or
predictors can be tested and first toy problems can be easily
implemented.
Features
- Variants of SDC: explicit, implicit, IMEX, multi-implicit, Verlet, multi-level, diagonal, multi-step
- Variants of PFASST: virtually parallel or MPI-based parallel, classical or multigrid perspective
- 8 tutorials: from setting up a first collocation problem to SDC, PFASST and advanced topics
- Projects: many documented projects with defined and tested outcomes
- Many different examples, collocation types, data types already implemented
- Works with FEniCS, mpi4py-fft and PETSc (through petsc4py)
- Continuous integration via GitHub Actions and Gitlab CI (through the GitHub2Gitlab Action)
- Fully compatible with Python 3.10 - 3.13, runs at least on Ubuntu
Getting started
The code is hosted on GitHub, see
https://github.com/Parallel-in-Time/pySDC, and PyPI, see
https://pypi.python.org/pypi/pySDC. While using pip install pySDC
will give you a core version of pySDC to work with,
working with the developer version is most often the better choice. We
thus recommend to checkout the code from GitHub and install the
dependencies e.g. by using micromamba. For this, pySDC ships with environment files
which can be found in the folder etc/ or within the projects. Use these as e.g.
micromamba create -f etc/environment-base.yml
If you want to install the developer version using pip directly from the GitHub repository, use this:
# optionally use venv
python3 -m venv name_of_pySDC_env
. ./name_of_pySDC_env/bin/activate
# drop @5.5.0 if you want to install the develop version
pip install git+https://github.com/Parallel-in-Time/pySDC@5.5.0
To check your installation, run
pytest pySDC/tests -m NAME
where NAME corresponds to the environment you chose (base in the
example above). You may need to update your PYTHONPATH by running
export PYTHONPATH=$PYTHONPATH:/path/to/pySDC/root/folder
in particular if you want to run any of the playgrounds, projects or
tutorials. All import statements there assume that the
pySDC's base directory is part of PYTHONPATH.
For many examples, LaTeX is used for the plots, i.e. a
decent installation of this is needed in order to run those examples.
When using fenics or petsc4py, a C++
compiler is required (although installation may go through at first).
For more details on pySDC, check out http://www.parallel-in-time.org/pySDC.
How to cite
If you use pySDC or parts of it for your work, great! Let us know if we can help you with this. Also, we would greatly appreciate a citation of this paper:
Robert Speck, Algorithm 997: pySDC - Prototyping Spectral Deferred Corrections, ACM Transactions on Mathematical Software (TOMS), Volume 45 Issue 3, August 2019, https://doi.org/10.1145/3310410
The current software release can be cited using Zenodo:
Contributing
pySDC code was originally developed by Robert Speck (@pancetta),
and is now maintained and developed by a small community of scientists interested in SDC methods.
Checkout the Changelog to see pySDC's evolution since 2016. It has a
software management plan (SWP), too, see here.
Any contribution is dearly welcome! If you want to contribute, please take the time to read our Contribution Guidelines (and don't forget to take a peek at our nice Code of Conduct :wink:).
Acknowledgements
This project has received funding from the European High-Performance Computing Joint Undertaking (JU) under grant agreement No 955701 (TIME-X) and grant agreement No 101118139. The JU receives support from the European Union's Horizon 2020 research and innovation programme and Belgium, France, Germany, and Switzerland. This project also received funding from the German Federal Ministry of Education and Research (BMBF) grants 16HPC047 and 16ME0679K. Supported by the European Union - NextGenerationEU. The project also received help from the Joint Lab "Helmholtz Information - Research Software Engineering" (HiRSE).
- BSD-2-Clause
- Open Access
Participating organisations
Reference papers
Mentions
- 1.Author(s): Joshua Hope-Collins, Abdalaziz Hamdan, Werner Bauer, Lawrence Mitchell, Colin CotterPublished in Geoscientific Model Development by Copernicus GmbH in 2025, page: 4535-456910.5194/gmd-18-4535-2025
- 2.Author(s): Ikrom Akramov, Sebastian Götschel, Michael Minion, Daniel Ruprecht, Robert SpeckPublished in SIAM Journal on Scientific Computing by Society for Industrial & Applied Mathematics (SIAM) in 2024, page: A1690-A171310.1137/23m1592596
- 3.Author(s): Robert Kraft, Sabri Koraltan, Markus Gattringer, Florian Bruckner, Dieter Suess, Claas AbertPublished in Journal of Magnetism and Magnetic Materials by Elsevier BV in 2024, page: 17199810.1016/j.jmmm.2024.171998
- 4.Author(s): Thomas Saupe, Sebastian Götschel, Thibaut Lunet, Daniel Ruprecht, Robert SpeckPublished in Numerical Algorithms by Springer Science and Business Media LLC in 2024, page: 369-39310.1007/s11075-024-01964-z
- 5.Author(s): Matthias Bolten, Stephanie Friedhoff, Jens HahnePublished in Parallel Computing by Elsevier BV in 2023, page: 10305010.1016/j.parco.2023.103050
- 6.Author(s): Gayatri Čaklović, Robert Speck, Martin FrankPublished in Communications in Applied Mathematics and Computational Science by Mathematical Sciences Publishers in 2023, page: 55-8510.2140/camcos.2023.18.55
- 7.Author(s): Matthias Bolten, Stephanie Friedhoff, Jens HahnePublished in SSRN Electronic Journal by Elsevier BV in 202210.2139/ssrn.4201056
- 8.Author(s): Jens Hahne, Stephanie Friedhoff, Matthias BoltenPublished in ACM Transactions on Mathematical Software by Association for Computing Machinery (ACM) in 2021, page: 1-2210.1145/3446979
- 9.Author(s): Ruth Schöbel, Robert SpeckPublished in Computing and Visualization in Science by Springer Science and Business Media LLC in 202010.1007/s00791-020-00330-5
- 10.Author(s): Benjamin W. Ong, Raymond J. SpiteriPublished in Journal of Scientific Computing by Springer Science and Business Media LLC in 202010.1007/s10915-020-01235-8
- 11.Author(s): Robert SpeckPublished in ACM Transactions on Mathematical Software by Association for Computing Machinery (ACM) in 2019, page: 1-2310.1145/3310410
- 12.Author(s): Matthias Bolten, Dieter Moser, Robert SpeckPublished in Numerical Linear Algebra with Applications by Wiley in 201810.1002/nla.2208
- 13.Author(s): Robert SpeckPublished in Computing and Visualization in Science by Springer Science and Business Media LLC in 2018, page: 75-8310.1007/s00791-018-0298-x
- 14.Author(s): Daniel Ruprecht, Robert SpeckPublished in SIAM Journal on Scientific Computing by Society for Industrial & Applied Mathematics (SIAM) in 2016, page: A2535-A255710.1137/16m1060078
- 1.Author(s): Emily Lattanzio, Sansriti Ranjan, Robert Underwood, Thomas Saupe, Robert Speck, Jon C. CalhounPublished in 202510.1109/hpec67600.2025.11196695
- 2.Author(s): Ikrom Akramov, Sebastian Götschel, Michael Minion, Daniel Ruprecht, Robert SpeckPublished by arXiv in 202310.48550/arxiv.2310.08352
- 3.Author(s): Gayatri Caklovic, Robert Speck, Martin FrankPublished in 2021
- 4.Author(s): Gitte Kremling, Robert SpeckPublished in 202010.48550/arxiv.2002.07555
Contributors
Contact person
Robert Speck
Jülich Supercomputing Centre, Forschungszentrum Jülich GmbH, 52425 Jülich, Germany
0000-0002-3879-1210
Mail RobertHelmholtz Program-oriented Funding IV
Related projects
HiRSE
Joint Lab Helmholtz Information - Research Software Engineering