  The design of astronomical hardware operating at the diffraction limit
requires optimization of physical optical simulations of the instrument with
respect to desired figures of merit, such as throughput or astrometric
accuracy. These systems can be high dimensional, with highly nonlinear
relationships between outputs and the adjustable parameters of the hardware. In
this series of papers we present and apply dLux, an open-source end-to-end
differentiable optical modelling framework. Automatic differentiation enables
not just efficient high-dimensional optimization of astronomical hardware
designs, but also Bayesian experimental design directly targeting the precision
of experimental outcomes. Automatic second derivatives enable the exact and
numerically stable calculation of parameter covariance forecasts, and higher
derivatives of these enable direct optimization of these forecasts. We validate
this method against analytic theory and illustrate its utility in evaluating
the astrometric precision of a parametrized telescope model, and the design of
a diffractive pupil to achieve optimal astrometric performance for exoplanet
searches. The source code and tutorial software are open source and publicly
available, targeting researchers who may wish to harness dLux for their own
optical simulation problems.
