Skip to content

Physics

In nefi the physics is a hard constraint: every candidate field is pushed through a differentiable Operator, and the prediction is exactly the discretized physics applied to it. Every operator evaluates at any curriculum resolution (at_resolution), runs on CPU and CUDA, declares its homogeneity when it has one, and carries a fidelity tag. Every benchmark measurement is simulated by a different, higher-fidelity model — a finer grid, float64, an independent scheme — so that no result relies on an inverse crime.

The families

family forward model gradients instances benchmark data from
Convolution
fft_convolution
y = k ∗ x, N-D, zero-padded FFT, kernel rebuilt per resolution autograd · batchable toy1d, deconvolution, deconvolution3d PSF on a 2× grid, float64
NV dipolar spectra
nv_relaxometry, nv_direct
tensor power kernel × Lorentzian (F2), coherent F1, source-side direct sum F3 autograd · batchable (F1/F2) nv_relaxometry F3 direct sum, float64
Planar magnetostatics
current_density, magnetization, biot_savart
stray field of sheet currents / magnetization at a standoff autograd · batchable current_density real-space Biot–Savart sum, float64
X-ray transform
radon, radon3d
parallel-beam line integrals, all views in one grid_sample exact autograd adjoint · batchable sparse_view_ct, ct3d 2× finer image grid, float64
Poisson
poisson
−κΔu = f, spectral DST solver autograd · batchable poisson_source finite differences on a 2× grid, float64
Variable-coefficient elliptic
elliptic, eit, darcy, diffuse_optical
−∇·(σ∇u) + κu = f, harmonic-mean finite volumes, Jacobi-PCG implicit-function-theorem adjoint, warm starts eit, darcy_flow, dot3d finite volumes on a 2× grid, float64
Transient heat
heat (heat_explicit for data)
implicit Euler, harmonic-mean faces, Jacobi / Chebyshev / CG sweeps discrete adjoint at trajectory memory thermal_tomography explicit substepped simulator, float64
Acoustic waves
wave, wave_initial_condition
leapfrog, 4th-order Laplacian, PML (2-D) or sponge (3-D) autograd or block checkpointing wave_fwi, photoacoustic3d 2× finer grid, float64
Scattering
born, lippmann_schwinger
Born / Rytov; Lippmann–Schwinger for the data autograd · batchable (Born) diffraction_tomography iterated multiple scattering on a 2× grid, float64
Coherent optics
holography, phase_object
angular-spectrum propagation of a thin phase object autograd · batchable holography 2× sampling, float64
Reaction–diffusion
gray_scott
Gray–Scott, explicit Euler hitting the snapshot times exactly autograd or block checkpointing reaction_diffusion 4× smaller time step, float64
Bring your own
fourier_sampling, phase_retrieval, beer_lambert, sampling, saturation, time_stepper, function
Fourier sampling (MRI), phase retrieval, Beer–Lambert, sampling, saturation, generic time stepping, any function autograd; checkpointed time stepping your problem (BYOP) your generator

nefi list operators prints the full registry (36 entries, including the wrappers nuisance, stack, sum, pointwise and identity). Batchable operators can solve many measurements in one loop with nefi.batch_invert.

Pages

  • Elliptic & magnetostatics


    One differentiable steady-state solver with an exact implicit-function-theorem adjoint behind EIT, Darcy flow and diffuse optics; planar magnetostatics for NV current imaging; a new elliptic instance in about 30 lines.

  • Wave, scattering, optics & reaction


    Time stepping and its memory trade-off, acoustic waves with PML, Born and Lippmann–Schwinger scattering, angular-spectrum optics, Gray–Scott dynamics.

  • Heat equation (NeFTY)


    The implicit-Euler finite-volume solver, its discrete adjoint at trajectory-sized memory, the inner solvers and the explicit data simulator.

  • Write your own


    An operator is a differentiable function with at_resolution and a fidelity tag; pair it with an independent data generator and every tool in nefi works with it.