Skip to main content

hp-FEM

CI License: MIT Docs

Adaptive hp-finite-element suite for nano-optics: time-harmonic Maxwell solvers with high-order Nédélec (edge) elements, rigorous a-posteriori error estimation, automatic hp-refinement and perfectly matched layers.

Target applications: scatterometry & EUV masks, metasurfaces, photovoltaics, integrated photonics, VCSELs/LEDs, plasmonic sensors, quantum-dot emitters.

Documentation

Theory, architecture, Python guide and API reference: https://photonpower.github.io/hp-FEM/ (built from docs/ by MkDocs on every push to main).

Status

Release 0.5.0: milestones M0–M20 are complete. Beyond the Maxwell core (mesh infrastructure, Nédélec elements, scattering and waveguides, hp-adaptivity, solvers, Python API, multiphysics) this covers validation against the literature, axisymmetric and conical solvers, ports and sensitivities, optimisation and uncertainty quantification, dipole emitters in periodic structures, anisotropic materials, and linear elasticity with eigenstrain. Open are the optional MPI item and the full 3D ring resonator. See the roadmap and the changelog.

Installation

pip install hpfem            # binary wheels: Linux x86_64, Windows x86_64, macOS arm64 (>= 15)
pip install "hpfem[gui]"     # plus the Streamlit front end (hpfem-gui)
hpfem info                   # version, threads, solver backends
hpfem reference              # compact command reference of the Python API (for agents)

The wheels use the SparseLU direct solver (hpfem info shows the backends and OpenMP threads); the MUMPS and cuDSS backends need a source build. Other platforms build from the sdist (C++20 compiler, CMake ≥ 3.25, Ninja).

Quick start (development)

./scripts/setup-dev.sh                       # Ubuntu toolchain + pre-commit
cmake --preset release && cmake --build --preset release && ctest --preset release
pip install -e ".[dev]"                      # Python package from the source tree
pip install "hpfem[gui]" && hpfem-gui app.py # Streamlit front end with this interpreter
mkdocs serve                                 # documentation

Repository

Path Content
CLAUDE.md conventions, workflow, Definition of Done — read first
include/hpfem, src C++20 core library
python/ pybind11 bindings + Python package
tests/ unit / convergence / regression tests (Catch2, pytest)
docs/ MkDocs site: theory, architecture, ADRs, roadmap
examples/ application examples

Dependencies

Library Purpose How
Eigen 3.4 dense/sparse linear algebra system or FetchContent
fmt / spdlog logging FetchContent
nlohmann_json configs, results FetchContent
Spectra 1.2 shift-invert Lanczos / Arnoldi eigensolvers (header-only) FetchContent
Boost.Math 1.86 (standalone) Bessel functions where the standard library lacks the C++17 special functions (libc++, Apple Clang); not used with libstdc++ / MSVC FetchContent, only if needed
Catch2 v3 C++ tests FetchContent
pybind11 Python bindings FetchContent / pip
Gmsh mesh generation (external tool) system
OpenMP parallel assembly and estimation (HPFEM_ENABLE_OPENMP, on by default) compiler
MUMPS 5 (sequential, complex) optional direct solver backend (HPFEM_ENABLE_MUMPS, preset mumps) cmake/FindMUMPS.cmake: apt libmumps-seq-dev libmumps-headers-dev, MSYS2 mingw-w64-ucrt-x86_64-mumps
cuDSS 0.8 + CUDA 12/13 optional GPU direct solver backend (HPFEM_ENABLE_CUDA); separate DLL hpfem_gpu built with nvcc, loaded at run time gpu/README.md (not needed to build the library)
BoTorch optional: multi-objective and multi-fidelity Bayesian optimisation (hpfem.opt.pareto_optimize, multi_fidelity_optimize; experimental) pip extra opt-bo
emcee 3 optional: MCMC sampling of the parameter posterior (hpfem.opt.sample); in the dev extra for the tests pip extra opt-mcmc
PETSc/SLEPc, MPI optional (later milestones) find_package, CMake options

License

MIT — see LICENSE.

Metadata

Release files for hpfem 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hpfem 0.5.0
File Size Uploaded Provenance Actions
hpfem-0.5.0.tar.gz 1.5 MB With provenance Details for hpfem-0.5.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for hpfem 0.5.0
File Actions
hpfem-0.5.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for hpfem-0.5.0-cp313-cp313-win_amd64.whl
hpfem-0.5.0-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details for hpfem-0.5.0-cp313-cp313-manylinux_2_28_x86_64.whl
hpfem-0.5.0-cp313-cp313-macosx_15_0_arm64.whl CPython 3.13 CPython 3.13 macOS 15.0+ ARM64 Details for hpfem-0.5.0-cp313-cp313-macosx_15_0_arm64.whl
hpfem-0.5.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for hpfem-0.5.0-cp312-cp312-win_amd64.whl
hpfem-0.5.0-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details for hpfem-0.5.0-cp312-cp312-manylinux_2_28_x86_64.whl
hpfem-0.5.0-cp312-cp312-macosx_15_0_arm64.whl CPython 3.12 CPython 3.12 macOS 15.0+ ARM64 Details for hpfem-0.5.0-cp312-cp312-macosx_15_0_arm64.whl
hpfem-0.5.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for hpfem-0.5.0-cp311-cp311-win_amd64.whl
hpfem-0.5.0-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details for hpfem-0.5.0-cp311-cp311-manylinux_2_28_x86_64.whl
hpfem-0.5.0-cp311-cp311-macosx_15_0_arm64.whl CPython 3.11 CPython 3.11 macOS 15.0+ ARM64 Details for hpfem-0.5.0-cp311-cp311-macosx_15_0_arm64.whl
hpfem-0.5.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for hpfem-0.5.0-cp310-cp310-win_amd64.whl
hpfem-0.5.0-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details for hpfem-0.5.0-cp310-cp310-manylinux_2_28_x86_64.whl
hpfem-0.5.0-cp310-cp310-macosx_15_0_arm64.whl CPython 3.10 CPython 3.10 macOS 15.0+ ARM64 Details for hpfem-0.5.0-cp310-cp310-macosx_15_0_arm64.whl

Total release size: 118.2 MB

Release files / hpfem-0.5.0.tar.gz

Download URL hpfem-0.5.0.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
82a2c11b929d04decc8c26f39c120672c3bbb8e084d88be0f54017903c94234d
BLAKE2b-256 checksum
How to use checksums
b59ee4fb6aa53cf6ba0d1458d5ffaddc5494f7a9429e1128bb49c958b25a31f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / hpfem-0.5.0-cp313-cp313-win_amd64.whl

Download URL hpfem-0.5.0-cp313-cp313-win_amd64.whl
Size 10.0 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
eac61ff91b3995c5c9c058ee6a05cf18f5914d1fe082492292291b01aa5eba8c
BLAKE2b-256 checksum
How to use checksums
9ff72ff802b0622455a6582c65649511b850b06b59207f8fb29985bcd189a322
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / hpfem-0.5.0-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL hpfem-0.5.0-cp313-cp313-manylinux_2_28_x86_64.whl
Size 10.3 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
ac51dd1148cb16f94c1ce9548b60bf737b693e76dc5fc8dab862b5bc7eee060d
BLAKE2b-256 checksum
How to use checksums
a7e16ae31ed4084c7c6e25e918c67869276cb9deb36301f8ef32f59eb175abf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / hpfem-0.5.0-cp313-cp313-macosx_15_0_arm64.whl

Download URL hpfem-0.5.0-cp313-cp313-macosx_15_0_arm64.whl
Size 8.9 MB
Tags CPython 3.13 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
9ef4290555bab6f8ccb73467774c31da094ef97468f784b19fc3e31fd8acfba3
BLAKE2b-256 checksum
How to use checksums
b7a5d9cbee0e5936a07dda8d04b514e1826b8f707747c0a229766f973d112547
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / hpfem-0.5.0-cp312-cp312-win_amd64.whl

Download URL hpfem-0.5.0-cp312-cp312-win_amd64.whl
Size 10.0 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
0affba04a8798f53d4041f7e62c3546b414fc40c3e6f15f78e81da56e453084c
BLAKE2b-256 checksum
How to use checksums
5b3bdd4442cf71632a76ff661a8eb17a35361716aa488adb3877f3793777cb3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / hpfem-0.5.0-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL hpfem-0.5.0-cp312-cp312-manylinux_2_28_x86_64.whl
Size 10.3 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
dd7cf099b7b35c6b2c6967c3be74a35dfc2d0c765cb03df9397f8d50f21578e5
BLAKE2b-256 checksum
How to use checksums
cef5f7df93ee44b339ed61b9fdc47dab41d9c1dac3f1dcfae517b911ec6049f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / hpfem-0.5.0-cp312-cp312-macosx_15_0_arm64.whl

Download URL hpfem-0.5.0-cp312-cp312-macosx_15_0_arm64.whl
Size 8.9 MB
Tags CPython 3.12 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
d88ac5c1fdbf65d268a7d27fc98a980fdca445a7c159d3db5c5e5cc06df5f3a2
BLAKE2b-256 checksum
How to use checksums
810413a8fdca52d3308d3c8ca9cd77e666ca1823f2faa90494ddcc837c8761f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / hpfem-0.5.0-cp311-cp311-win_amd64.whl

Download URL hpfem-0.5.0-cp311-cp311-win_amd64.whl
Size 10.0 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
6777e828791392e67b3dd25a0e812863d4197a0f48fe6bb18e55fda3dc28775a
BLAKE2b-256 checksum
How to use checksums
80d9c64e8adf02f7502350ab5e34c9b6d7fff9f05ac1af089350f8e5e2d0c9a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / hpfem-0.5.0-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL hpfem-0.5.0-cp311-cp311-manylinux_2_28_x86_64.whl
Size 10.3 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
964b58bbe7568146fd435ec3a2143c0861b90fc0ae91ecf09b2f7e439b391717
BLAKE2b-256 checksum
How to use checksums
05c0c9b2c8264f6b45e64e8e09a3a659cc09db6eb391a7a5d24ad114589a14b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / hpfem-0.5.0-cp311-cp311-macosx_15_0_arm64.whl

Download URL hpfem-0.5.0-cp311-cp311-macosx_15_0_arm64.whl
Size 8.9 MB
Tags CPython 3.11 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
8f3c5e3aca8fad4d90812d779d8480b034bbda241d2886d3778ac2bba933bcfc
BLAKE2b-256 checksum
How to use checksums
89b1c69bbee6ab05725c847a110e64584b5057573c2a232a06666ab3e934bbd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / hpfem-0.5.0-cp310-cp310-win_amd64.whl

Download URL hpfem-0.5.0-cp310-cp310-win_amd64.whl
Size 10.0 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
a9da886e2f908b24383b042a8092208ec6f4170ca5580010cd1490ea849c5748
BLAKE2b-256 checksum
How to use checksums
0fa91bad9384b2ce982de1360c01f98cdbefe2b525a8a00a42eeeeb23828e2bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / hpfem-0.5.0-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL hpfem-0.5.0-cp310-cp310-manylinux_2_28_x86_64.whl
Size 10.3 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
4a4dbcd336722fbd923a5a58e5d37b6f38943ae83291f4bf88a6ecab558dc5d1
BLAKE2b-256 checksum
How to use checksums
66685597102ef2fb58f542655e200bd797aa7669498b848132edc0cb1eacef9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / hpfem-0.5.0-cp310-cp310-macosx_15_0_arm64.whl

Download URL hpfem-0.5.0-cp310-cp310-macosx_15_0_arm64.whl
Size 8.9 MB
Tags CPython 3.10 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
2bc97309ffea5117f0376772129f11cfa2b74891b3dee4c0bbaeddd8b194c932
BLAKE2b-256 checksum
How to use checksums
ef8427b40ad6d6792c6b6699a48aaac4b49e41d646ad653b8f38a260d8ba5d36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for hpfem 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 13 files in this release have been uploaded with provenance metadata.

Select from 13 files

Attestation for hpfem-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.0 This release

13 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page