Examples¶
This gallery is organized by what you want to do, not by source family. Every page pairs a short
tutorial with runnable snippets, and links the matching scripts in the top-level
examples/ folder — each script runs
standalone and prints (or plots) its result.
Tip
New here? Start with the Quickstart, then come back and pick a task below.
Enable jax.config.update("jax_enable_x64", True) before running anything you want to compare
against Magpylib — see Precision.
Browse by task¶
Build sources, collections, and sensors; use motion paths and pixel grids.
Call getB/getH/getJ/getM directly with descriptors and arrays.
Differentiable force and torque between objects with getFT.
Render geometry, polarization, and paths in 3D with show.
Inverse design and geometry fitting with jax.grad.
Profiling, JIT, vmap, and large-coil workloads.
The examples/ folder¶
The scripts are grouped by theme on GitHub:
Folder |
Contents |
|---|---|
First field, collections & sensors, motion paths, custom sources, the source gallery. |
|
Triangle meshes, convex hulls, current sheets, superposition. |
|
Force intro, dipole–dipole, holding force. |
|
|
|
Air coils, Helmholtz pairs, discrete Halbach arrays. |
|
Inverse design, geometry optimization, field Jacobians, |