jac_entry2
Stable type · Differentiate a model
Tier: stable · Kind: type · Topic: Differentiate a model
| Julia | Python | Rust |
|---|---|---|
JacEntry2 | JacEntry2 | JacEntry2 |
Julia
struct JacEntry2
JacEntry2(u::String, v::String, w::String, band::Band, ncol::Int64)
JacEntry2(u, v, w, band, ncol)
JacEntry2
One second-order band: ∂²(equation for u)/∂v ∂w. band is the first-order
entry’s band with its coefficient replaced by ∂coef/∂(site of w): the same
rows, ridx and contracted (plus any dimensions the second site adds
under a nested sum), and cidx holding v’s column indices FOLLOWED by
w’s. The first ncol of them are v’s (col_idx /
col2_idx split them). Keeping both in one Band lets clipping,
merging and normalization run unchanged.
Python
class JacEntry2
JacEntry2(u: str, v: str, w: str, band: Band, ncol: int)
JacEntry2.col_idx: list # property
JacEntry2.col2_idx: list # property
One second-order band: ∂²(equation for u)/∂v ∂w. band
is the first-order entry’s band with its coefficient replaced by
∂coef/∂(site of w): the same rows, ridx and contracted
(plus any dimensions the second site adds under a nested sum), and
cidx holding v’s column indices FOLLOWED by w’s. The first
ncol of them are v’s (col_idx / col2_idx split
them). Keeping both in one Band
lets clipping, merging and
normalization run unchanged.
Rust
pub struct JacEntry2 {
pub u: String,
pub v: String,
pub w: String,
pub band: Band,
pub ncol: usize,
}
impl JacEntry2 { pub fn col_idx(&self) -> &[Expr] }
impl JacEntry2 { pub fn col2_idx(&self) -> &[Expr] }
One second-order band: ∂²(equation for u)/∂v ∂w. band is the
first-order entry’s band with its coefficient replaced by ∂coef/∂(site of w): the same rows, ridx and contracted (plus any dimensions the
second site adds under a nested sum), and cidx holding v’s column
indices FOLLOWED by w’s. The first ncol of them are v’s
(JacEntry2::col_idx / JacEntry2::col2_idx split them). Keeping
both in one Band
lets clipping, merging and normalization run
unchanged.