seemps.analysis.comptree.ChainTree#
- class seemps.analysis.comptree.ChainTree#
Bases:
objectChain-like computation-tree representation of a multivariate function.
This class encodes a multivariate function with a chain-like algebraic structure:
f_n[…f_2(f_1(None, s_1), s_2), …, s_n].
The tree consists of a sequence of left nodes (BranchNode) that define intermediate functional updates f_k, k = 1,…,n-1, and a terminal root node (ChainRoot) that applies the final binary function f_n and terminates the chain evaluation.
This representation can be efficiently loaded into a MPS using
mps_chain_tree().Examples
A chain-like tree for the Heaviside function applied to the running sum
f(x₁,x₂,… ) = Θ(x₁ + x₂ + …)
can be constructed as follows:
Each BranchNode represents the partial accumulation f_i(x_in, x_s) = x_in + x_s where its discretization grid is the domain of x_i and s ranges over its support.
The ChainRoot applies the Heaviside step f_n(x_{n-1}, x_s) = Θ(x_{n-1} + x_s).