desc.particles.VacuumGuidingCenterTrajectory.vf_prod

VacuumGuidingCenterTrajectory.vf_prod(t: Real[Array, ''] | Real[ndarray, ''] | number | int | float, y: PyTree[jaxtyping.Shaped[Array, '?*y'] | jaxtyping.Shaped[ndarray, '?*y'] | numpy.bool | numpy.number | bool | int | float | complex, 'Y'], args: PyTree[Any], control: _Control) PyTree[jaxtyping.Shaped[Array, '?*y'] | jaxtyping.Shaped[ndarray, '?*y'] | numpy.bool | numpy.number | bool | int | float | complex, 'Y']

The composition of [diffrax.AbstractTerm.vf][] and [diffrax.AbstractTerm.prod][].

With a solution $y$ to a differential equation with vector field $f$ and control $x$, this computes $f(t, y(t), args) Delta x(t)$ given $t$, $y(t)$, $args$, and $Delta x(t)$.

Its default implementation is simply `python self.prod(self.vf(t, y, args), control) `

This is offered as a special case that can be overridden when it is more efficient to do so.

!!! example

Consider when vf computes a matrix-matrix product, and prod computes a matrix-vector product. Then doing a naive composition corresponds to a (matrix-matrix)-vector product, which is less efficient than the corresponding matrix-(matrix-vector) product. Overriding this method offers a way to reclaim that efficiency.

!!! example

This is used extensively for efficiency when backpropagating via [diffrax.BacksolveAdjoint][].

Arguments:

  • t: the integration time.

  • y: the evolving state; a PyTree of structure $T$.

  • args: any static arguments as passed to [diffrax.diffeqsolve][].

  • control: The control evaluated over an interval; a PyTree of structure $U$.

Returns:

A PyTree of structure $T$.

!!! note

This function must be linear in control.