Algorithm Search⌘K

Algorithmadvanced

PRIMA

Also called passive reduced-order interconnect macromodeling.

Odabasioglu, Celik and Pileggi's model order reduction by projection on a block Krylov subspace with Arnoldi, which keeps the reduced model passive.

Time
Θ(n³ + k n² + k² n) worst · average · best
Space
Θ(n² + k n) extra
Where
k = the order of the reduced model (at most q p for q blocks of p ports); n = the number of unknowns of the circuit
Properties
deterministicnot exactiterative
Origin
Altan Odabasioglu, Mustafa Celik, Lawrence T. Pileggi, 1997

PRIMA reduces a large linear RLC circuit, such as the extracted model of a group of wires, to a small model that is passive: it does not create energy, so it can be connected to the rest of a circuit and simulated without making it unstable. It builds an orthonormal basis XX of the block Krylov subspace of the circuit equations by a block Arnoldi iteration, and then projects the matrices by the congruence XTGXX^T G X, XTCXX^T C X, XTBX^T B. Odabasioglu, Celik and Pileggi published it in 1997 and 1998. The model matches qq block moments of the transfer function, half as many as the Padé model of AWE, but it keeps passivity and stability, which AWE and PVL do not.

In plain words

A model with the right moments, as in AWE, can still behave badly: it can have a pole in the right half-plane, or it can generate energy when it is connected to other parts. PRIMA chooses a few directions in the space of node voltages and currents, those that the input reaches in the first few steps of the equations. It then writes the circuit equations only in these directions.

The trick is the way the equations are cut down. Both sides of each matrix are multiplied by the same basis. This keeps the properties that make a circuit passive: resistors still only take energy, and capacitors and inductors still only store it. The price is that, for the same size, the model matches fewer moments than AWE.

The problem

The input is a linear circuit in modified nodal form,

(G+sC) x(s)=B u(s),y(s)=LTx(s),H(s)=LT(G+sC)−1B,(G + sC) \, x(s) = B \, u(s), \qquad y(s) = L^T x(s), \qquad H(s) = L^T (G + sC)^{-1} B,

with real matrices GG and CC of order nn (GG invertible), pp inputs in BB and outputs in LL, and a number qq of blocks. For an RLC circuit, the unknowns are the node voltages and the inductor currents, and

G=(NE−ETRb),C=(Q00HL),G = \begin{pmatrix} N & E \\ -E^T & R_b \end{pmatrix}, \qquad C = \begin{pmatrix} Q & 0 \\ 0 & H_L \end{pmatrix},

with conductances NN, the incidence matrix EE of the inductors, their series resistances RbR_b, the capacitances QQ and the inductances HLH_L. Then G+GTG + G^T is positive semidefinite and CC is symmetric positive semidefinite. With L=BL = B (each port injects a current and observes its voltage), HH is the impedance matrix, and the circuit is passive.

The output is a reduced model (G^,C^,B^,L^)(\hat G, \hat C, \hat B, \hat L) of order k≤qpk \le qp whose block moments M^j\hat M_j agree with the moments Mj=LT(−G−1C)jG−1BM_j = L^T (-G^{-1} C)^j G^{-1} B for j<qj < q and which is passive. This is a model order reduction problem with a passivity constraint.

The algorithm

  1. PRIMA(G, C, B, L, q)
  2. 1R ← G⁻¹ B ▷ one LU of G, p solves
  3. 2X_0 ← an orthonormal basis of the columns of R ▷ Gram-Schmidt
  4. 3for k ← 1 to q − 1 do
  5. 4V ← G⁻¹ (−C X_{k−1}) ▷ the next block of A = −G⁻¹C
  6. 5for j ← 0 to k − 1 do V ← V − X_j (X_jᵀ V) ▷ block modified Gram-Schmidt
  7. 6X_k ← an orthonormal basis of the columns of V ▷ drop dependent columns
  8. 7X ← [X_0, X_1, …, X_{q−1}]
  9. 8Ĝ ← Xᵀ G X; Ĉ ← Xᵀ C X; B̂ ← Xᵀ B; L̂ ← Xᵀ L ▷ the congruence transform
  10. 9return Ĝ, Ĉ, B̂, L̂

Lines L1 to L7 are the block Arnoldi process on A=−G−1CA = -G^{-1} C with the start block R=G−1BR = G^{-1} B, with Gram-Schmidt orthogonalization. All solves use one LU decomposition of GG. Line L8 is the projection. It is a congruence: the same XX multiplies both sides of GG and CC. The reduced transfer function is H^(s)=L^T(G^+sC^)−1B^\hat H(s) = \hat L^T (\hat G + s \hat C)^{-1} \hat B. The implementation orthogonalizes each new vector twice and drops a vector whose norm falls below 10−1010^{-10} of its norm before line L5. It also has helpers for the moments, the transfer function and the poles of a model.

Example

An RC ladder with one port. Take three nodes in a chain, with R=(1,1,1)R = (1, 1, 1) from ground to node 0, node 0 to node 1 and node 1 to node 2, and C=(1,2,1)C = (1, 2, 1) from the nodes to ground. One port injects a current at node 0 and observes its voltage, so B=L=e0B = L = e_0 and H(s)H(s) is the input impedance. Its moments are 1,−4,26,−178,1224,−84201, -4, 26, -178, 1224, -8420.

At DC all three nodes are at the same voltage, so R=(1,1,1)R = (1, 1, 1) and X0=(1,1,1)/3X_0 = (1, 1, 1)/\sqrt 3. With q=1q = 1, G^=1/3\hat G = 1/3, C^=4/3\hat C = 4/3 and B^=1/3\hat B = 1/\sqrt 3, so H^(s)=1/(1+4s)\hat H(s) = 1/(1 + 4s), with moments 1,−4,161, -4, 16. The first two moments agree. The second basis vector for q=2q = 2 is X1=(0.7926,−0.2265,−0.5661)X_1 = (0.7926, -0.2265, -0.5661), and

qq moments of H^\hat H poles
1 1,−4,161, -4, 16 −0.25-0.25
2 1,−4,26,−178,1223.61, -4, 26, -178, 1223.6 −0.1454-0.1454, −1.9101-1.9101
3 all −0.1454-0.1454, −1.4030-1.4030, −2.4516-2.4516

Here GG and CC are symmetric and L=BL = B, so 2q2q moments agree, not only qq. With q=3=nq = 3 = n the model is the circuit.

An RLC ladder. Take three nodes with a conductance 1 at node 0 only, capacitors 1 at all nodes, and two branches, each a resistor 1 in series with an inductor 1, between nodes 0 and 1 and between nodes 1 and 2. There are 5 unknowns. The impedance at node 0 has moments 1,−3,14,−65,297,−13521, -3, 14, -65, 297, -1352. With q=2q = 2 the reduced model of order 2 has the moments 1,−3,14,−751, -3, 14, -75 and the poles −0.18-0.18 and −0.958-0.958. With q=3q = 3, the moments agree up to −65-65, and the poles are −0.220-0.220 and −0.876±0.935i-0.876 \pm 0.935 i. The circuit has the poles −0.220-0.220, −0.808±0.934i-0.808 \pm 0.934 i and −0.582±1.626i-0.582 \pm 1.626 i. All poles are in the left half-plane, as the theory says.

Correctness

The proof shows the following.

  • The basis. The columns of XX are orthonormal and span the block Krylov subspace span⁡{R,AR,…,Aq−1R}\operatorname{span}\{R, AR, \ldots, A^{q-1} R\}.
  • q block moments. If G^\hat G is invertible, then M^j=Mj\hat M_j = M_j for j=0,…,q−1j = 0, \ldots, q - 1. The proof only uses that the span of XX contains the Krylov subspace.
  • 2q block moments in the symmetric case. If GG and CC are symmetric and L=BL = B, as for an RC circuit, then M^j=Mj\hat M_j = M_j for j=0,…,2q−1j = 0, \ldots, 2q - 1. For one port the model is then the Padé model of AWE, and so in that case the Padé model is stable.
  • Full order. With nn columns in XX, H^=H\hat H = H.
  • Passivity. If G+GTG + G^T and CC are positive semidefinite and L=BL = B, the same holds for the reduced model, and H^(s)+H^(s)H\hat H(s) + \hat H(s)^H is positive semidefinite for Re⁡s>0\operatorname{Re} s > 0.
  • Stability. Under the same conditions, with G^\hat G invertible, all poles of H^\hat H are in the closed left half-plane, and in the open one if G+GTG + G^T is positive definite.

The proofs are in exact arithmetic. The tests check the moments against exact rational moments of RC and RLC ladders of 3 to 6 sections, the orthonormality of XX to 10−1210^{-12}, the poles and the positive-real condition at random points of the right half-plane in floating point. How many moments a model needs for a given accuracy of the waveform is not proved here; it depends on the circuit.

Proof: PRIMA spans the block Krylov subspace, matches q block moments (2q when G and C are symmetric), gives the full model at full order, and keeps passivity and stabilityfull

Setting. A linear circuit in modified nodal form is

(G+sC) x(s)=B u(s),y(s)=LTx(s),H(s)=LT(G+sC)−1B,(G + sC) \, x(s) = B \, u(s), \qquad y(s) = L^T x(s), \qquad H(s) = L^T (G + sC)^{-1} B,

with real G,CG, C of order nn, GG invertible, BB of size n×pn \times p and LL of size n×rn \times r. Write A=−G−1CA = -G^{-1} C and R=G−1BR = G^{-1} B. The block moments are the coefficients of H(s)=∑kMkskH(s) = \sum_k M_k s^k at s=0s = 0, Mk=LTAkRM_k = L^T A^k R (Neumann series of (I−sA)−1(I - sA)^{-1}, as for AWE). The block Krylov subspace of order qq is

Kq=span⁡{R,AR,…,Aq−1R},\mathcal K_q = \operatorname{span}\{ R, AR, \ldots, A^{q-1} R \},

the span of all columns of these qq blocks. PRIMA returns the columns X=[X0,…,Xq−1]X = [X_0, \ldots, X_{q-1}] and the reduced matrices G^=XTGX\hat G = X^T G X, C^=XTCX\hat C = X^T C X, B^=XTB\hat B = X^T B and L^=XTL\hat L = X^T L, with H^(s)=L^T(G^+sC^)−1B^\hat H(s) = \hat L^T (\hat G + s \hat C)^{-1} \hat B and reduced moments M^k=L^TA^kR^\hat M_k = \hat L^T \hat A^k \hat R, where A^=−G^−1C^\hat A = -\hat G^{-1} \hat C and R^=G^−1B^\hat R = \hat G^{-1} \hat B. The proofs are in exact arithmetic.

Theorem 1 (the basis). The columns of XX are orthonormal, and span⁡(X)=Kq\operatorname{span}(X) = \mathcal K_q. More precisely, span⁡(X0,…,Xk)=Kk+1\operatorname{span}(X_0, \ldots, X_k) = \mathcal K_{k+1} for each k<qk < q.

Proof. By induction on kk. Line L2 makes X0X_0 an orthonormal basis of the columns of RR, so the claim holds for k=0k = 0. Suppose span⁡(X0,…,Xk−1)=Kk\operatorname{span}(X_0, \ldots, X_{k-1}) = \mathcal K_k. Line L4 sets V=AXk−1V = A X_{k-1}. Since the columns of Xk−1X_{k-1} lie in Kk\mathcal K_k, those of VV lie in AKk⊆Kk+1A \mathcal K_k \subseteq \mathcal K_{k+1}. Conversely, Kk+1=Kk+span⁡(AkR)\mathcal K_{k+1} = \mathcal K_k + \operatorname{span}(A^k R). Since Ak−1R∈Kk=span⁡(X0,…,Xk−1)A^{k-1} R \in \mathcal K_k = \operatorname{span}(X_0, \ldots, X_{k-1}), the columns of AkRA^k R lie in the span of AX0,…,AXk−1A X_0, \ldots, A X_{k-1}. For j<k−1j < k - 1, the induction hypothesis gives AXj⊆AKj+1⊆Kj+2⊆KkA X_j \subseteq A \mathcal K_{j+1} \subseteq \mathcal K_{j+2} \subseteq \mathcal K_k. So AkRA^k R lies in Kk+span⁡(V)\mathcal K_k + \operatorname{span}(V), and Kk+1=Kk+span⁡(V)\mathcal K_{k+1} = \mathcal K_k + \operatorname{span}(V). Lines L5 and L6 subtract from VV its projection on Kk\mathcal K_k and take an orthonormal basis of the rest, dropping the columns that are dependent (deflation). This changes neither Kk+span⁡(V)\mathcal K_k + \operatorname{span}(V) nor the orthonormality of the whole set. If a whole block is dropped, then Kk+1=Kk\mathcal K_{k+1} = \mathcal K_k, the subspace is invariant under AA, all later Kj\mathcal K_j are equal to it, and the loop can stop. □\square

Theorem 2 (q block moments). If G^\hat G is invertible, then XA^kR^=AkRX \hat A^k \hat R = A^k R and M^k=Mk\hat M_k = M_k for k=0,…,q−1k = 0, \ldots, q - 1. The same holds for every XX of full column rank with Kq⊆span⁡(X)\mathcal K_q \subseteq \operatorname{span}(X); orthonormality is not needed.

Proof. We show XA^kR^=AkRX \hat A^k \hat R = A^k R by induction. For k=0k = 0: R∈KqR \in \mathcal K_q, so R=XZR = X Z for some ZZ. Then G^Z=XTGXZ=XTGR=XTB=B^\hat G Z = X^T G X Z = X^T G R = X^T B = \hat B, so Z=R^Z = \hat R and XR^=RX \hat R = R. For 1≤k≤q−11 \le k \le q - 1, let W=A^k−1R^W = \hat A^{k-1} \hat R, so XW=Ak−1RX W = A^{k-1} R by the induction hypothesis. Since AkR∈KqA^k R \in \mathcal K_q, AXW=AkR=XUA X W = A^k R = X U for some UU. Multiply GXU=GAXW=−CXWG X U = G A X W = -C X W by XTX^T: G^U=−C^W\hat G U = -\hat C W, so U=A^W=A^kR^U = \hat A W = \hat A^k \hat R. Hence XA^kR^=XU=AkRX \hat A^k \hat R = X U = A^k R. Finally M^k=L^TA^kR^=LTXA^kR^=LTAkR=Mk\hat M_k = \hat L^T \hat A^k \hat R = L^T X \hat A^k \hat R = L^T A^k R = M_k. □\square

The hypothesis that G^\hat G is invertible is needed. When G+GTG + G^T is positive definite, G^+G^T\hat G + \hat G^T is positive definite too and G^\hat G is invertible. When G+GTG + G^T is only semidefinite, as in the modified nodal form of an RLC circuit, G^\hat G can be singular although GG is not. Example: node voltages v0,v1,v2v_0, v_1, v_2 and inductor currents i0,i1i_0, i_1 of a ladder with a conductance 1 at node 0 only, capacitors 1 at all nodes and inductors 1 between nodes 0, 1 and 1, 2, with one port at node 0. Then RR is (1,1,1,0,0)(1, 1, 1, 0, 0) (at DC the inductors are shorts), AR=(−3,−3,−3,2,1)AR = (-3, -3, -3, 2, 1), and q=2q = 2 gives X0=(1,1,1,0,0)/3X_0 = (1, 1, 1, 0, 0)/\sqrt 3, X1=(0,0,0,2,1)/5X_1 = (0, 0, 0, 2, 1)/\sqrt 5 and G^=diag⁡(1/3,0)\hat G = \operatorname{diag}(1/3, 0). Here X1TGX1=0X_1^T G X_1 = 0 because GG has a zero block for the currents, and the off-diagonal entries are 0 because each column of the incidence block sums to 0.

Theorem 3 (2q block moments in the symmetric case). If GG and CC are symmetric, L=BL = B and G^\hat G is invertible, then M^k=Mk\hat M_k = M_k for k=0,…,2q−1k = 0, \ldots, 2q - 1.

Proof. Since GG is symmetric, BT=RTGB^T = R^T G, and ATG=−CG−1G=−C=GAA^T G = -C G^{-1} G = -C = G A. By induction, (Ai)TG=GAi(A^i)^T G = G A^i. So for i,j≥0i, j \ge 0,

Mi+j=RTGAiAjR=(AiR)TG(AjR),Mi+j+1=(AiR)TGA(AjR)=−(AiR)TC(AjR).M_{i+j} = R^T G A^i A^j R = (A^i R)^T G (A^j R), \qquad M_{i+j+1} = (A^i R)^T G A (A^j R) = -(A^i R)^T C (A^j R).

The reduced matrices G^\hat G and C^\hat C are symmetric and L^=B^\hat L = \hat B, so the same identities hold for M^\hat M with A^\hat A and R^\hat R. Let i,j≤q−1i, j \le q - 1. By Theorem 2, AiR=XA^iR^A^i R = X \hat A^i \hat R and AjR=XA^jR^A^j R = X \hat A^j \hat R, so

Mi+j=(A^iR^)TXTGX(A^jR^)=M^i+j,Mi+j+1=−(A^iR^)TXTCX(A^jR^)=M^i+j+1.M_{i+j} = (\hat A^i \hat R)^T X^T G X (\hat A^j \hat R) = \hat M_{i+j}, \qquad M_{i+j+1} = -(\hat A^i \hat R)^T X^T C X (\hat A^j \hat R) = \hat M_{i+j+1}.

The values i+ji + j and i+j+1i + j + 1 with i,j≤q−1i, j \le q - 1 cover 0,…,2q−10, \ldots, 2q - 1. □\square

For one port (p=1p = 1) with GG, CC symmetric and L=BL = B, the reduced model is a rational function with numerator degree at most q−1q - 1 and denominator degree at most qq that matches 2q2q moments. So it is the Padé approximation of AWE, which is unique when its Hankel matrix is invertible. For an RC circuit with GG positive definite this Padé model is therefore stable, by Theorem 6.

Theorem 4 (full order). If XX has nn columns, then H^=H\hat H = H.

Proof. Then XX is an orthogonal n×nn \times n matrix, and G^+sC^=XT(G+sC)X\hat G + s \hat C = X^T (G + sC) X, so (G^+sC^)−1=XT(G+sC)−1X(\hat G + s \hat C)^{-1} = X^T (G + sC)^{-1} X wherever either side exists, and L^T(G^+sC^)−1B^=LTXXT(G+sC)−1XXTB=H(s)\hat L^T (\hat G + s\hat C)^{-1} \hat B = L^T X X^T (G + sC)^{-1} X X^T B = H(s). □\square

Theorem 5 (passivity). Suppose G+GTG + G^T is positive semidefinite, CC is symmetric positive semidefinite and L=BL = B. Then G^+G^T\hat G + \hat G^T and C^\hat C have the same properties and L^=B^\hat L = \hat B. For every ss with Re⁡s>0\operatorname{Re} s > 0 at which G^+sC^\hat G + s \hat C is invertible, the Hermitian part 12(H^(s)+H^(s)H)\tfrac12 (\hat H(s) + \hat H(s)^H) is positive semidefinite, and H^(sˉ)=H^(s)‾\hat H(\bar s) = \overline{\hat H(s)}.

Proof. zT(G^+G^T)z=(Xz)T(G+GT)(Xz)≥0z^T (\hat G + \hat G^T) z = (Xz)^T (G + G^T)(Xz) \ge 0, C^T=C^\hat C^T = \hat C and zTC^z=(Xz)TC(Xz)≥0z^T \hat C z = (Xz)^T C (Xz) \ge 0, and L^=XTB=B^\hat L = X^T B = \hat B. Now fix ss and a complex vector ww, and let ξ=(G^+sC^)−1B^w\xi = (\hat G + s \hat C)^{-1} \hat B w. Then wHH^(s)w=(B^w)Hξ=((G^+sC^)ξ)Hξ=ξH(G^T+sˉC^)ξw^H \hat H(s) w = (\hat B w)^H \xi = ((\hat G + s\hat C) \xi)^H \xi = \xi^H (\hat G^T + \bar s \hat C) \xi, using that the matrices are real. The real part of this is

12ξH(G^+G^T)ξ+Re⁡(s) ξHC^ξ≥0,\tfrac12 \xi^H (\hat G + \hat G^T) \xi + \operatorname{Re}(s) \, \xi^H \hat C \xi \ge 0,

since ξHMξ=Re⁡(ξ)TMRe⁡(ξ)+Im⁡(ξ)TMIm⁡(ξ)\xi^H M \xi = \operatorname{Re}(\xi)^T M \operatorname{Re}(\xi) + \operatorname{Im}(\xi)^T M \operatorname{Im}(\xi) for a real symmetric MM. The real part of wHH^ww^H \hat H w is 12wH(H^+H^H)w\tfrac12 w^H (\hat H + \hat H^H) w. The last claim holds because all matrices are real. □\square

This is the positive-real condition of a passive multiport, here on the set where H^\hat H is defined. The same computation with X=IX = I shows that the original circuit has the property, so the theorem says that the congruence transform keeps it.

Theorem 6 (poles). Under the hypotheses of Theorem 5, if G^\hat G is invertible, every pole of H^\hat H, that is every λ\lambda with det⁡(G^+λC^)=0\det(\hat G + \lambda \hat C) = 0, has Re⁡λ≤0\operatorname{Re} \lambda \le 0. If moreover G+GTG + G^T is positive definite, then Re⁡λ<0\operatorname{Re} \lambda < 0. If GG and CC are symmetric and GG is positive definite, the poles are real and negative.

Proof. Let (G^+λC^)z=0(\hat G + \lambda \hat C) z = 0 with z≠0z \ne 0. Then zHG^z+λzHC^z=0z^H \hat G z + \lambda z^H \hat C z = 0, and the real part gives 12zH(G^+G^T)z+Re⁡(λ) zHC^z=0\tfrac12 z^H (\hat G + \hat G^T) z + \operatorname{Re}(\lambda) \, z^H \hat C z = 0. If zHC^z=0z^H \hat C z = 0, then C^z=0\hat C z = 0 because C^\hat C is positive semidefinite, so G^z=0\hat G z = 0, which is impossible for invertible G^\hat G. So zHC^z>0z^H \hat C z > 0 and Re⁡λ=−12zH(G^+G^T)z/zHC^z≤0\operatorname{Re} \lambda = -\tfrac12 z^H (\hat G + \hat G^T) z / z^H \hat C z \le 0. If G+GTG + G^T is positive definite, so is G^+G^T\hat G + \hat G^T (as XX has full column rank), and the inequality is strict. In the symmetric case, λ=−zHG^z/zHC^z\lambda = -z^H \hat G z / z^H \hat C z is a ratio of real numbers, negative when G^\hat G is positive definite. □\square

Theorem 7 (running time). With dense matrices and k≤qpk \le qp columns in XX, PRIMA takes Θ(n3)\Theta(n^3) for the LU factorization of GG, Θ(kn2)\Theta(k n^2) for the solves and the products with CC in lines L1 and L4, Θ(k2n)\Theta(k^2 n) for the Gram-Schmidt steps of lines L2, L5 and L6, and Θ(kn2+k2n)\Theta(k n^2 + k^2 n) for line L8. It uses Θ(n2+kn)\Theta(n^2 + k n) extra space.

Proof. Each of the kk columns is produced by one product with CC and two triangular solves, Θ(n2)\Theta(n^2), and is orthogonalized twice against at most kk earlier columns, Θ(kn)\Theta(k n) each. Line L8 forms GXG X and CXC X in Θ(kn2)\Theta(k n^2) and the k2k^2 inner products in Θ(k2n)\Theta(k^2 n). The LU factors take Θ(n2)\Theta(n^2) space and XX takes Θ(kn)\Theta(kn). □\square

■\blacksquare

Complexity

  • Time. One LU factorization of GG takes Θ(n3)\Theta(n^3) for dense matrices. Each of the k≤qpk \le qp basis vectors costs a product with CC and two triangular solves, Θ(n2)\Theta(n^2), and two Gram-Schmidt passes against at most kk vectors, Θ(kn)\Theta(k n). The congruence takes Θ(kn2+k2n)\Theta(k n^2 + k^2 n). In total Θ(n3+kn2+k2n)\Theta(n^3 + k n^2 + k^2 n). For sparse circuits, the factorization and the products cost about the number of nonzero entries of the factors and of CC instead.
  • Space. The factors of GG and the kk basis vectors, Θ(n2+kn)\Theta(n^2 + k n) for dense matrices.
  • Compared with AWE. The same number of solves with GG gives the same Krylov subspace. AWE forms the moments directly, which is ill-conditioned for larger qq, while PRIMA keeps an orthonormal basis, which is stable in floating point.

Properties

  • Passive. The reduced model of an RLC circuit with L=BL = B is passive, so it can be connected to other passive or active parts in a simulator.
  • Half the moments of Padé. In general qq block moments are matched where a Padé model of the same order matches 2q2q. For symmetric GG and CC the count is 2q2q again.
  • Not a realizable netlist. The reduced matrices are dense and have no direct circuit form. Turning them into resistors and capacitors needs extra work.
  • Order grows with ports. Each block has pp columns, so a model with many ports is large even for small qq.
  • Numerically stable. With reorthogonalization, the basis stays orthonormal to rounding error, so larger orders work, unlike AWE.

Variants and improvements

  • Expansion points. Use G+s0CG + s_0 C in place of GG for an s0>0s_0 > 0 to match moments at s0s_0, which avoids a singular GG and gives better accuracy at high frequency. Several points can be combined in one basis (multi-point or rational Krylov methods).
  • PVL and SyPVL. Padé via Lanczos of Feldmann and Freund computes the Padé model with a Lanczos process. It matches 2q2q moments, but the model need not be passive. Symmetric variants for RC circuits keep passivity.
  • Structure-preserving reduction. Split XX by the blocks of the unknowns (voltages and currents) before the congruence. The model then keeps the RLC structure and, in some methods, matches more moments.
  • Balanced truncation. Balanced truncation has an a priori error bound but costs Θ(n3)\Theta(n^3) for Lyapunov equations, too much for large circuits. Positive-real balanced truncation keeps passivity.

When to use it

  • To make small passive models of large RC or RLC interconnect networks for circuit simulation, timing and signal integrity analysis.
  • When the model must be connected back to a simulator, where a non-passive model can create a growing response.
  • Not when the number of ports is very large compared with the useful order, and not when a guaranteed error bound is needed.

Pitfalls

  • L≠BL \ne B. Passivity is proved only for L=BL = B. A model of a transfer from one node to another (a voltage gain, not an impedance) has no such guarantee.
  • Singular G^\hat G. For an RLC circuit, G^\hat G can be singular although GG is not. The proof gives an example: an LC ladder with one conductance and q=2q = 2 gives G^=diag⁡(1/3,0)\hat G = \operatorname{diag}(1/3, 0), so the model has a pole at s=0s = 0 and does not match the moments. An expansion point s0>0s_0 > 0 avoids this.
  • Loss of orthogonality. One Gram-Schmidt pass loses orthogonality after many steps. The proofs need the exact span, so reorthogonalize, and drop vectors that are nearly dependent.
  • Breaking the congruence. Using a different basis on the left, or scaling the rows, keeps the moments but not passivity.

Implementations

Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.

prima.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/prima/. The authors are listed in prov/KQ4G00.jsonl.

import math
from typing import NamedTuple, Sequence


class ReducedModel(NamedTuple):
    G: list  # k x k, X^T G X
    C: list  # k x k, X^T C X
    B: list  # k x p, X^T B
    L: list  # k x r, X^T L
    X: list  # the k orthonormal basis vectors (each of length n)


def lu_factor(A: Sequence[Sequence]) -> tuple:
    """LU factorization with partial pivoting. Works for float and complex entries."""
    n = len(A)
    M = [list(row) for row in A]
    perm = list(range(n))
    for c in range(n):
        p = max(range(c, n), key=lambda r: abs(M[r][c]))
        if M[p][c] == 0:
            raise ValueError("singular matrix")
        M[c], M[p] = M[p], M[c]
        perm[c], perm[p] = perm[p], perm[c]
        for r in range(c + 1, n):
            f = M[r][c] / M[c][c]
            M[r][c] = f
            if f != 0:
                for k in range(c + 1, n):
                    M[r][k] -= f * M[c][k]
    return M, perm


def lu_solve(factor: tuple, rhs: Sequence) -> list:
    M, perm = factor
    n = len(M)
    y = [rhs[perm[i]] for i in range(n)]
    for i in range(n):
        for k in range(i):
            y[i] -= M[i][k] * y[k]
    for i in range(n - 1, -1, -1):
        for k in range(i + 1, n):
            y[i] -= M[i][k] * y[k]
        y[i] /= M[i][i]
    return y


def dot(u: Sequence, v: Sequence) -> float:
    return sum(a * b for a, b in zip(u, v))


def matvec(A: Sequence[Sequence], x: Sequence) -> list:
    return [dot(row, x) for row in A]


def columns(B: Sequence[Sequence]) -> list:
    return [[row[j] for row in B] for j in range(len(B[0]))]


def project_out(v: list, block: list) -> list:
    """v minus its components along the orthonormal vectors of block, one at a time."""
    for x in block:
        h = dot(x, v)
        v = [a - h * b for a, b in zip(v, x)]
    return v


def orthonormalize(vectors: list, basis: list, scales=None, tol: float = 1e-10) -> list:
    """Modified Gram-Schmidt of vectors against basis and against each other.

    Each vector is orthogonalized twice. A vector whose norm falls below tol
    times its scale (by default its own norm) is dropped (deflation).
    Returns the new unit vectors.
    """
    out = []
    for i, v in enumerate(vectors):
        v = [float(x) for x in v]
        first = math.sqrt(dot(v, v)) if scales is None else scales[i]
        if first == 0.0:
            continue
        for _ in range(2):
            for x in basis + out:
                h = dot(x, v)
                v = [a - h * b for a, b in zip(v, x)]
        norm = math.sqrt(dot(v, v))
        if norm > tol * first:
            out.append([a / norm for a in v])
    return out


def prima(G, C, B, L, q: int) -> ReducedModel:
    """PRIMA: congruence projection of (G + sC) x = B u, y = L^T x onto the block Krylov
    subspace span{R, AR, ..., A^(q-1) R}, with A = -G^{-1} C and R = G^{-1} B.

    G, C are n x n, B is n x p and L is n x r (lists of rows). With L = B,
    G + G^T positive semidefinite and C symmetric positive semidefinite, the
    reduced model is passive.
    """
    if q < 1:
        raise ValueError("q must be at least 1")
    factor = lu_factor([[float(x) for x in row] for row in G])
    R = [lu_solve(factor, [float(x) for x in b]) for b in columns(B)]  # @line L1
    blocks = [orthonormalize(R, [])]  # @line L2
    basis = list(blocks[0])
    for _ in range(1, q):  # @line L3
        if not blocks[-1]:
            break  # the Krylov subspace is invariant: nothing new to add
        V = [lu_solve(factor, [-x for x in matvec(C, v)]) for v in blocks[-1]]  # @line L4
        scales = [math.sqrt(dot(v, v)) for v in V]
        for Xj in blocks:
            V = [project_out(v, Xj) for v in V]  # @line L5
        new = orthonormalize(V, basis, scales)  # @line L6
        blocks.append(new)
        basis.extend(new)
    X = basis  # @line L7
    GX = [matvec(G, x) for x in X]
    CX = [matvec(C, x) for x in X]
    Gr = [[dot(X[i], GX[j]) for j in range(len(X))] for i in range(len(X))]  # @line L8
    Cr = [[dot(X[i], CX[j]) for j in range(len(X))] for i in range(len(X))]
    Br = [[dot(x, b) for b in columns(B)] for x in X]
    Lr = [[dot(x, c) for c in columns(L)] for x in X]
    return ReducedModel(Gr, Cr, Br, Lr, X)  # @line L9


def transfer(G, C, B, L, s: complex) -> list:
    """H(s) = L^T (G + sC)^{-1} B, an r x p complex matrix."""
    n = len(G)
    factor = lu_factor([[G[i][j] + s * C[i][j] for j in range(n)] for i in range(n)])
    X = [lu_solve(factor, [complex(x) for x in b]) for b in columns(B)]
    return [[dot(l, x) for x in X] for l in columns(L)]


def block_moments(G, C, B, L, count: int) -> list:
    """M_k = L^T (-G^{-1} C)^k G^{-1} B for k = 0 .. count-1, in floating point."""
    factor = lu_factor([[float(x) for x in row] for row in G])
    X = [lu_solve(factor, [float(x) for x in b]) for b in columns(B)]
    out = []
    for _ in range(count):
        out.append([[dot(l, x) for x in X] for l in columns(L)])
        X = [lu_solve(factor, [-x for x in matvec(C, v)]) for v in X]
    return out


def polyval(c: Sequence, s):
    v = 0
    for x in reversed(c):
        v = v * s + x
    return v


def durand_kerner(c: Sequence, iterations: int = 4000) -> list:
    """All complex roots of the polynomial with coefficients c (c[k] of s^k)."""
    c = [complex(x) for x in c]
    while c and c[-1] == 0:
        c.pop()
    deg = len(c) - 1
    if deg < 1:
        return []
    monic = [x / c[-1] for x in c]
    radius = 1.0 + max(abs(x) for x in monic[:-1])
    z = [radius * (0.4 + 0.9j) ** k for k in range(deg)]
    for _ in range(iterations):
        change = 0.0
        for i in range(deg):
            den = 1.0
            for j in range(deg):
                if j != i:
                    den *= z[i] - z[j]
            step = polyval(monic, z[i]) / den
            z[i] -= step
            change = max(change, abs(step))
        if change <= 1e-15 * radius:
            break
    return z


def poles(Gr, Cr) -> list:
    """The finite poles of (Gr + s Cr)^{-1}: s = -1/mu for the non-zero eigenvalues mu of Gr^{-1} Cr.

    The characteristic polynomial comes from the Faddeev-LeVerrier recurrence
    and its roots from Durand-Kerner, so this is meant for small orders only.
    """
    k = len(Gr)
    factor = lu_factor(Gr)
    cols = [lu_solve(factor, c) for c in columns(Cr)]
    M = [[cols[j][i] for j in range(k)] for i in range(k)]
    coeffs = [0.0] * (k + 1)  # det(mu I - M) = sum coeffs[i] mu^i
    coeffs[k] = 1.0
    N = [[float(i == j) for j in range(k)] for i in range(k)]
    for m in range(1, k + 1):
        MN = [[dot(M[i], [N[r][j] for r in range(k)]) for j in range(k)] for i in range(k)]
        c = -sum(MN[i][i] for i in range(k)) / m
        coeffs[k - m] = c
        N = [[MN[i][j] + (c if i == j else 0.0) for j in range(k)] for i in range(k)]
    scale = max(abs(x) for x in coeffs)
    mus = durand_kerner(coeffs)
    out = []
    for mu in mus:
        if abs(mu) <= 1e-12 * scale:
            continue
        s = -1.0 / mu
        # Newton polishing on det(Gr + s Cr): d/ds log det = trace((Gr + s Cr)^{-1} Cr).
        for _ in range(3):
            try:
                f = lu_factor([[Gr[i][j] + s * Cr[i][j] for j in range(k)] for i in range(k)])
            except ValueError:
                break  # s is an exact pole
            t = sum(lu_solve(f, [complex(x) for x in c])[i] for i, c in enumerate(columns(Cr)))
            if t == 0:
                break
            s -= 1.0 / t
        out.append(s)
    return out
test_prima.py 273 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/prima/. The authors are listed in prov/KQ4G00.jsonl.

import random
from fractions import Fraction

import pytest

from prima import block_moments, lu_factor, poles, prima, transfer


def rc_tree(parent, R, C, ports):
    """Nodal G, C of an RC tree with a resistor R[root] from the root to ground.

    Port j injects a current at node ports[j] and observes its voltage (L = B)."""
    n = len(parent)
    G = [[Fraction(0)] * n for _ in range(n)]
    Cm = [[Fraction(0)] * n for _ in range(n)]
    for i in range(n):
        g = 1 / Fraction(R[i])
        Cm[i][i] = Fraction(C[i])
        G[i][i] += g
        if parent[i] >= 0:
            p = parent[i]
            G[p][p] += g
            G[i][p] -= g
            G[p][i] -= g
    B = [[Fraction(int(i == k)) for k in ports] for i in range(n)]
    return G, Cm, B


def rlc_ladder(g, c, r, ind, ports):
    """Modified nodal analysis of an RLC ladder.

    Node k has a conductance g[k] and a capacitor c[k] to ground. Branch j joins
    node j and node j + 1 by a resistor r[j] in series with an inductor ind[j].
    The unknowns are the n node voltages and the n - 1 branch currents, and
    G = [[N, E], [-E^T, Rb]], C = diag(c, ind), so G + G^T >= 0 and C >= 0."""
    n = len(g)
    m = n - 1
    size = n + m
    G = [[Fraction(0)] * size for _ in range(size)]
    Cm = [[Fraction(0)] * size for _ in range(size)]
    for k in range(n):
        G[k][k] = Fraction(g[k])
        Cm[k][k] = Fraction(c[k])
    for j in range(m):
        a, b, row = j, j + 1, n + j
        G[a][row] += 1
        G[b][row] -= 1
        G[row][a] -= 1
        G[row][b] += 1
        G[row][row] = Fraction(r[j])
        Cm[row][row] = Fraction(ind[j])
    B = [[Fraction(int(i == k)) for k in ports] for i in range(size)]
    return G, Cm, B


def exact_solve(A, rhs):
    n = len(A)
    M = [list(row) + [rhs[i]] for i, row in enumerate(A)]
    for col in range(n):
        p = next(r for r in range(col, n) if M[r][col] != 0)
        M[col], M[p] = M[p], M[col]
        for r in range(n):
            if r != col and M[r][col] != 0:
                f = M[r][col] / M[col][col]
                M[r] = [x - f * y for x, y in zip(M[r], M[col])]
    return [M[i][n] / M[i][i] for i in range(n)]


def exact_moments(G, C, B, count):
    """Brute force: M_k = B^T (-G^{-1} C)^k G^{-1} B in exact arithmetic."""
    n = len(G)
    cols = [[B[i][j] for i in range(n)] for j in range(len(B[0]))]
    X = [exact_solve(G, b) for b in cols]
    out = []
    for _ in range(count):
        out.append([[sum(l[i] * x[i] for i in range(n)) for x in X] for l in cols])
        X = [exact_solve(G, [-sum(C[i][j] * v[j] for j in range(n)) for i in range(n)]) for v in X]
    return out


def close(A, B, rel):
    scale = max(abs(x) for row in B for x in row)
    return all(abs(a - b) <= rel * scale for ra, rb in zip(A, B) for a, b in zip(ra, rb))


def reduced_moments(model, count):
    return block_moments(model.G, model.C, model.B, model.L, count)


def random_ladder(rng, n):
    return [-1] + list(range(n - 1)), [rng.randint(1, 9) for _ in range(n)], [rng.randint(1, 9) for _ in range(n)]


def test_rc_ladders_match_q_and_2q_moments():
    rng = random.Random(1)
    for n in range(3, 7):
        parent, R, C = random_ladder(rng, n)
        G, Cm, B = rc_tree(parent, R, C, [0])
        exact = exact_moments(G, Cm, B, 2 * n)
        for q in range(1, n):
            model = prima(G, Cm, B, B, q)
            got = reduced_moments(model, 2 * q + 1)
            for k in range(2 * q):  # G and C are symmetric and L = B: 2q moments
                assert close(got[k], [[float(x) for x in row] for row in exact[k]], 1e-9), (n, q, k)
            # The next moment is not matched in general.
            if q == 1:
                assert not close(got[2], [[float(x) for x in row] for row in exact[2]], 1e-6)


def pade(m, q):
    """Exact [q-1/q] Pade approximation from the moments m_0 .. m_{2q-1}: (P, Q) with Q(0) = 1."""
    hankel = [[m[k - j] for j in range(1, q + 1)] for k in range(q, 2 * q)]
    den = [Fraction(1)] + exact_solve(hankel, [-m[k] for k in range(q, 2 * q)])
    num = [sum(den[j] * m[k - j] for j in range(k + 1)) for k in range(q)]
    return num, den


def test_one_port_rc_model_is_the_pade_approximation():
    # Rational of type (q-1, q) matching 2q moments: the Pade approximation, which is unique.
    rng = random.Random(7)
    for _ in range(20):
        n = rng.randint(3, 6)
        parent = [-1] + [rng.randrange(i) for i in range(1, n)]
        G, Cm, B = rc_tree(parent, [rng.randint(1, 9) for _ in range(n)], [rng.randint(1, 9) for _ in range(n)],
                           [rng.randrange(n)])
        m = [row[0][0] for row in exact_moments(G, Cm, B, 2 * n)]
        for q in range(1, n):
            P, Q = pade(m, q)
            model = prima(G, Cm, B, B, q)
            for s in (0.2, 1j, 1 + 1j):
                hr = transfer(model.G, model.C, model.B, model.L, s)[0][0]
                h = sum(complex(a) * s ** k for k, a in enumerate(P)) / sum(complex(b) * s ** k for k, b in enumerate(Q))
                assert abs(hr - h) <= 1e-7 * abs(h)


def test_rlc_and_multiport_match_q_block_moments():
    rng = random.Random(2)
    for n in range(3, 6):
        g = [Fraction(rng.randint(1, 5), 10) for _ in range(n)]
        c = [rng.randint(1, 5) for _ in range(n)]
        r = [Fraction(rng.randint(1, 5), 10) for _ in range(n - 1)]
        ind = [rng.randint(1, 5) for _ in range(n - 1)]
        for ports in ([0], [0, n - 1]):
            G, Cm, B = rlc_ladder(g, c, r, ind, ports)
            size = len(G)
            exact = exact_moments(G, Cm, B, 2 * size)
            for q in range(1, size // len(ports)):
                model = prima(G, Cm, B, B, q)
                assert len(model.X) == q * len(ports)
                got = reduced_moments(model, q)
                for k in range(q):
                    assert close(got[k], [[float(x) for x in row] for row in exact[k]], 1e-8), (n, ports, q, k)


def test_basis_is_orthonormal_and_deflates():
    rng = random.Random(3)
    parent, R, C = random_ladder(rng, 6)
    G, Cm, B = rc_tree(parent, R, C, [0, 5])
    model = prima(G, Cm, B, B, 3)
    X = model.X
    assert len(X) == 6
    for i in range(len(X)):
        for j in range(len(X)):
            assert abs(sum(a * b for a, b in zip(X[i], X[j])) - (i == j)) < 1e-12
    # Two equal ports span one direction only, and q p > n stops at n vectors.
    G, Cm, B = rc_tree(parent, R, C, [2, 2])
    assert len(prima(G, Cm, B, B, 1).X) == 1
    G, Cm, B = rc_tree(parent, R, C, [0])
    assert len(prima(G, Cm, B, B, 10).X) == 6


def test_full_order_gives_the_same_transfer_function():
    rng = random.Random(4)
    for _ in range(10):
        n = rng.randint(3, 6)
        parent = [-1] + [rng.randrange(i) for i in range(1, n)]
        G, Cm, B = rc_tree(parent, [rng.randint(1, 9) for _ in range(n)], [rng.randint(1, 9) for _ in range(n)], [0])
        model = prima(G, Cm, B, B, n)
        for s in (0.1, 1j, 0.3 + 2j, 5.0):
            h = transfer(G, Cm, B, B, s)[0][0]
            hr = transfer(model.G, model.C, model.B, model.L, s)[0][0]
            assert abs(h - hr) <= 1e-9 * abs(h)


def det(A):
    try:
        M, perm = lu_factor(A)
    except ValueError:
        return 0.0  # a zero column during elimination: exactly singular
    sign = 1
    p = list(perm)
    for i in range(len(p)):
        while p[i] != i:
            j = p[i]
            p[i], p[j] = p[j], p[i]
            sign = -sign
    out = sign
    for i in range(len(M)):
        out *= M[i][i]
    return out


def test_poles_in_the_left_half_plane():
    rng = random.Random(5)
    for trial in range(40):
        n = rng.randint(3, 5)
        if trial % 2 == 0:
            parent = [-1] + [rng.randrange(i) for i in range(1, n)]
            G, Cm, B = rc_tree(parent, [rng.randint(1, 9) for _ in range(n)],
                               [rng.randint(1, 9) for _ in range(n)], [0])
        else:
            G, Cm, B = rlc_ladder([Fraction(rng.randint(1, 5), 10) for _ in range(n)],
                                  [rng.randint(1, 5) for _ in range(n)],
                                  [Fraction(rng.randint(0, 5), 10) for _ in range(n - 1)],
                                  [rng.randint(1, 5) for _ in range(n - 1)], [0])
        q = rng.randint(1, len(G) - 1)
        model = prima(G, Cm, B, B, q)
        ps = poles(model.G, model.C)
        assert len(ps) == len(model.X)  # the reduced C is non-singular here
        for p in ps:
            assert p.real < 0
            # p is a root of det(G_r + p C_r), relative to Hadamard's bound on the determinant
            k = len(model.G)
            M = [[model.G[i][j] + p * model.C[i][j] for j in range(k)] for i in range(k)]
            hadamard = 1.0
            for i in range(k):
                hadamard *= sum((abs(model.G[i][j]) + abs(p) * abs(model.C[i][j])) ** 2 for j in range(k)) ** 0.5
            assert abs(det(M)) <= 1e-10 * hadamard
            if trial % 2 == 0:
                assert abs(p.imag) <= 1e-7 * abs(p)  # symmetric RC: real poles


def test_rlc_model_is_positive_real():
    rng = random.Random(6)
    g = [Fraction(1, 10), Fraction(0), Fraction(0), Fraction(1, 20)]
    c = [1, 2, 1, 3]
    r = [Fraction(1, 10), Fraction(0), Fraction(1, 5)]
    ind = [2, 1, 3]
    G, Cm, B = rlc_ladder(g, c, r, ind, [0, 3])
    for q in (1, 2, 3):
        model = prima(G, Cm, B, B, q)
        for _ in range(200):
            s = complex(rng.uniform(0.0, 3.0), rng.uniform(-5.0, 5.0))
            H = transfer(model.G, model.C, model.B, model.L, s)
            # Hermitian part of a 2 x 2 matrix: positive semidefinite
            h11 = H[0][0].real
            h22 = H[1][1].real
            h12 = (H[0][1] + H[1][0].conjugate()) / 2
            assert h11 >= -1e-9 and h22 >= -1e-9
            assert h11 * h22 - abs(h12) ** 2 >= -1e-9


def test_reduced_g_can_be_singular_for_rlc():
    # LC ladder with one conductance: G is invertible, but X^T G X is diag(1/3, 0).
    G, Cm, B = rlc_ladder([1, 0, 0], [1, 1, 1], [0, 0], [1, 1], [0])
    assert lu_factor([[float(x) for x in row] for row in G])
    model = prima(G, Cm, B, B, 2)
    s3, s5 = 3 ** -0.5, 5 ** -0.5
    assert model.X[0] == pytest.approx([s3, s3, s3, 0, 0], abs=1e-12)
    assert model.X[1] == pytest.approx([0, 0, 0, 2 * s5, s5], abs=1e-12)
    assert model.G[0][0] == pytest.approx(1 / 3, abs=1e-12)
    assert max(abs(model.G[0][1]), abs(model.G[1][0]), abs(model.G[1][1])) < 1e-12


def test_errors():
    G, Cm, B = rc_tree([-1], [1], [1], [0])
    with pytest.raises(ValueError):
        prima(G, Cm, B, B, 0)
    with pytest.raises(ValueError):
        lu_factor([[0.0, 0.0], [0.0, 1.0]])

History

Moment matching for interconnect started with AWE (Pillage and Rohrer, 1990), which forms the moments directly and can give unstable models. Feldmann and Freund (1995) computed the same Padé model stably with a Lanczos process (PVL), but its models need not be passive. Odabasioglu, Celik and Pileggi presented PRIMA at ICCAD 1997 and in IEEE TCAD in 1998: block Arnoldi with a congruence transform, with a proof that the reduced model is passive.

References

  1. Altan Odabasioglu, Mustafa Celik and Lawrence T. Pileggi, PRIMA: passive reduced-order interconnect macromodeling algorithm, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 17(8), 645 to 654, 1998, the block Arnoldi algorithm, the congruence transform, the theorem on the matched block moments and the proof of passivity for RLC circuits in modified nodal form
  2. Altan Odabasioglu, Mustafa Celik and Lawrence T. Pileggi, PRIMA: passive reduced-order interconnect macromodeling algorithm, Proceedings of the IEEE/ACM International Conference on Computer-Aided Design, 58 to 65, 1997, the conference version
  3. Peter Feldmann and Roland W. Freund, Efficient linear circuit analysis by Padé approximation via the Lanczos process, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 14(5), 639 to 649, 1995, PVL, the Padé model from the Lanczos process, which matches 2q moments but does not keep passivity

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH1 sketch
  • a full proof of correctness
  • a full proof of time.average
  • a full proof of time.best
  • a full proof of time.worst
  • a full proof of space.extra
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
Code (python)I0 not checked yet
  • the tests did not run in this build
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a scene preset for the example