jacobian_bands2
Stable function · Differentiate a model
Tier: stable · Kind: function · Topic: Differentiate a model
| Julia | Python | Rust |
|---|---|---|
jacobian_bands2 | jacobian_bands2 | jacobian_bands2 |
Julia
jacobian_bands2(file::EarthSciAST.EsmFile, model_name; kw...)
jacobian_bands2(flat::EarthSciAST.FlattenedSystem; kw...)
jacobian_bands2(sv::SysView; wrt, forcing)
jacobian_bands2(file::EsmFile, model_name; wrt = (:states, :states), forcing = nothing) -> Vector{JacEntry2}
jacobian_bands2(flat::FlattenedSystem; wrt = (:states, :states), forcing = nothing) -> Vector{JacEntry2}
jacobian_bands2(sv::SysView; wrt = (:states, :states), forcing = nothing) -> Vector{JacEntry2}
Second-order bands for the axis pair wrt = (a1, a2), a1 ∈ (:states, :time)
and a2 ∈ (:states, :parameters, :forcing): every first-order entry of the
a1 axis (jacobian_bands
) with its coefficient differentiated by
the same calculus with respect to every site of every a2 target, broadcast
over the entry’s rows with region clipping and re-merging. No new rules: the
non-smooth policy (spec §3.2) applies again, and the pattern is the global
structural union over branches.
(r, c, s) and (r, s, c) come out independently, from distinct first-order
entries; consumers must not assume either is deduplicated. On the
:parameters and :forcing second axes every col2_idx must be closed at
build time, as on the first-order axes (esm-jacobian-spec.md §4.3).
Python
jacobian_bands2(obj, model_name: str | None = None, wrt=('states', 'states'), forcing=None) -> list[JacEntry2]
Second-order bands for the axis pair wrt = (a1, a2), a1 in
("states", "time") and a2 in ("states", "parameters", "forcing"): every first-order entry of the a1 axis
(jacobian_bands
) with its coefficient differentiated by the same
calculus with respect to every site of every a2 target, broadcast
over the entry’s rows with region clipping and re-merging. No new rules:
the non-smooth policy (spec §3.2) applies again, and the pattern is the
global structural union over branches.
(r, c, s) and (r, s, c) come out independently, from distinct
first-order entries; consumers must not assume either is deduplicated.
On the "parameters" and "forcing" second axes every second column
index must be closed at build time (spec §4.3), else BandError
.
Rust
pub fn jacobian_bands2(file: &EsmFile, model_name: Option<&str>, wrt: (Wrt, Wrt)) -> Result<Vec<JacEntry2>, BandError>
Second-order bands for the axis pair wrt = (a1, a2), a1 states or
time and a2 states, parameters or forcing: every first-order entry of
the a1 axis (crate::jacobian_bands
) with its coefficient
differentiated by the same calculus with respect to every site of every
a2 target, broadcast over the entry’s rows with region clipping and
re-merging. No new rules: the non-smooth policy (spec §3.2) applies
again, and the pattern is the global structural union over branches.
(r, c, s) and (r, s, c) come out independently, from distinct
first-order entries; consumers must not assume either is deduplicated.
The forcing set is inferred (see jacobian_bands2_with_forcing).