TUTORIALS(1)User CommandsTUTORIALS(1)
────────────────────────────────────────────────────────────────────────────────────────
Tutorials¶
Start with one NumPy gradient, then build the model a piece at a time: how Advect follows Python, how derivatives act as linear maps, and when to use higher-order, implicit, or staged differentiation. These six pages form the main path through the library.
Most examples can run directly in the browser. Each page is one Python session,
so pressing [ run ] also runs any earlier runnable blocks on that page.
| Step | Tutorial | What it teaches |
|---|---|---|
| 1 | Gradients and pytrees | grad, value_and_grad, auxiliary results, argument selection, and structured parameters |
| 2 | Dynamic control flow and mutation | Data-dependent branches and loops, helper functions, and owned local updates |
| 3 | JVPs, VJPs, and linear maps | jvp, vjp, reusable LinearMap objects, Jacobians, and complex derivatives |
| 4 | Higher-order differentiation | Nested derivatives, hvp, Hessians, and checkpoint |
| 5 | Implicit differentiation | Differentiate a converged equation with implicit_root |
| 6 | Staging and serialization | Exact signatures, reusable derivative programs, and StagedProgram artifacts |
Connect and extend¶
- Arrays and Scientific Python explains providers, differentiable SciPy functions, and xarray labels.
- Host autodiff frameworks wraps an Advect function as one PyTorch, JAX, or HIPS Autograd operation.
- Custom primitives adds an atomic operation with its abstract and derivative rules.
- Troubleshooting turns common tracing, numerical, and staging failures into concrete rewrites.
$ █