Manuscript Offprint
arXiv:2610.12654Symbolic-Permutation-Based Direct Sparse Jacobian Assembly for Accelerated Power-Flow Analysis
Tianshi Cheng, Member, IEEE, and Venkata Dinavahi, Fellow, IEEE
This work has been submitted to the IEEE for possible publication. Copyright may be transferred without notice, after which this version may no longer be accessible.
Abstract—The repeated assembly of the sparse Jacobian matrix constitutes a primary computational bottleneck in the Newton–Raphson power-flow analysis. Through an algebraic equivariance analysis of the Jacobian matrix, this paper proposes a direct sparse Jacobian assembly method based on symbolic permutation. By pre-applying the permutation to the admittance matrix during a one-time symbolic phase, the runtime bus-type projection overhead is entirely eliminated. Consequently, complex Jacobian differentiation and global matrix assembly fuse into a single operation, yielding a single-pass, branchless algorithm that streams values directly into contiguous memory. The framework is realized in the open-source RustPower solver. Benchmarks on IEEE test systems and PEGASE 9241 demonstrate that the proposed assembly is faster than the MATPOWER-style baseline and faster than the Schäfer–Braun optimized assembly. End-to-end, the grid-level solve time is faster than pandapower 3.5.4 with Numba, while leaving numerical results and convergence behavior unchanged. Compared with the native C++ LightSim2Grid 1.0.0, grid-level performance is comparable on IEEE 39 and faster on IEEE 118 and the PEGASE systems. The method extends directly to general problems where a sparse Jacobian inherits its structure from a static network operator, including transient stability analysis, EMT simulation, and OPF Hessian assembly.
Index Terms—Power flow, Newton–Raphson method, Jacobian matrix, sparse matrices, symbolic analysis, compressed sparse column, data-oriented design, high-performance computing.
NOMENCLATURE
n, b
Number of buses; number of branches.
A
Branch-bus incidence matrix.
Primitive branch admittance; nodal admittance matrix.
Complex bus voltage and injected-current vectors.
Bus voltage magnitude and angle vectors.
Unit-modulus voltage, .
Complex bus power injection, .
Specified (scheduled) bus power injection.
State vector of unknowns; full 2n state.
Power-mismatch (residual) vector.
Newton–Raphson iteration index.
Full and bus-type-reduced power-flow Jacobian.
Reduction slicer .
Orthogonal bus-type permutation matrix.
struct( )
Boolean (0/1) sparsity matrix of a matrix.
Boolean sparsity matrices of and .
Number of PV and PQ buses.
, the reduced-system dimension.
NR
Newton–Raphson.
CSC, CSR
Compressed sparse column / row storage.
ECS
Entity–component–system.
factorization becomes numerically unstable, the inner linear system may instead be solved by preconditioned GMRES or BiCGStab [4], [5]; however, the pre-conditioner still requires the explicit Jacobian structure, and for standard benchmarks these Newton–Krylov variants remain slower than a well-tuned direct solver, leaving LU-based NR as the workhorse in practice. Robustness extensions—Iwamoto–Tamura damping [6], Levenberg–Marquardt regularization [7], [8], and continuous Newton methods [9], [10]—addressed convergence fragility at the cost of more outer iterations and hence more frequent Jacobian evaluations.
Consequently, the assembly of the Jacobian matrix—an indispensable step in every Newton-based iteration—has superseded sparse factorization as the dominant computational cost. Classical textbooks often formulated the Jacobian by element-wise differentiation of the scalar polar power-flow equations, incurring transcendental function evaluations and tedious index bookkeeping for each entry [11]. Zimmerman et al. [12] revolutionized this practice by maintaining the algebraic integrity of the network entirely in the complex domain through Wirtinger Calculus. The resulting matrix-differential formulation collapses the transcendental burden from a traditional element-wise sweep to a single vector map per iteration, and it became the foundational paradigm for modern power-flow software. This complex-domain approach was ported to Python as PYPOWER [13], extended into an object-oriented modeling environment in pandapower [14], and reimplemented with a C++/Eigen backend.
This work was supported by the Natural Sciences and Engineering Research Council of Canada (NSERC) and Mitacs.
The original manuscript was submitted in May 2026. This preprint includes updated results.
T. Cheng is with the RTDS Technologies Inc., Winnipeg, MB R3T 2E1, Canada, and V. Dinavahi is with the Department of Electrical and Computer Engineering, University of Alberta, Edmonton, AB T6G 2V4, Canada (e-mail: tcheng1@ualberta.ca; dinavahi@ualberta.ca).
in LightSim2Grid [15] for native speed.
In 2018, Schäfer and Braun [16] were among the first to systematically identify the Jacobian-assembly bottleneck, replacing MATPOWER's block-stacking pipeline with an optimized CSR formation fused by Numba JIT compilation, reporting 3–14× assembly speedups compared to MATPOWER. The C++ LightSim2Grid [15] also adopted a similar element-level assembly approach. Subsequent work has pushed the parallel frontier: heterogeneous CPU–GPU solvers exploit invariant sparsity across ensemble members to amortize symbolic factorization over thousands of N–1 or Monte-Carlo cases [17]–[19] as well as large-scale optimization problems [20].
Yet all of these works and advances—whether in MATLAB, Python, C++, or CUDA—share a common architectural pitfall: they remain trapped in the three-step “differentiate, partition, assemble” pipeline of Jacobian assembly for Newton iteration methods. Differentiation evaluates full complex sensitivities with thousands of unused computations of PV and slack buses; partitioning scatters entries through pointer-chasing and dynamic indexing; assembly allocates temporary blocks and copies them into the global Jacobian. These structural overheads dominate the iteration loop—71–85% of per-iteration time (Fig. 3)—and they seem to be fundamental: no engineering tuning can eliminate the three steps in the current open-source implementations.
As shown in Fig. 1, this paper proposes a symbolic-permutation-based direct sparse Jacobian assembly method that significantly reduces the iteration structural overhead in Newton–Raphson power-flow analysis. The work consists of three main contributions:
-
Permutation-equivariance theorem. Theorem 1 proves that the Jacobian assembly commutes with orthogonal bus permutation, identifying the bus-type projection as the algebraic root cause of block-assembly fragmentation and enabling its hoisting to a one-time symbolic phase (Section III).
-
Single-pass direct-fill algorithm. With the Jacobian structure fixed by Corollaries 1–2, per-iteration assembly reduces to a branch-free, allocation-free sweep: each column of the admittance matrix is differentiated directly into its final position in the reduced Jacobian, eliminating intermediate sensitivity blocks, per-iteration sparse structure reconstruction, and wasted derivative evaluations for dropped states (Section III-Section IV).
-
Open-source RustPower implementation. The method (noted as V2) is implemented in RustPower, an open-source data-oriented ECS framework. Isolated assembly benchmarks demonstrate speedup over baseline MATPOWER-style [12] formulations (V0) and over the optimized pandapower-style algorithm [16] (V1), eliminating 95.9%–96.7% of the baseline assembly overhead (and up to 87.1% of the residual overhead in V1). End-to-end ablation confirms overall solve speedup over V0 and over V1 with the same KLU backend (Section V).
Section VI concludes the paper and discusses future extensions to transient stability analysis, EMT simulation, and OPF Hessian assembly.
II. MATHEMATICAL FORMULATION
A. Network and Admittance Matrix
In steady-state analysis, a power network of n buses and b branches is described by its branch–bus incidence matrix A; where is the branch admittance matrix, the nodal admittance matrix can be expressed as
The network matrix fundamentally inherits the properties of a weighted Laplacian matrix.
Buses are ordered as , by the number of state variables each bus contributes: PQ buses carry both and as states and lead, PV buses carry only and follow, slack buses carry no state and close the list. The “missing state” types therefore concentrate on the right. The ordering is realised by a one-time permutation applied before iteration; the pre-ordered admittance matrix locks the sparse topology, and every subsequent block split coincides with a contiguous row range.
B. The Power-Flow Equation
The complex bus power injection is the nonlinear function of the bus voltage given by
with complex conjugation. Expanded element-wise, (2) becomes the classical polar form
where , denotes the -th element of the admittance matrix , and the summation runs over all buses connected to bus .
Although these scalar formulations are common in textbooks to directly differentiate and build the Jacobian, this representation is highly inefficient. Every individual entry in the resulting Jacobian inherits distinct transcendental pairs , forcing conventional element-wise differentiation to be a slow operation per iteration.
This heavy algebraic penalty historically obscured the potential of efficient direct Jacobian assembly. Consequently, modern tools adopted complex matrix differentiation to bypass the high transcendental function cost.
C. Analytical Matrix Differentiation and Jacobian Assembly
The Newton–Raphson method eliminates the non-linear power mismatch by iteratively solving the linearized system
where is the iteration counter. In this holistic formulation, the global residual vector is directly mapped from the complex algebraic network constraint
Traditional Three-Step Assembly Power-Flow Solver (Matpower, PyPower, Pandapower, Lightsim2Grid, etc.)
Newton Iteration Loop

Redundant evaluation of full derivatives
Pointer chasing and dynamic allocations
Inefficient scatter write and data copying
Solve with Jred to get dx
Derivative Evaluation
Slicing and Partitioning
Assemble Jred matrix
Matrix Solver (KLU, etc.)
Memory-Bound Bottleneck in Loop Execution
Eliminated via Permutation Equivariance (Theorem 1)
Traditional Formulation: Given by (10)
Proposed Method Based on Symbolic-Permutation (RustPower)
Newton Iteration Loop

Form
Symbolic Phase
Algorithm 1: symbolic permutation and construct
Direct fill
Matrix Solver (KLU, etc.)
Theorem 1:
hoists permutation, enables proposed optimization.
Algorithm 2: Single-pass, branch-less contiguous operation
Single-Pass SIMD-Friendly Direct Jacobian Assembly
-
24–30x speed-up over MATPOWER-Style baseline assembly.
-
1.3–1.8x faster than open-source SOTA C++ solver.
-
Efficient for modern CPUs and GPUs parallel processing.
Fig. 1. Overview of the proposed method's core innovation. By hoisting topology-dependent permutations offline via Theorem 1, the proposed framework eliminates runtime slicing and scattered writes, condensing the traditional loop into a single-pass direct-fill stream to achieve up to speedup and outperform the state-of-the-art open-source C++ solver.
and the Jacobian is expressed in matrix form as
where contains the constant constraints (full for PQ buses, only for PV buses), and has constant constraints ( for PV, for slack buses). In their pioneering framework, Zimmerman et al. [12] introduced an inspiring, mathematically elegant matrix-differential method for MATPOWER. Instead of expanding the governing power equations into scalar polar loops prematurely, they maintained the algebraic integrity of the network entirely within the complex domain through the continuous exponential voltage alignment with . By exploiting the compact network current dependency , this matrix-differential formulation directly yields the exact complex sensitivity operators:
This holistic complex-domain formulation entirely eliminates the heavy trigonometric evaluations from the differentiation phase, successfully collapsing the transcendental computational burden from a traditional down to a single node-level vector map per iteration.
To mitigate the heavy computational burden of sparse matrix-vector products in conventional complex-domain formulations, Schäfer and Braun [16] brilliantly deployed Numba JIT compilation in pandapower to fuse these underlying operations. By mapping elements directly based on the structural invariance of the network topology, their approach successfully streamlined derivative evaluations and bypassed some of the intermediate matrix products, delivering an impressive speedup.
However, while this element-wise fusion successfully accelerated the differentiation phase, the underlying solver remains trapped in a classic architectural pitfall. Because the complex power-flow equations are non-holomorphic, conventional implementations must maintain extensive layout-mapping tables to partition derivatives into discrete through sub-blocks. This structural dependency burdens the iteration loop with continuous pointer-dereferencing and non-contiguous scatter writes that completely disrupt hardware prefetching.
To resolve this architectural pitfall, the power-flow equations demand further mathematical analysis.
III. SYMBOLIC MATRIX ANALYSIS OF DOMAIN PROJECTION AND REORDERING
A. Non-Holomorphic Deadlock and the Dual Real-Mapping Paradigm
The fundamental mathematical bottleneck of conventional power-flow algorithms originates from a non-holomorphic deadlock in the complex domain. The governing complex power injection equation violates the Cauchy-Riemann conditions due to the non-differentiable nature of the conjugation operator, forcing a paradigm shift that maps the complex sensitivities onto a dual real-coordinate system
Under this traditional real-mapping paradigm, contemporary implementations—including state-of-the-art automatic differentiation (AutoDiff) frameworks—are bound by a conventional core assumption: that the unconstrained global matrix must be explicitly materialized prior to handling any spatial configurations. Consequently, traditional power-flow solvers and AutoDiff engines are restricted to evaluating the full, unconstrained matrix, remaining fundamentally agnostic to external boundary constraints and spatial node partitions, which inherently forces conventional architectures to execute three computationally catastrophic operations inside every iteration of the loop:
-
Redundant Differentiation: Wasting significant CPU cycles and arithmetic throughput evaluating derivatives for dropped states (e.g., slack and PV bus voltage magnitudes) that are subsequently discarded.
-
Indirect Spatial Partitioning: Relying on extensive layout-mapping tables to index and route derivatives into traditional through sub-blocks, introducing severe pointer-dereferencing and indirection overheads inside the iteration loop.
-
Non-Contiguous Scatter Assembly: Enforcing dimensional reduction via scattered writes that distribute values across disjoint matrix segments, which completely disrupts hardware prefetching, invalidates CPU cache lines, and severely limits parallel scalability.
These limitations transform the iteration hot path into a performance graveyard of branch mispredictions and cache invalidations, which also significantly lower the parallel efficiency on modern CPUs and GPUs.
B. Permutation Equivariance of the Sensitivity
The complex sensitivities (8)–(9) are built from three primitive operations on and V: diagonal scaling, matrix product, and complex conjugation. Each of them commutes with conjugation by an orthogonal permutation. The elementary fact at the bottom of the proof is the following
Lemma 1 (Diagonal-permutation commutation). For any vector x and orthogonal permutation matrix T with ,
Proof. Let be the permutation with . Then
(12)
□
Theorem 1 (Permutation equivariance of the Jacobian). Let denote either complex sensitivity matrix of (8)–(9). For any orthogonal permutation ,
Proof. Each primitive operation in J commutes with T-conjugation:
• matrix product, since ;
• diagonalisation, by Lemma 1;
• complex conjugation, since T is real.
Apply these to (8)–(9) entrywise, using .
inherits this equivariance because the transformation T is real. We select a state-level permutation that concentrates all active variables at the front, while trailing the omitted PV and slack states at the end. The reduction operator simplifies to a trivial memory slicer, completely eliminating runtime coordinate projections.
Corollary 1 (Pre-permutation absorbs the projection). Let denote the static truncation matrix. The row-and-column permutation T isolates the active variables, partitioning the transformed Jacobian into a block layout:
where a and d denote the active and dropped domains. Because the block structuring forces the projection to collapse into identity matrices, the truncation operator P directly absorbs the transformation. Combining this layout with Theorem 1 yields:
The bus permutation T is applied once before execution. Due to this block alignment, the runtime projection is entirely absorbed into the source matrix, leaving the solver to extract the top-left block via a single memory slice.
Corollary 2 (Boolean structural mapping). Apply the structural operator struct( ) to (14). Because the projection P acts as a binary slicer, the operator passes through it:




Fig. 2. Permutation equivariance and reduction on IEEE 39, buses in [PQ | PV | slack] order. Top: the complex sensitivity inherits 's nonzero positions (Theorem 1; is identical, omitted for space). Bottom: is the top-left -square block of the full Jacobian assembled on the pre-permuted admittance matrix (Corollary 2).
With , the real-linear split duplicates the pattern into four quadrant sub-blocks:
and the equivariance carries this pattern through to the permuted matrix, . Hence,
Fig. 2 shows the IEEE 39-bus system; the matrix patterns confirm Theorem 1 and Corollaries 1–2.
C. Direct Closed-Form Address Mapping
By expanding the analytical complex sensitivities (8)–(9) along individual columns, the exact structural column locality evaluates by inspection:
where is the -th unit vector. The equations establish that the numerical derivation of the -th column of the operational Jacobian requires the same -th column of , leading to direct address mapping instead of generic sparse matrix indices.
Since (18) executes strictly within decoupled column scopes, the nonzero destination addresses inside the real operational Jacobian are computed directly from the static topology struct( ) without matrix traversal. For any nonzero branch , its pre-allocated NNZ memory locations can be evaluated via a unified linear step stride
Phase 1 (-state column variations, ):
Phase 2 (-state column variations, ):
The exact memory coordinates for all four implicit Jacobian sub-blocks are dynamically unified by three static topological attributes: the base column pointer , the zero-based row offset inside the current column slice, and the isolated active nonzero cardinality . The architectural and algebraic superiorities of this mapping are summarized as follows (Table I):
Single-Pass Contiguous Writes: The completeness ordering isolates all boundary-constrained dropped nodes into the matrix lower-right corner. Consequently, the conditional indicator translates into a monotonically increasing linear offset, forcing the hardware execution thread to automatically skip dropped PV and slack constraints while maintaining uninterrupted single-pass 1D streaming writes.
Layout Generality: Although this single-pass streaming kernel is presented column-wise under the Compressed Sparse Column (CSC) format, the underlying memory dispatch logic generalizes symmetrically to Compressed Sparse Row (CSR) layouts. The global target memory addresses remain entirely predictable a priori across rows, guaranteeing maximum execution throughput on modern SIMD-driven processors.
TABLE I CONSEQUENCES OF PROJECTION PLACEMENT.
| Conventional / [16] | This work | |
|---|---|---|
| Placement of | ||
| in loop | every iteration | never |
| Matrix construction | block assembly | direct contiguous write |
| Write pattern | scattered | sequential, contiguous |
| Storage order | CSR | CSC |
D. The Numeric Fill Operator
With the pattern fixed by (17), the numeric phase only writes values from (8)–(9) to the matrix. By applying the general evaluation operators of those formulas uniformly to every entry, including the diagonal, we obtain the intermediate matrices and . The terms are strictly diagonal; thus, and coincide with the exact derivatives off the diagonal, while the diagonal entries can be independently corrected via localized linear patches based on
Per-iteration assembly is therefore reduced to a branch-free sweep—evaluating a uniform relation for every nonzero entry without any tests—followed by a constant-time diagonal modification.
IV. IMPLEMENTATION IN RUSTPOWER
A. Data-Oriented Architecture
RustPower realizes the proposed method in Rust [21] on a data-oriented ECS architecture [22], [23], a design carried over from the prior real-time ECSGrid work [24]. All power system entities are stored in statically typed, columnar arrays in ECS archetype tables, where archetypes are similar to Bus or Line tables in pandapower. Networks are read in the pandapower JSON/CSV format for reproducibility, and the linear solve is delegated, behind a single Solve trait, to an interchangeable backend such as KLU [3]. The proposed algorithm is not tied to RustPower or Rust and is applicable to other implementations without significant modifications.
B. Sparse Storage and Contiguity of Assembly
The column-decoupled nature of (18) aligns natively with the Compressed Sparse Column (CSC) layout. By eliminating intermediate representations, column k of is streamed as a contiguous memory block to directly populate the corresponding columns of in a single pass. This strictly sequential data flow guarantees optimal spatial locality, enabling the hardware pre-fetcher to function ideally and effectively eliminating cache steering bottlenecks [25].
While the underlying mapping logic can be applied symmetrically to Compressed Sparse Row (CSR) layouts, state-of-the-art sparse direct solvers like KLU [3] inherently execute factorization column-wise and strictly mandate CSC inputs. To exploit this architectural alignment, RustPower maintains a unified CSC pipeline across the entire simulation—from the initial network admittance matrix, through the symbolic structure mapping, to the final linear solver backend. This continuous format consistency completely circumvents expensive matrix transposition overheads within the iteration loop.
C. The Symbolic Phase
Algorithm 1 formalizes this one-time symbolic pass, tracing the exact coordinate and offset allocation required to construct the locked sparsity pattern of .
The execution progresses sequentially through the columns of the static network admittance matrix . For each active column (Line 1), a localized binary search is performed on its sorted row indices (Line 2). Leveraging the block-ordered node layout , this bisection splits the column into active and non-active sub-segments, recording the exact boundaries and caching the absolute memory index of the diagonal entry .
Following the bisection, the active row indices bounded within are appended directly to the global value layout of to instantiate the phase-state column (Line 3). Because the pre-permuted topology guarantees that row indices are strictly monotonic, this appending operation translates to a zero-branch memory copy of the active slice, during which the structural boundary offsets for the and sub-blocks are locked. If the current node satisfies the PQ criteria , this identical row structure is mirrored sequentially to establish the voltage-magnitude column,
Algorithm 1 Symbolic phase — build CSC pattern of
Require: (CSC); , ; buses [PQ | PV | slack]
Ensure: col_ptrs, row_idx of ; pq_end[k], active_end[k], diag[k]; block start offsets
1: for do
2: bisect rows of at and ; record pq_end[k], active_end[k], diag[k]
3: append rows of to row_idx as column of ; record , start offsets
4: if then append same rows as column; record , start offsets
5: end if
6: seal column in col_ptrs
7: end for
capturing the corresponding and offsets (Line 4). Finally, the column structural configuration is closed into the sparse column pointers (Line 5). The resulting static metadata functions as a permanent symbolic cache, leaving the subsequent numeric phase entirely free from runtime block-stacking or index-shifting computations.
D. The Direct Single-Pass Numeric Phase
The per-iteration assembly kernel, formalized as FILL (Algorithm 2), executes as a branch-free, streaming numeric pipeline to fill directly. By utilizing the pre-computed metadata from the symbolic pass (Algorithm 1), the numeric kernel completely eliminates runtime memory allocation and spatial coordinate partitioning. Leveraging the permutation corollaries derived in Section III, the runtime completely isolates the PQ (Lines 1–5) and PV (Lines 6–10) loops, thereby eliminating all conditional branching inside the hot execution path. Because both the input layout of and the destination offsets of are mathematically locked, this element-wise fill operates in a single, direct pass, simultaneously streaming computed sensitivities into multiple distinct matrix memory starting points.
By ensuring contiguous memory access, this algorithm allows standard compilers to automatically inject SIMD vectorization and achieve maximum cache utilization. Furthermore, the total elimination of branch divergence and index arithmetic satisfies the core architectural prerequisites for GPU execution, making this numeric kernel natively suited for massively parallel acceleration.
The global integration of these modules is formalized in Algorithm 3. Rather than proposing a modified iterative framework, Algorithm 3 serves as a straightforward replacement for the standard sequence. By exposing a unified trait within RustPower, the offline symbolic pass (Algorithm 1) and the in-place numeric kernel (Algorithm 2) simply substitute the conventional assembly block, allowing the simulator to interface with interchangeable direct solvers like KLU.
AMD Ryzen AI Max+ 395

Jacobian assembly
KLU refactor + backsolve (shared)

Fig. 3. Iteration cost breakdown on the test systems: assembly and factorisation of three methods in RustPower. The proposed method (V2) significantly reduces the assembly share, making factorisation the dominant cost. Measured on the AMD Ryzen AI Max+ 395; factorisation includes shared KLU numeric refactorization and back-substitution, excluding one-time initialization.
Algorithm 2 FILL — in-place numeric assembly of
Require: ; cache from Alg. 1
Ensure: value array of overwritten in place
1: for do PQ column: write and
2: for do
3: write (18) to ; also , if
4: end for
5: add to diagonal entries (21)
6: end for
7: for do PV column: write only
8: for do
9: write (18) to ; also if
10: end for
11: add to diagonal entry (21)
12: end for
V. CASE STUDIES
A. Experimental Setup
Performance was measured on an AMD Ryzen AI Max+ 395 CPU with 32 GB memory. Three networks were tested for the internal ablation: the IEEE 39-bus, the IEEE 118-bus [26], and the PEGASE 9241-bus [27] systems. On IEEE 39, transformers are modeled as lines to match pandapower for validation. All can be accessed from the RustPower repository [28]. The external comparison additionally includes PEGASE 1354 and uses pandapower network cases.
We evaluate three paths compiled within the same binary, using the same KLU backend:
• V0 — A direct port of MATPOWER. It computes complex matrices (8)–(9) using diagonal products and rebuilds the Jacobian via block stacking on every iteration.
• V1 — An optimized formulation. It uses symbolic permutation from RustPower, a tuned derivative function and cached buffers, but keeps the three-step assembly. It
Algorithm 3 Newton–Raphson with symbolic-cached assembly
Require: , tolerance
1: cache ← Algorithm 1 symbolic phase, once
2: allocate the value array of the only Jacobian allocation
3: for do
4: ; power mismatch (2)
5: if then
6: return V
7: end if
8: run Algorithm 2 overwrite values in place
9: solve structure from the cache
10: voltage update from
11: end for
is similar to [16] but with the pre-permuted partition of PQ,PV nodes.
• V2 — The proposed method of Sections III–IV in RustPower 0.5.2.
Results are averaged over seven batches of 300 solves. We compare these paths against pandapower 3.5.4 with Numba [14] and LightSim2Grid 1.0.0 [15]. LightSim2Grid uses a C++ backend on a pre-built model. Given the rapid evolution of power-flow software, comparisons are performed using fixed software releases.
The iteration loop timings in Table IV are averages of 20 repeated complete power-flow solves after warm-up, with initialized network models and cached solver data reused and the initial voltage reset for each solve.
B. Accuracy
All three computational paths (V0, V1, and V2) employ the same Newton-Raphson formulation, with flat-start initialization and the -norm power-mismatch convergence criterion adopted from pandapower. As expected, all solutions require exactly the same number of Newton iterations across every
TABLE II ABLATION OF JACOBIAN ASSEMBLY: SOLVE TIME (MS) WITH SAME SOLVER.
| System | V0 | V1 | V2 | V0/V2 | V1/V2 |
|---|---|---|---|---|---|
| IEEE 39 | 0.0500 | 0.0228 | 0.0114 | 4.4× | 2.0× |
| IEEE 118 | 0.1253 | 0.0540 | 0.0277 | 4.5× | 2.0× |
| PEGASE 9241 | 35.372 | 17.850 | 11.125 | 3.2× | 1.6× |
TABLE III ISOLATED ASSEMBLY STEP: ASSEMBLY TIME (μS) EXCLUDING SOLVE.
| System | V0 | V1 | V2 | V0/V2 | V1/V2 |
|---|---|---|---|---|---|
| IEEE 39 | 9.707 | 2.169 | 0.323 | 30.1× | 6.7× |
| IEEE 118 | 24.998 | 6.153 | 1.023 | 24.4× | 6.0× |
| PEGASE 9241 | 3547.383 | 1040.267 | 134.072 | 26.5× | 7.8× |
tested case. The computed solutions exhibit near-machine-precision agreement with pandapower, with maximum voltage-magnitude and phase-angle deviations of p.u. and degrees, respectively, across all tested systems..
C. Internal Ablation: Isolating the Symbolic Gain
Table II reports solve times. Transitioning from V0 to V1 yields a to speedup via memory tuning. Transitioning from V1 to V2 provides an additional to speedup. Because these totals include the same solve, they understate the assembly speedup.
Table III isolates the assembly step. Here, the symbolic assembly is to faster than the tuned path, and to faster than the V0 port. The speedup remains independent of the network size.
Profiling a single iteration reveals the runtime allocation (Fig. 3). In the standard port, assembly consumes , , and of the iteration time. Tuning reduces this share to , , and . The proposed method eliminates the structural bottleneck, dropping the assembly share to , , and . Consequently, numeric factorization becomes the primary cost.
This speedup stems from structural simplification. Traditional assembly traverses nonzeros repeatedly to form intermediate matrices, sub-blocks, and the stacked Jacobian. The symbolic pass eliminates intermediates. By pre-mapping where each nonzero lands, the numeric phase reads the admittance matrix once and writes the Jacobian once.
D. Comparison with Established Tools
Table IV compares the measured times of pandapower 3.5.4, LightSim2Grid 1.0.0, and RustPower 0.5.2. RustPower reports both grid execution with post-processing and solver-core time of iteration loops.
Including post-processing, RustPower's speedup over pandapower 3.5.4 with Numba falls from on IEEE 39 to on PEGASE 9241 (Table IV); Amdahl's law limits the gain from faster assembly as factorization takes a larger share on larger systems, however, it still provides significant speed-up.
TABLE IV EXTERNAL TOOLS ITERATION LOOP COMPARISON (MS)
| System | PP | LS2G | RP grid | RP core | vs LS2G | vs PP |
|---|---|---|---|---|---|---|
| IEEE 39 | 3.241 | 0.020 | 0.021 | 0.012 | ||
| IEEE 118 | 4.112 | 0.052 | 0.039 | 0.028 | ||
| PEGASE 1354 | 15.830 | 1.041 | 0.589 | 0.554 | ||
| PEGASE 9241 | 126.408 | 13.766 | 10.804 | 10.625 |
PP = pandapower 3.5.4 (Numba); LS2G = LightSim2Grid 1.0.0; RP = RustPower 0.5.2; grid includes post-processing. Speedups are reference time divided by RP grid time.
In Table IV, “RP grid” includes dynamic Bevy ECS system execution and post-processing of bus voltages and powers and line flows, whereas LightSim2Grid operates directly on arrays; the additional time beyond “RP core” decreases from 231 ns per bus on IEEE 39 to 19 ns per bus on PEGASE 9241 and only takes 1.7% of total execution time on PEGASE 9241.
VI. CONCLUSION
This paper delivers three contributions for steady-state power-flow analysis. First, we mathematically prove the permutation equivariance of complex sensitivity, verifying that symbolic permutation pre-applied to the admittance matrix eliminates runtime projections. Second, we develop a generic algorithm that couples symbolic permutation with branchless filling to assemble the global Jacobian in a single pass. Third, we realize this framework in the RustPower solver. Benchmarks demonstrate significant acceleration of power-flow computations, delivering a to solve speedup over V0 and to over V1, while reducing assembly overhead by and , respectively without altering the numeric results or the convergence.
The proposed methodology, the generic algorithm, and the RustPower toolchain establish a new foundation for modern power system analysis. The new method has potential for faster optimal power flow, pre-conditioning, and continuous Newton power-flow solvers. It may also be applicable to transient stability simulation, where streaming logic provides optimal performance on multi-GPU architectures [29] and even FP-GAs [30]. Ultimately, while artificial intelligence increases the demand for advanced computation, the proposed work helps bridge the widening gap between evolving computing paradigms and traditional analysis tools for modern power systems.
REFERENCES
[1] W. F. Tinney and C. E. Hart, “Power flow solution by Newton’s method,” IEEE Trans. Power App. Syst., vol. PAS-86, no. 11, pp. 1449–1460, 1967.
[2] W. F. Tinney and J. W. Walker, “Direct solutions of sparse network equations by optimally ordered triangular factorization,” Proc. IEEE, vol. 55, no. 11, pp. 1801–1809, 1967.
[3] T. A. Davis and E. P. Natarajan, “Algorithm 907: KLU, a direct sparse solver for circuit simulation problems,” ACM Trans. Math. Softw., vol. 37, no. 3, pp. 36:1–36:17, 2010.
[4] R. Idema, D. J. P. Lahaye, C. Vuik, and L. van der Sluis, “Scalable Newton-Krylov solver for very large power flow problems,” IEEE Trans. Power Syst., vol. 27, no. 4, pp. 2248–2257, 2012.
[5] E. F. Yetkin and O. Ceylan, “Recycling Newton–Krylov algorithm for efficient solution of large scale power systems,” Int. J. Electr. Power Energy Syst., vol. 144, p. 108559, 2023.
[6] M. Iwamoto and Y. Tamura, “A load flow calculation method for ill-conditioned power systems,” IEEE Trans. Power App. Syst., vol. PAS-100, no. 4, pp. 1736–1743, 1981.
[7] P. J. Lagace, M. H. Vuong, and I. Kamwa, “Improving power flow convergence by Newton-Raphson with a Levenberg-Marquardt method,” in Proc. IEEE Power Energy Soc. Gen. Meeting, 2008, pp. 1–6.
[8] R. Pires, L. Mili, and G. Chagas, “Robust complex-valued Levenberg-Marquardt algorithm as applied to power flow analysis,” Int. J. Electr. Power Energy Syst., vol. 113, pp. 383–392, 2019.
[9] F. Milano, “An open source power system analysis toolbox,” IEEE Trans. Power Syst., vol. 20, no. 3, pp. 1199–1206, 2005.
[10] R. Yu, W. Gu, Y. Xu, S. Lu, and S. Zhang, “Semi-implicit continuous newton method for power flow analysis,” CSEE J. Power Energy Syst., vol. 11, no. 4, pp. 1957–1961, 2025.
[11] A. R. Bergen and V. Vittal, Power Systems Analysis, 2nd ed. Prentice Hall, 2000.
[12] R. D. Zimmerman, C. E. Murillo-Sanchez, and R. J. Thomas, “MATPOWER: Steady-state operations, planning, and analysis tools for power systems research and education,” IEEE Trans. Power Syst., vol. 26, no. 1, pp. 12–19, 2011.
[13] R. Lincoln, “PYPOWER: A Python port of MATPOWER,” https://pypi.python.org/pypi/PYPOWER, 2015.
[14] L. Thurner, A. Scheidler, F. Schäfer, J. Menke, J. Dollichon, F. Meier, S. Meinecke, and M. Braun, “pandapower — An open-source Python tool for convenient modeling, analysis, and optimization of electric power systems,” IEEE Trans. Power Syst., vol. 33, no. 6, pp. 6510–6521, 2018.
[15] B. Donnot, “LightSim2Grid: A C++ backend targeting the Grid2Op platform for power-system simulation,” https://github.com/BDonnot/lightsim2grid, 2020.
[16] F. Schäfer and M. Braun, “An efficient open-source implementation to compute the jacobian matrix for the Newton-Raphson power flow algorithm,” in Proc. IEEE PES Innov. Smart Grid Technol. Conf. Europe (ISGT-Europe), 2018, pp. 1–6, arXiv:1804.06742.
[17] Z. Wang, S. W. von Berg, and M. Braun, “Fast parallel Newton–Raphson power flow solver for large number of system calculations with CPU and GPU,” Sustain. Energy Grids Networks, vol. 27, p. 100483, 2021.
[18] G. Zhou, Y. Feng, R. Bo, L. Chien, X. Zhang, Y. Lang, Y. Jia, and Z. Chen, “GPU-accelerated batch-ACPF solution for N-1 static security analysis,” IEEE Trans. Smart Grid, vol. 8, no. 3, pp. 1406–1416, 2017.
[19] G. Zhou, R. Bo, L. Chien, X. Zhang, S. Yang, and D. Su, “GPU-accelerated algorithm for online probabilistic power flow,” IEEE Trans. Power Syst., vol. 33, no. 1, pp. 1132–1135, 2018.
[20] M. Ryu, G. Byeon, and K. Kim, “A GPU-accelerated distributed algorithm for optimal power flow in distribution systems,” in Proc. IEEE Int. Parallel Distrib. Process. Symp. (IPDPS), 2025, pp. 702–711.
[21] S. Klabnik and C. Nichols, The Rust Programming Language. No Starch Press, 2019. [Online]. Available: https://doc.rust-lang.org/book/
[22] Bevy Contributors, “Bevy: A data-driven game engine built in Rust,” https://bevyengine.org, 2020.
[23] R. Nystrom, “Data locality (game programming patterns),” in Game Programming Patterns. Genever Benning, 2014. [Online]. Available: https://gameprogrammingpatterns.com/data-locality.html
[24] T. Cheng, T. Duan, and V. Dinavahi, “ECS-Grid: Data-oriented real-time simulation platform for cyber-physical power systems,” IEEE Trans. Ind. Informat., vol. 19, no. 11, pp. 11 128–11 138, 2023.
[25] U. Drepper, “What every programmer should know about memory,” Red Hat, Inc., Tech. Rep., 2007. [Online]. Available: https://www.akkadia.org/drepper/cpumemory.pdf
[26] University of Washington, “IEEE 118-bus test case,” Power Systems Test Case Archive, University of Washington, Tech. Rep., 1993. [Online]. Available: https://labs.ece.uw.edu/pstca/pf118/pg_tca118bus.htm
[27] S. Fliscounakis, P. Panciatici, F. Capitanescu, and L. Wehenkel, “Contingency ranking with respect to overloads in very large power systems taking into account uncertainty, preventive, and corrective actions,” IEEE Trans. Power Syst., vol. 28, no. 4, pp. 4909–4917, 2013.
[28] T. Cheng, “RustPower: A data-oriented open-source power-flow solver in Rust,” https://github.com/chengts95/rustpower, 2024.
[29] V. Jalili-Marandi, Z. Zhou, and V. Dinavahi, “Large-scale transient stability simulation of electrical power systems on multiple GPUs,” IEEE Trans. Parallel Distrib. Syst., vol. 23, no. 7, pp. 1255–1265, 2012.
[30] S. Cao, N. Lin, and V. Dinavahi, “Faster-than-real-time hardware emulation of extensive contingencies for dynamic security analysis of large-
scale integrated AC/DC grid," IEEE Trans. Power Syst., vol. 38, no. 1, pp. 861–871, 2023.

Tianshi Cheng (S'19-M'24) received the B.Eng. degree in electrical engineering and automation from Southeast University, China, in 2017, and the Ph.D. degree in electrical and computer engineering from the University of Alberta, Canada, in 2024. From 2017 to 2018, he was a substation automation engineer at NARI Group Corporation (State Grid Electric Power Research Institute), China. He is currently working as a Simulation Specialist at RTDS Technologies Inc., Winnipeg, MB, Canada. His research interests include electromagnetic transient simulation, transient stability analysis, steady-state analysis, real-time hardware-in-the-loop simulation, parallel processing, microgrids, and power electronics.

Venkata Dinavahi (Fellow, IEEE) received the B.Eng. degree in electrical engineering from the Visvesvaraya National Institute of Technology, Nagpur, India, the M.Tech. degree in electrical engineering from the Indian Institute of Technology, Kanpur, India, and the Ph.D. degree in electrical and computer engineering from the University of Toronto, Ontario, Canada. He is currently a Professor with the Department of Electrical and Computer Engineering, University of Alberta, Edmonton, Canada. His research interests include real-time simulation of multi-domain sustainable energy systems, electromagnetic transients, device-level modeling, artificial intelligence, large-scale systems, and parallel and distributed computing. Dr. Dinavahi is a Fellow of the Engineering Institute of Canada (EIC), the Asia-Pacific Artificial Intelligence Association (AAIA), the International Artificial Intelligence Industry Alliance (AIIA). He is an honorary member of the National Academy of Artificial Intelligence (NAAI), and a Professional Engineer in the Province of Alberta, Canada.