An elliptic PDE solver built with machine learning in mind
Project description
ha-hps
A JAX package implementing hardware acceleration for HPS methods in two and three dimensions.
See our preprint on arXiv: Hardware Acceleration for HPS Methods in Two and Three Dimensions
Installation
To install, you can use pip:
pip install jaxhps
The examples require additional packages matplotlib and h5py. If you want to install them automatically, use:
pip install jaxhps[examples]
Documentation
https://jaxhps.readthedocs.io/en/latest/
Examples
hp convergence on 2D problems with known solutions
Shows convergence using uniform quadtrees using both DtN matrices and ItI matrices.
python examples/hp_convergence_2D_problems.py --DtN --ItI
High-wavenumber scattering problem
First, run the matlab script examples/driver_gen_SD_matrices.m. This will generate and save exterior single and double-layer kernel matrices. These matrices are necessary to define a boundary integral equation for the scattering problem.
Once in place, we can run the script:
python examples/wave_scattering_compute_reference_soln.py --scattering_potential gauss_bumps -k 100 --plot_utot
This will generate plots which looks like this, showing the scattering potential and real part and modulus of the total field:
Adaptive discretization on a 3D problem with known solution
We have a script for generating adaptive discretizations on the wavefront problem presented in our paper:
python examples/wavefront_adaptive_discretization_3D.py -p 10 --tol 1e-02 1e-05
This should produce an image showing the computed solution, generated grid, and error map:
Inverse wave scattering using automatic differentiation
We have an implementation of a low-dimensional optimization problem using automatic differentiation:
python examples/inverse_wave_scattering.py --n_iter 25
This is an inverse scattering problem where we try to recover the locations of four Gaussian bumps which make up the scattering potential. Running the code should produce plots showing the optimization variables converging at the centers of the Gaussian bumps in the scattering potential, as well as a plot showing the convergence of the objective function:
Linearized Poisson--Boltzmann equation
Our method can be used to solve the a linearized Poisson-Boltzmann equation, which models the electrostatic properties of a molecule in solution.
python examples/poisson_boltzmann_example.py --tol 1e-01 1e-03 -p 10
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jaxhps-0.0a0.tar.gz.
File metadata
- Download URL: jaxhps-0.0a0.tar.gz
- Upload date:
- Size: 644.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b82e34ac1a7de6c3329a1b99af05cfb41b90a424c2c60e072fe74fcbb73306f6
|
|
| MD5 |
5c7ba62dad9e6e7da4d6e99e8c487a12
|
|
| BLAKE2b-256 |
ab0f4f09b1198a78693d3ec14031c25a45f63e475f5b58bdf2cffe6d26eaa1e2
|
File details
Details for the file jaxhps-0.0a0-py3-none-any.whl.
File metadata
- Download URL: jaxhps-0.0a0-py3-none-any.whl
- Upload date:
- Size: 121.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fc65446ca64d59f17c160745721b48fe481ee197100de6a549db5f988ca5fa9
|
|
| MD5 |
1219fbaadfd44f7ea93c5bee9dde7237
|
|
| BLAKE2b-256 |
d82fbb3f80ca78d973c4d33f5cb296068f4d36d98b79fbbfab9c6777191cde6b
|