MIT License

Copyright (c) 2026 pymstm contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

------------------------------------------------------------------------------

Third-party code

The compiled `pymstm._mstm_ext` extension is built from the MSTM (Multiple
Sphere T-Matrix) Fortran source, vendored as a git submodule under
external/mstm/ (https://github.com/dmckwski/MSTM) and included in patched
form under src/pymstm/_fortran/patches/ (patches are pure Fortran refactors
needed to make the source buildable by numpy.f2py, plus a replacement for one
routine -- see below -- and change no algorithm or runtime behavior). That
source is used under its own MIT license:

MIT License

Copyright (c) 2022 Daniel Mackowski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Note: one routine in the upstream MSTM source
(external/mstm/december2023/random_configuration-10.f90, `hpsort_eps_epw`)
was, in the unmodified upstream file, adapted from a GPLv2-licensed Quantum
ESPRESSO/EPW routine and was therefore not compatible with redistribution
under MIT. pyMSTM replaces it at build time (see
src/pymstm/_fortran/patches/random_configuration-10-license-fix.patch) with
a clean-room heapsort implementation of the same signature and contract,
written from scratch for this project. The compiled extension pyMSTM
distributes never contains the original GPL-licensed routine.
