Skip to main content

numgrids

Numerical grids, spectral derivatives and PDE solvers in a few lines of NumPy-friendly Python.

A vibration mode of a circular drum, an eigenfunction of the Laplacian on the sphere, and the eigenstates of the quantum harmonic oscillator

Setting up grids, differentiation matrices, boundary conditions and coordinate transformations by hand is tedious and error-prone. numgrids handles all of this, so you can focus on the physics or mathematics of your problem.

numgrids in 30 seconds

What are the vibration frequencies of a circular drum? They are the square roots of the eigenvalues of the Laplacian on a disk, with the rim clamped:

from numgrids import *

drum = PolarGrid(radial(30, 1.0), periodic(40))     # the full disk, including its center
eigenvalues, modes = (-drum.laplacian_operator()).eig(k=6, bcs=0)

print(eigenvalues ** 0.5)
# [2.40482556 3.83170597 3.83170597 5.1356223  5.1356223  5.52007811]

These are the zeros of the Bessel functions, correct to 13 digits on a 30 × 40 grid.

Features

  • Grids and coordinates: Chebyshev, equidistant, periodic and logarithmic axes in any dimension; polar, cylindrical, spherical (volume and surface), elliptic and spheroidal coordinates, or your own; full disks, cylinders, spheres and balls without coordinate singularities
  • Calculus: spectral (FFT, Chebyshev) or finite-difference derivatives; gradient, divergence, curl, Laplacian; volume and surface integrals; spectral interpolation
  • Solving equations: operator algebra, solve() for boundary value problems, eig() for eigenvalue problems, Dirichlet/Neumann/Robin conditions in one line, time evolution (method of lines)
  • Tools: adaptive mesh refinement, convergence studies, plotting, save/load, xarray/NetCDF; all operators export SciPy sparse matrices

Installation

pip install numgrids

Optional extras: numgrids[plot] (matplotlib), numgrids[xarray] (xarray), or numgrids[all].

Learn more

Metadata

Release files for numgrids 0.6.1

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

Source distribution (sdist)

Source distribution for numgrids 0.6.1
File Size Uploaded Provenance Actions
numgrids-0.6.1.tar.gz 100.8 kB With provenance Details for numgrids-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for numgrids 0.6.1
File Interpreter ABI Platform Actions
numgrids-0.6.1-py3-none-any.whl Python 3 none any Details for numgrids-0.6.1-py3-none-any.whl

Total release size: 172.0 kB

Release files / numgrids-0.6.1.tar.gz

Download URL numgrids-0.6.1.tar.gz
Size 100.8 kB
Tags Source
SHA-256 checksum
How to use checksums
08802a86b931d612573225fb348330a690a0eb7305f4b41dac0f3bbcb0e2d0f5
BLAKE2b-256 checksum
How to use checksums
bf2681a70e1148cfae7f91dde6d706f866dd7f6f8d9bdaaaba61f5c196c3aa0c
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 17, 2026.

Transparency log

Release files / numgrids-0.6.1-py3-none-any.whl

Download URL numgrids-0.6.1-py3-none-any.whl
Size 71.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
446e9c473886fe32fd88850942b527c3a9241813923405658aaeb672a369b641
BLAKE2b-256 checksum
How to use checksums
6b60403aac8e7f8d56a02ee48a62fc4a9c0a44f0fbb60983fe5c140314119a5d
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 17, 2026.

Transparency log

Security for numgrids 0.6.1

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for numgrids-0.6.1.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 17, 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.

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