jacobian_document
Stable function · Serialize as a document block
Tier: stable · Kind: function · Topic: Serialize as a document block
| Julia | Python | Rust |
|---|---|---|
jacobian_document | not exported | not exported |
Julia
jacobian_document(file::EarthSciAST.EsmFile, model_name; wrt, cse, cse_min_nodes)
jacobian_document(flat::EarthSciAST.FlattenedSystem; wrt, name, cse, cse_min_nodes)
jacobian_document(file::EsmFile, model_name; wrt = :states,
cse = true, cse_min_nodes = 12) -> Dict
jacobian_document(flat::FlattenedSystem; wrt = :states, name = "Flattened",
cse = true, cse_min_nodes = 12) -> Dict
The serialized input document plus the draft "jacobians" top-level block
(esm-jacobian-spec.md §4): per model, the differentiation axis, the band
entries, the detected structure class, and — when a factorization plan
exists for that structure — the serialized plan.
With cse = true (default), repeated coefficient subtrees of at least
cse_min_nodes AST nodes are hoisted into zero-parameter
expression_templates carried inside the block (cse_templates
),
and the emitted coefficients reference them via apply_expression_template
— the size control for limiter-heavy schemes. parse_jacobian_block
expands the references back, so the round-trip is exact either way.
Example (block)
doc = jacobian_document(file, "Chem")
block = doc["jacobians"]["Chem"]
@assert block["structure"] == "block_diagonal"
@assert block["factorization"]["type"] == "block_diagonal_lu"
Python
Python does not export this function.
Rust
Rust does not export this function.