<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>nyx</title>
    <subtitle>Multiphysics simulation workbench for photonic, phononic, superconducting, MEMS, and electronic computational systems.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://nyxart.org/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://nyxart.org/"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-11-29T00:00:00+00:00</updated>
    <id>https://nyxart.org/atom.xml</id>
    <entry xml:lang="en">
        <title>From Simplex Splitting to Native Mixed Cells — and Mesher Rough Edges</title>
        <published>2026-11-29T00:00:00+00:00</published>
        <updated>2026-11-29T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://nyxart.org/notes/09-from-simplex-splitting-to-native-mixed-cells/"/>
        <id>https://nyxart.org/notes/09-from-simplex-splitting-to-native-mixed-cells/</id>
        
        <content type="html" xml:base="https://nyxart.org/notes/09-from-simplex-splitting-to-native-mixed-cells/">&lt;p&gt;Early architectural contract &lt;code&gt;ADR 0004&lt;/code&gt; drew a clean line between meshing and physics: &lt;code&gt;SimplexMesh&lt;/code&gt; — triangles in 2D, tetrahedra in 3D — was the sole mesh type any PDE kernel read. When &lt;code&gt;femcore::meshing&lt;/code&gt; generated structured rectangular absorbing layers (&lt;code&gt;Quad&lt;/code&gt; in 2D, &lt;code&gt;Prism&lt;/code&gt; and &lt;code&gt;Hex&lt;/code&gt; in 3D), &lt;code&gt;Mesh::discretise()&lt;/code&gt; dutifully cut every quadrilateral into two triangles, every prism into three tetrahedra, and every hexahedron into six chiral tetrahedra before handing the model to a solver.&lt;/p&gt;
&lt;p&gt;Like the solver port, the adaptation and structured-meshing core (&lt;code&gt;femmesh&lt;/code&gt; in &lt;code&gt;docs/ports/meshers/PROVENANCE.md&lt;/code&gt;) was written from scratch in zero-dependency Rust without ever reading GPL/LGPL mesh generators (&lt;code&gt;Gmsh&lt;/code&gt;, &lt;code&gt;TetGen&lt;/code&gt;, &lt;code&gt;CGAL&lt;/code&gt;, &lt;code&gt;Mmg&lt;/code&gt;). Unifying the mesh types (&lt;code&gt;R01&lt;/code&gt;, &lt;code&gt;R09&lt;/code&gt;) quickly cured 0-based vs 1-based boundary label confusion — yet keeping the simplex-splitting assumption inside &lt;code&gt;Physics::solve&lt;/code&gt; quietly hurt open-boundary accuracy (&lt;code&gt;ADR 0128&lt;/code&gt;).&lt;/p&gt;
&lt;h2 id=&quot;how-simplex-splitting-damaged-structured-absorbing-layers&quot;&gt;How Simplex Splitting Damaged Structured Absorbing Layers&lt;/h2&gt;
&lt;p&gt;Cutting tensor-product PML shells into simplices broke three physical properties simultaneously:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Bloated DOFs and oblique edge orientation:&lt;/strong&gt; Cutting quads, prisms, and hexahedra multiplied PML cell counts by 2×–6× and inflated 3D absorbing-layer Nédélec DOFs by 29%–57%, directly slowing &lt;code&gt;LBL^H&lt;/code&gt; factorisations. Worse, diagonal tetrahedral edges skewed vector basis functions across normal attenuation and tangential propagation axes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Broken rotational symmetry:&lt;/strong&gt; Splitting square or cylindrical hexahedral layers with a preferred diagonal hand breaks $C_{4v}$ mirror symmetry, artificially lifting degenerate doublet frequencies inside symmetric waveguides and cavities.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Logarithmic tangential locking under singular stretch poles:&lt;/strong&gt; In Rational PMLs and Infinite Elements, coordinate metrics diverge like $(1 - t)^{-2}$ as the shell maps physical coordinates toward infinity. Simplicial shape functions couple radial decay with transverse interpolation and lock severely, creating artificial reflection unless pushed far from the device.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;ADR 0128&lt;/code&gt; replaced that splitting contract with native &lt;code&gt;MixedDiscretisation&lt;/code&gt; (&lt;code&gt;femcore::mesh::mixed&lt;/code&gt;, &lt;code&gt;fem_mixed&lt;/code&gt;, &lt;code&gt;edge_mixed&lt;/code&gt;): &lt;code&gt;Tri&lt;/code&gt; + &lt;code&gt;Quad&lt;/code&gt; in 2D and &lt;code&gt;Tet&lt;/code&gt; + &lt;code&gt;Prism&lt;/code&gt; + &lt;code&gt;Hex&lt;/code&gt; in 3D remain uncut all the way into physics assembly, enforced by canonical $D_3$/$D_4$ face permutations and a zero-transition-pyramid conformity invariant (&lt;code&gt;validate_conforming&lt;/code&gt;). On Nédélec curl-curl cavities, native &lt;code&gt;Hex&lt;/code&gt;/&lt;code&gt;Prism&lt;/code&gt; edges preserve discrete cohomology ($|K G_{1,2}|_\infty &amp;lt; 10^{-13}$) and $C_{4v}$ doublet degeneracy ($|\Delta f / f| &amp;lt; 10^{-13}$), while pure-simplex models continue through untouched fast paths and field output projects lazily on write (&lt;code&gt;MixedToSimplexProjector&lt;/code&gt;) without altering HDF5 or XDMF formats.&lt;/p&gt;
&lt;p&gt;Concentric boundary extrusion also ended the older workflow (&lt;code&gt;ADR 0052&lt;/code&gt;, &lt;code&gt;ADR 0069&lt;/code&gt;) where users had to pad a dummy CAD box by &lt;code&gt;+thickness&lt;/code&gt; and boolean-slice up to 26 corner domains by hand. Today &lt;code&gt;geom::Op::Pml&lt;/code&gt; extrudes outward directly across seven canonical Cartesian, cylindrical, and spherical topologies, backed by &lt;code&gt;validate_pml_ray_invariance&lt;/code&gt; so illegal spherical shells cutting flat multi-layer wafers ($\partial_R \varepsilon \neq 0$) or cylindrical shells pierced by waveguides are caught before meshing.&lt;/p&gt;
&lt;h2 id=&quot;rough-edges-still-visible-in-practice&quot;&gt;Rough Edges Still Visible in Practice&lt;/h2&gt;
&lt;p&gt;Even with native mixed cells and curved order-2 tetrahedra (&lt;code&gt;ADR 0082&lt;/code&gt;, &lt;code&gt;ADR 0110&lt;/code&gt;), &lt;code&gt;ROUGH_SPOTS.md&lt;/code&gt; and benchmark validation runs record several meshing pathologies that users still encounter:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;200–300 nm planar fillet locking in &lt;code&gt;sheet3d&lt;/code&gt;:&lt;/strong&gt; When densely sampled polygon arcs create tiny fillet chords along zero-thickness superconducting traces, 2D constrained Ruppert refinement exhausts &lt;code&gt;max_steiner_multiplier&lt;/code&gt;, stalling volumetric FEM refinement (&lt;code&gt;365.6%&lt;/code&gt; error on the S1.4 multi-qubit reference unless routed through 3-layer &lt;code&gt;planar_bem&lt;/code&gt; at &lt;code&gt;4.04%&lt;/code&gt; median error in &lt;code&gt;1.03 s&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Slanted rhombic periodic cells (&lt;code&gt;R29&lt;/code&gt;):&lt;/strong&gt; Axis-aligned periodic boundary pairs match node counts reliably, whereas slanted &lt;code&gt;Polygon&lt;/code&gt; walls in non-orthogonal hexagonal unit cells can trigger degenerate sub-nanometre segment repeats inside Ruppert splitting — mismatching vertex counts between paired Floquet walls unless run on rectangular supercells.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Curved geometry scope limits (&lt;code&gt;R32&lt;/code&gt;, &lt;code&gt;R33&lt;/code&gt;):&lt;/strong&gt; Enabling quadratic &lt;code&gt;curved&lt;/code&gt; elements bends boundaries in &lt;code&gt;ems::cavity&lt;/code&gt; and conformal &lt;code&gt;sheet3d_curve&lt;/code&gt; arcs (&lt;code&gt;ADR 0121&lt;/code&gt;), yet 3D &lt;code&gt;sms&lt;/code&gt; and &lt;code&gt;dfs&lt;/code&gt; still read straight cell geometry, and creases where two curved faces meet — or where a curved face meets a periodic twin — remain piecewise linear.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Unscaled &lt;code&gt;add_size&lt;/code&gt; local corner patches in &lt;code&gt;convergence_check&lt;/code&gt; (&lt;code&gt;R11b&lt;/code&gt;):&lt;/strong&gt; Standard uniform refinement scales global element sizes and wavelength rules while leaving explicit geometry &lt;code&gt;add_size&lt;/code&gt; zones unchanged (&lt;code&gt;ADR 0061&lt;/code&gt;). On anchor-loss MEMS resonators dominated by singular re-entrant corner stresses, bulk-only refinement can converge artificially slowly (~4% $Q$ shift between coarse steps) unless &lt;code&gt;scale_sizes&lt;/code&gt; (&lt;code&gt;ADR 0112&lt;/code&gt;) or corner patches are adjusted deliberately.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Exposing diagnostics such as &lt;code&gt;min_pml_scaled_jacobian&lt;/code&gt;, Ruppert Steiner exhaustion messages, and explicit layer-fraction filtering (&lt;code&gt;layer_frac&lt;/code&gt;) ensures these geometric limits surface as clear warnings rather than quiet numerical bias.&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>One Engine, Four Front-Ends, and Why Every Solve Runs in Its Own Process</title>
        <published>2026-11-28T00:00:00+00:00</published>
        <updated>2026-11-28T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://nyxart.org/notes/07-one-engine-four-frontends-and-process-isolation/"/>
        <id>https://nyxart.org/notes/07-one-engine-four-frontends-and-process-isolation/</id>
        
        <content type="html" xml:base="https://nyxart.org/notes/07-one-engine-four-frontends-and-process-isolation/">&lt;p&gt;Early versions of &lt;code&gt;nyx&lt;/code&gt; did not look like a general multiphysics workbench. The project started around stimulated Brillouin scattering in photonic waveguides, with chip recipes baked straight into &lt;code&gt;femcore&lt;/code&gt; alongside meshing, sparse linear algebra, HDF5 export, and an experimental AI MCP workspace sitting in a separate Cargo graph (&lt;code&gt;ROUGH_SPOTS.md&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;When the project pivoted to photonics, phononics, piezoelectrics, thermal conduction, and superconducting quantum circuits, keeping specialised ring-chip templates inside the FEM core stopped making sense. &lt;code&gt;ADR 0024&lt;/code&gt; removed the Brillouin kernels and hardcoded chips altogether — freezing the last state at git tag &lt;code&gt;sbs-last&lt;/code&gt; — and the restructure broke the codebase into 15 workspace crates behind strict compiler-enforced layering (&lt;code&gt;crates/nyx-engine/tests/layering.rs&lt;/code&gt;).&lt;/p&gt;
&lt;h2 id=&quot;splitting-the-monolith-and-isolating-geom&quot;&gt;Splitting the Monolith and Isolating &lt;code&gt;geom&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Before the restructure, &lt;code&gt;nyx-store&lt;/code&gt; pulled in the entire FEM crate just to inspect two fields of a JSON result (&lt;code&gt;R15&lt;/code&gt;), &lt;code&gt;Project&lt;/code&gt; state lived inside the GUI crate where headless scripts and MCP tools could not open a project file (&lt;code&gt;R16&lt;/code&gt;), and the MCP server maintained its own &lt;code&gt;Cargo.lock&lt;/code&gt; (&lt;code&gt;R17&lt;/code&gt;). Separating geometry (&lt;code&gt;geom&lt;/code&gt;), FEM core (&lt;code&gt;femcore&lt;/code&gt;), typed physics (&lt;code&gt;nyx-physics&lt;/code&gt; plus &lt;code&gt;nyx-dfs&lt;/code&gt;/&lt;code&gt;nyx-sms&lt;/code&gt;/&lt;code&gt;nyx-ems&lt;/code&gt;), post-processing (&lt;code&gt;nyx-analysis&lt;/code&gt;), pure-Rust storage (&lt;code&gt;nyx-storage&lt;/code&gt;), and orchestration (&lt;code&gt;nyx-engine&lt;/code&gt;) left one engine boundary with 118 versioned commands.&lt;/p&gt;
&lt;p&gt;One architectural boundary is guarded with unusual strictness: &lt;strong&gt;&lt;code&gt;geom&lt;/code&gt; must never depend on &lt;code&gt;femcore&lt;/code&gt;&lt;/strong&gt;, verified on every CI run (&lt;code&gt;geom_depends_on_serde_and_optional_rayon_only&lt;/code&gt;). Because parametric expressions must evaluate identically in geometry construction and in post-processing field formulas, &lt;code&gt;nyx&lt;/code&gt; intentionally carries two parallel expression evaluators — &lt;code&gt;geom::expr&lt;/code&gt; and &lt;code&gt;femcore::expr&lt;/code&gt; (&lt;code&gt;R06&lt;/code&gt;) — and locks them together with &lt;code&gt;crates/femcore/tests/expr_grammar.rs&lt;/code&gt;, which feeds one shared corpus through both engines and checks identical acceptance, refusal, and bit-for-bit values.&lt;/p&gt;
&lt;p&gt;Every tracked file in the repository must also match a row in &lt;code&gt;docs/architecture/CODE_TO_ADR.md&lt;/code&gt;, checked mechanically by &lt;code&gt;check_code_to_adr.sh&lt;/code&gt; so new modules cannot drift into the tree without an architectural owner.&lt;/p&gt;
&lt;h2 id=&quot;why-monty-beat-starlark-and-rhai-for-nys-scripts&quot;&gt;Why Monty Beat Starlark and Rhai for &lt;code&gt;*.nys&lt;/code&gt; Scripts&lt;/h2&gt;
&lt;p&gt;With a single command catalogue driving the desktop window, headless CLI, and MCP server (&lt;code&gt;ADR 0057&lt;/code&gt;), scripted parameter studies still needed loops and conditionals that flat JSON command lists could not express (&lt;code&gt;ADR 0089&lt;/code&gt;). Re-introducing CPython would have violated &lt;code&gt;ADR 0013&lt;/code&gt; (zero Python runtime required to build or use &lt;code&gt;nyx&lt;/code&gt;). The scripting spike (&lt;code&gt;ADR 0093&lt;/code&gt;) wired all 118 commands into three pure-Rust embeddable candidates:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Starlark:&lt;/strong&gt; Cleanly sandboxed, yet adding &lt;code&gt;starlark&lt;/code&gt; turned on &lt;code&gt;serde_json&lt;/code&gt;’s &lt;code&gt;arbitrary_precision&lt;/code&gt; Cargo feature across the entire workspace. That single global feature flag immediately broke nine tests involving untagged enums in saved project formats. Starlark also lacked &lt;code&gt;while&lt;/code&gt; loops, &lt;code&gt;try&lt;/code&gt;/&lt;code&gt;except&lt;/code&gt;, and standard Python string formatting.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rhai:&lt;/strong&gt; Fast and bounded in-process, with zero Cargo feature fallout — yet every physicist and coding agent would have had to learn a bespoke Rust-adjacent scripting syntax.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Monty:&lt;/strong&gt; Executes standard Python syntax in pure Rust (&lt;code&gt;nyx-script&lt;/code&gt;) with CPython-style tracebacks and built-in static stub checking (&lt;code&gt;nyx.pyi&lt;/code&gt; generated directly from &lt;code&gt;Engine::catalog()&lt;/code&gt;). Its catch was memory safety: an unbounded loop like &lt;code&gt;while True&lt;/code&gt; or &lt;code&gt;[0] * 10**12&lt;/code&gt; aborts the process hosting the interpreter.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Running Monty inside an isolated child binary (&lt;code&gt;nyx-script-worker&lt;/code&gt;) resolved that catch, while pinning determinism rules strictly: no &lt;code&gt;open&lt;/code&gt;, &lt;code&gt;os&lt;/code&gt;, &lt;code&gt;pathlib&lt;/code&gt;, or network modules, wall-clock calls refused, &lt;code&gt;random&lt;/code&gt; locked to seed &lt;code&gt;0&lt;/code&gt;, and every path-like argument checked inside &lt;code&gt;nyx_engine::path_guard&lt;/code&gt; against the workspace root (explicitly tested across all catalogue arguments by &lt;code&gt;tests/path_guard.rs&lt;/code&gt;). For AI hosts (&lt;code&gt;ADR 0094&lt;/code&gt;), &lt;code&gt;nyx-mcp&lt;/code&gt; was simultaneously collapsed from over a hundred per-command tools into four script-session tools (&lt;code&gt;script_run&lt;/code&gt;, &lt;code&gt;script_wait&lt;/code&gt;, &lt;code&gt;script_check&lt;/code&gt;, &lt;code&gt;api&lt;/code&gt;).&lt;/p&gt;
&lt;h2 id=&quot;why-small-solves-pay-a-70-ms-child-process-tax&quot;&gt;Why Small Solves Pay a 70 ms Child-Process Tax&lt;/h2&gt;
&lt;p&gt;Executing a 3D finite-element cavity can demand 10.7 GB to 22 GB of RAM (&lt;code&gt;ADR 0086&lt;/code&gt;), and sparse direct factorisations inside &lt;code&gt;faer&lt;/code&gt; cannot be cleanly interrupted mid-call. Running solves directly inside the GUI window or MCP daemon created two unacceptable failures: an out-of-memory panic crashed the whole interface along with unsaved edits, and clicking Stop waited up to several minutes for a multi-gigabyte factorisation to finish before checking cancellation.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;nyx&lt;/code&gt; therefore isolates every &lt;code&gt;solve_run&lt;/code&gt; job in a child worker process by default (controlled via &lt;code&gt;isolate&lt;/code&gt;), trading ~0.07 s startup latency on trivial 0.01 s 2D runs (or ~7% overhead at 39,000 unknowns) for three concrete properties:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Sub-1.5 s cancellation:&lt;/strong&gt; Polling cancel every 40 ms and killing the child process stops even a mid-flight 3D LU factorisation cleanly, and worker aborts fail only that job (&lt;code&gt;tests/worker_crash.rs&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Real process-level memory telemetry:&lt;/strong&gt; Measuring &lt;code&gt;/proc&lt;/code&gt; watermarks on Linux or process peak working set on Windows belongs strictly to one isolated solve rather than a long-lived GUI session.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Power-law admission from local history (&lt;code&gt;estimate.rs&lt;/code&gt;):&lt;/strong&gt; Completed worker runs append cell counts, peak memory, and wall time to &lt;code&gt;solve_history.jsonl&lt;/code&gt;. Once two sizes exist for a physics chain and dimension, new jobs fit memory against cell count as a power law (3D cavities grow roughly as DOFs to the power 1.5, making naive linear bytes-per-unknown guesses dangerously optimistic). Jobs projected above 90% of physical RAM are rejected unless &lt;code&gt;force = true&lt;/code&gt; is set, and jobs exceeding currently free RAM pause in the queue until running work clears.&lt;span class=&quot;sn-wrap sn-wrap--labeled&quot;&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-sn-07-power&quot; class=&quot;sn-toggle&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot;&gt;&lt;label for=&quot;sn-sn-07-power&quot; class=&quot;sn-number&quot; role=&quot;button&quot; tabindex=&quot;0&quot; aria-controls=&quot;sn-note-sn-07-power&quot; aria-expanded=&quot;false&quot; aria-label=&quot;Toggle sidenote 1&quot; title=&quot;Toggle sidenote&quot;&gt;1&lt;/label&gt;&lt;span id=&quot;sn-note-sn-07-power&quot; class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sn-note-num&quot;&gt;1.&lt;/span&gt;One subtle Windows hazard found during profiling: piped background processes without a console window can be demoted to efficiency cores by OS power throttling unless the worker opts out explicitly (&lt;code&gt;nyx_engine::process::opt_out_of_power_throttling&lt;/code&gt;).&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;One honest boundary remains open in worker isolation (&lt;code&gt;ADR 0086&lt;/code&gt;): two-grid and three-grid &lt;code&gt;convergence_check&lt;/code&gt; runs still execute sequentially inside a single worker or process rather than spawning per-mesh admission gates, and distributed workers across separate cluster machines are not implemented.&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Dropping C HDF5, Fixed-Chunk Determinism, and Where the GPU Code Stands</title>
        <published>2026-11-28T00:00:00+00:00</published>
        <updated>2026-11-28T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://nyxart.org/notes/08-dropping-c-hdf5-and-honest-gpu-acceleration/"/>
        <id>https://nyxart.org/notes/08-dropping-c-hdf5-and-honest-gpu-acceleration/</id>
        
        <content type="html" xml:base="https://nyxart.org/notes/08-dropping-c-hdf5-and-honest-gpu-acceleration/">&lt;p&gt;Scientific Rust tools often claim pure-Rust portability until you inspect how they read and write field data — at which point CMake, a C compiler, and a platform &lt;code&gt;hdf5.dll&lt;/code&gt; or &lt;code&gt;libhdf5.so&lt;/code&gt; quietly reappear. &lt;code&gt;nyx&lt;/code&gt; spent its first phases linking &lt;code&gt;hdf5-metno&lt;/code&gt;, forcing contributors and CI runners to wrestle with &lt;code&gt;HDF5_DIR&lt;/code&gt; while producing results files whose layout fractured badly on 3D quadratic meshes (&lt;code&gt;ADR 0107&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;In that original layout (&lt;code&gt;L1LegacyGzip3&lt;/code&gt;), saving a 14-mode 3D mechanical or electromagnetic run created $O(16 \times M)$ separate B-tree dataset headers compressed individually with &lt;code&gt;Deflate(3)&lt;/code&gt;. Files grew to 69–600 MB with only 1.07×–2.45× compression on &lt;code&gt;cell_fields&lt;/code&gt;, reading one quantity buffered the whole archive into memory, and long parameter sweeps had no way to append points incrementally.&lt;/p&gt;
&lt;h2 id=&quot;zero-c-hdf5-pure-and-a-packed-5d-layout&quot;&gt;Zero-C &lt;code&gt;hdf5-pure&lt;/code&gt; and a Packed 5D Layout&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;ADR 0107&lt;/code&gt; replaced &lt;code&gt;hdf5-metno&lt;/code&gt; across the workspace with &lt;code&gt;crates/nyx-storage&lt;/code&gt;, built on pure-Rust &lt;code&gt;hdf5-pure&lt;/code&gt; and pure-Rust SIMD &lt;code&gt;zlib-rs&lt;/code&gt; (with &lt;code&gt;fast-deflate&lt;/code&gt; deliberately disabled so C &lt;code&gt;zlib-ng&lt;/code&gt; cannot sneak into the build graph). CI Gate &lt;code&gt;EC-00&lt;/code&gt; enforces zero C toolchain involvement directly by compiling with poisoned &lt;code&gt;CC&lt;/code&gt;, &lt;code&gt;CXX&lt;/code&gt;, and &lt;code&gt;CMAKE&lt;/code&gt; variables.&lt;/p&gt;
&lt;p&gt;Just swapping the reader was not enough; changing the on-disk layout solved the scaling bottleneck (&lt;code&gt;FieldStorageLayout::L2ShuffleLzfPacked&lt;/code&gt;):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;All $M$ modes of a physics study pack into one 5D dataset, &lt;code&gt;/results/&amp;lt;physics&amp;gt;/cell_fields_packed&lt;/code&gt;, shaped &lt;code&gt;[M, C, N_c, N_v, R]&lt;/code&gt; (&lt;code&gt;R = 1&lt;/code&gt; for real fields, &lt;code&gt;R = 2&lt;/code&gt; when any component is complex).&lt;/li&gt;
&lt;li&gt;Each mode occupies one chunk &lt;code&gt;[1, C, N_c, N_v, R]&lt;/code&gt; filtered with HDF5’s standard byte-shuffle (&lt;code&gt;id = 2&lt;/code&gt;) followed by &lt;code&gt;LZF&lt;/code&gt; (&lt;code&gt;id = 32000&lt;/code&gt;), leaving every file readable directly by vanilla Python &lt;code&gt;h5py&lt;/code&gt; without custom filter plugins.&lt;/li&gt;
&lt;li&gt;Byte-shuffling IEEE-754 mantissa and exponent lanes ahead of &lt;code&gt;LZF&lt;/code&gt; cut file size by 3.2× (reaching 16.3× compression on 3D &lt;code&gt;Tet10&lt;/code&gt; meshes) and accelerated writes 4.2× compared to &lt;code&gt;Deflate(3)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Positional streaming (&lt;code&gt;open_streaming&lt;/code&gt; plus &lt;code&gt;ReadBudgetConfig&lt;/code&gt;) lets &lt;code&gt;nyx&lt;/code&gt; slice a single 60 MB mode from a 600 MB 3D solve with ~57.2 MB peak RSS delta while asserting &lt;code&gt;CHECKED&lt;/code&gt; integer bounds on corrupted headers before allocating memory.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;One legacy promise was cut cleanly during that work: the old &lt;code&gt;phdf5&lt;/code&gt; MPI-IO parallel write flag had never been built or run (&lt;code&gt;RESULTS_FORMAT_STUDY.md&lt;/code&gt;), so &lt;code&gt;H5Mode::Parallel&lt;/code&gt; now stays an explicit zero-C stub returning an error in favour of atomic whole-file renames and in-place sweep checkpoints (&lt;code&gt;SweepCheckpoint&lt;/code&gt;).&lt;/p&gt;
&lt;h2 id=&quot;fixed-chunk-parallelism-and-where-determinism-stops&quot;&gt;Fixed-Chunk Parallelism — and Where Determinism Stops&lt;/h2&gt;
&lt;p&gt;Reproducing regression baselines requires numerical answers not to wander when a run moves from 1 core to 8. Standard parallel &lt;code&gt;.sum()&lt;/code&gt; folds over &lt;code&gt;rayon&lt;/code&gt; iterators reassociate floating-point rounding differently whenever work-stealing schedules shift chunks between threads.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ADR 0011&lt;/code&gt; solved thread-count drift by enforcing fixed-size chunking in &lt;code&gt;femcore::par&lt;/code&gt; and &lt;code&gt;femcore::linalg::par&lt;/code&gt;: parallel element assembly and vector reductions always partition into chunk sizes independent of thread count (&lt;code&gt;NYX_THREADS&lt;/code&gt;), accumulate per-chunk partials, and fold chunks strictly in index order. Across electrostatics, adaptation, DGTD, FDTD, and post-processing, &lt;code&gt;NYX_THREADS=1&lt;/code&gt; and &lt;code&gt;NYX_THREADS=8&lt;/code&gt; match to zero ULPs.&lt;/p&gt;
&lt;p&gt;Where determinism does &lt;em&gt;not&lt;/em&gt; hold is documented just as explicitly:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Cross-machine BLAS/FMA differences:&lt;/strong&gt; High-throughput CPU BLAS kernels vary FMA contraction and cache blocking by instruction set (&lt;code&gt;--features portable-kernels&lt;/code&gt; trades some restart-multiply speed for cross-CPU parity under &lt;code&gt;&amp;lt; 1e-13&lt;/code&gt; differential gates).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Parallel 3D sparse direct factorisations (&lt;code&gt;faer&lt;/code&gt;):&lt;/strong&gt; Multi-threaded &lt;code&gt;faer&lt;/code&gt; sparse LU/LDL&lt;sup&gt;T&lt;/sup&gt; in 3D &lt;code&gt;ems&lt;/code&gt; exhibits &lt;code&gt;3.59e-10&lt;/code&gt; to &lt;code&gt;1.15e-7&lt;/code&gt; relative eigenvalue drift between 1 and 8 threads due to internal task scheduling.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;where-the-gpu-code-stands-today&quot;&gt;Where the GPU Code Stands Today&lt;/h2&gt;
&lt;p&gt;Recent additions (&lt;code&gt;ADR 0146&lt;/code&gt;) added GPU execution to &lt;code&gt;nyx&lt;/code&gt;, and it is important to be clear about what language actually runs on the hardware today.&lt;/p&gt;
&lt;p&gt;Default builds (&lt;code&gt;cargo build --release&lt;/code&gt;) remain 100% pure Rust on the CPU with zero GPU dependencies compiled into the workspace. Passing &lt;code&gt;--features gpu&lt;/code&gt; enables a shared &lt;code&gt;wgpu&lt;/code&gt; runtime across Vulkan, DirectX 12, and Metal targeting two time-domain electromagnetic solvers (&lt;code&gt;Study::Fdtd&lt;/code&gt; and &lt;code&gt;Study::Dgtd&lt;/code&gt;) plus mixed-precision &lt;code&gt;AmgF32&lt;/code&gt;/&lt;code&gt;SellCSigma&lt;/code&gt; linear operators (&lt;code&gt;femcore::linalg::gpu&lt;/code&gt;). Those compute kernels are currently written as &lt;strong&gt;WGSL shaders executed through &lt;code&gt;wgpu&lt;/code&gt;&lt;/strong&gt;, not Rust code compiled directly to the GPU.&lt;span class=&quot;sn-wrap sn-wrap--labeled&quot;&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-sn-08-gpu-tree&quot; class=&quot;sn-toggle&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot;&gt;&lt;label for=&quot;sn-sn-08-gpu-tree&quot; class=&quot;sn-number&quot; role=&quot;button&quot; tabindex=&quot;0&quot; aria-controls=&quot;sn-note-sn-08-gpu-tree&quot; aria-expanded=&quot;false&quot; aria-label=&quot;Toggle sidenote 1&quot; title=&quot;Toggle sidenote&quot;&gt;1&lt;/label&gt;&lt;span id=&quot;sn-note-sn-08-gpu-tree&quot; class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sn-note-num&quot;&gt;1.&lt;/span&gt;To preserve repeatability across GPU runs, energy integrals and vector inner products avoid floating-point atomics and use two-level workgroup shared-memory binary reduction trees (&lt;code&gt;@workgroup_size(64)&lt;/code&gt; and &lt;code&gt;@workgroup_size(256)&lt;/code&gt;).&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Several explicit guardrails govern when &lt;code&gt;gpu&lt;/code&gt; falls back to CPU with a &lt;code&gt;gpu_fallback_to_cpu&lt;/code&gt; warning:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Double precision hardware support:&lt;/strong&gt; &lt;code&gt;backend = &quot;auto&quot;&lt;/code&gt; picks &lt;code&gt;f32&lt;/code&gt; for large linear time-domain grids (&lt;code&gt;&amp;gt;= 250,000&lt;/code&gt; FDTD cells or &lt;code&gt;&amp;gt;= 50,000&lt;/code&gt; DGTD DOFs on discrete GPUs), selecting &lt;code&gt;f64&lt;/code&gt; only when nonlinear optics is enabled and the adapter exposes &lt;code&gt;wgpu::Features::SHADER_F64&lt;/code&gt;. Requesting &lt;code&gt;precision = &quot;f64&quot;&lt;/code&gt; on a card without &lt;code&gt;SHADER_F64&lt;/code&gt; drops cleanly back to CPU &lt;code&gt;f64&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Advanced features still CPU-only:&lt;/strong&gt; Multi-tier Local Time-Stepping (&lt;code&gt;n_lts_tiers &amp;gt; 1&lt;/code&gt;) in &lt;code&gt;Dgtd&lt;/code&gt; and dispersive Drude/Lorentz ADE poles currently execute on the CPU rather than maintaining diverging shader paths.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Because solvers program against &lt;code&gt;femcore::linalg::device&lt;/code&gt;’s backend-agnostic &lt;code&gt;Vector&lt;/code&gt;, &lt;code&gt;DeviceLinearOperator&lt;/code&gt;, and &lt;code&gt;DevicePreconditioner&lt;/code&gt; traits rather than raw buffer handles, &lt;code&gt;wgpu&lt;/code&gt;/WGSL acts as a portable Tier-1 layer. Longer term, the roadmap plans to move compute kernels to Rust-native GPU toolchains (such as &lt;code&gt;CubeCL&lt;/code&gt; or &lt;code&gt;rust-gpu&lt;/code&gt;) once portable &lt;code&gt;f64&lt;/code&gt; support stabilises, alongside native CUDA/ROCm/cluster backends.&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Two Linear Algebra Stacks, What Survived, and What Failed in Practice</title>
        <published>2026-11-27T00:00:00+00:00</published>
        <updated>2026-11-27T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://nyxart.org/notes/06-two-linear-algebra-stacks-and-what-survived/"/>
        <id>https://nyxart.org/notes/06-two-linear-algebra-stacks-and-what-survived/</id>
        
        <content type="html" xml:base="https://nyxart.org/notes/06-two-linear-algebra-stacks-and-what-survived/">&lt;p&gt;For a short stretch during the restructure documented in &lt;code&gt;ADR 0008&lt;/code&gt;, &lt;code&gt;femcore&lt;/code&gt; carried two largely complete sparse linear-algebra stacks side by side. The original modules — &lt;code&gt;sparse&lt;/code&gt;, &lt;code&gt;csparse&lt;/code&gt;, &lt;code&gt;linalg&lt;/code&gt;, &lt;code&gt;amg&lt;/code&gt;, &lt;code&gt;eigen&lt;/code&gt;, and &lt;code&gt;lobpcg&lt;/code&gt; — had grown directly alongside the physics kernels, with separate real and complex matrix types and exposed &lt;code&gt;usize&lt;/code&gt; buffers. Beside them sat &lt;code&gt;femsolve&lt;/code&gt;, a clean-room BSD-2-Clause solver library developed in an isolated working session with generic real and complex scalars, Krylov–Schur restarts, smoothed-aggregation multigrid, and fixed-chunk parallel reductions.&lt;/p&gt;
&lt;p&gt;Merging &lt;code&gt;femsolve&lt;/code&gt; into &lt;code&gt;femcore::linalg::driver&lt;/code&gt; (&lt;code&gt;ADR 0033&lt;/code&gt;) retired the duplicate sparse matrix types, yet it did not mean deleting every piece of the original stack. Once the ported solvers were measured against real physics problems instead of synthetic test matrices, three older choices stayed in service because numbers beat architectural neatness.&lt;/p&gt;
&lt;h2 id=&quot;the-three-older-pieces-that-survived&quot;&gt;The Three Older Pieces That Survived&lt;/h2&gt;
&lt;h3 id=&quot;1-real-block-arnoldi-arnoldi-real-for-lossless-optical-waveguides&quot;&gt;1. Real Block Arnoldi (&lt;code&gt;arnoldi_real&lt;/code&gt;) for Lossless Optical Waveguides&lt;/h3&gt;
&lt;p&gt;In a lossless 2D waveguide with tilted crystal anisotropy or a real cross-section, the eigenvalue pencil is real and non-symmetric. When the driver initially routed those solves through the library’s Krylov–Schur eigensolver, complex arithmetic was used everywhere because the library lacked a real Schur decomposition with 2×2 blocks. On real non-normal waveguide pencils, that complex shift introduced spurious imaginary parts of 1e-8 to 1e-5 relative magnitude, preventing large meshes from reaching tolerance.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;nyx&lt;/code&gt; therefore kept &lt;code&gt;arnoldi_real::eigs_general&lt;/code&gt; from the original &lt;code&gt;eigen.rs&lt;/code&gt; behind the &lt;code&gt;driver::eigs_general&lt;/code&gt; entry point. A real Ritz matrix keeps real eigenvalues at exact zero imaginary part while legitimate leaky or complex-$\beta$ modes appear as conjugate pairs. Rather than silently discarding complex roots as simple real solvers sometimes do, &lt;code&gt;eigs_general&lt;/code&gt; flags any converged mode satisfying $|\mathrm{Im},\theta| &amp;gt; 10,\mathrm{tol},|\theta|$ inside the &lt;code&gt;nev + 2&lt;/code&gt; window, sets &lt;code&gt;complex_found&lt;/code&gt;, and lets &lt;code&gt;nyx-ems&lt;/code&gt; rerun the cross-section in the full complex solver (&lt;code&gt;modes_complex&lt;/code&gt;).&lt;span class=&quot;sn-wrap sn-wrap--labeled&quot;&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-sn-06-complex&quot; class=&quot;sn-toggle&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot;&gt;&lt;label for=&quot;sn-sn-06-complex&quot; class=&quot;sn-number&quot; role=&quot;button&quot; tabindex=&quot;0&quot; aria-controls=&quot;sn-note-sn-06-complex&quot; aria-expanded=&quot;false&quot; aria-label=&quot;Toggle sidenote 1&quot; title=&quot;Toggle sidenote&quot;&gt;1&lt;/label&gt;&lt;span id=&quot;sn-note-sn-06-complex&quot; class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sn-note-num&quot;&gt;1.&lt;/span&gt;Contract test &lt;code&gt;a_converged_complex_pair_of_a_real_pencil_is_reported_and_never_dropped&lt;/code&gt; in &lt;code&gt;crates/femcore/tests/linalg_contract.rs&lt;/code&gt; pins this behaviour so no update quietly drops physical complex waveguide pairs.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3 id=&quot;2-the-original-elasticity-multigrid-amg-elastic&quot;&gt;2. The Original Elasticity Multigrid (&lt;code&gt;amg_elastic&lt;/code&gt;)&lt;/h3&gt;
&lt;p&gt;Smooth-aggregation algebraic multigrid for solid mechanics differs subtly from scalar Laplacian multigrid: coarse spaces must preserve all six rigid-body translations and rotations in 3D, smooth &lt;code&gt;P2&lt;/code&gt; quadratic systems through a &lt;code&gt;P1&lt;/code&gt; first coarse level, and run Chebyshev polynomial smoothing with single-precision inner-cycle storage (&lt;code&gt;Csr32&lt;/code&gt;). Because &lt;code&gt;nyx&lt;/code&gt;’s existing &lt;code&gt;amg.rs&lt;/code&gt; already hit 3.1 to 2.8 s on 3D solid benchmarks and 33.7 s on baseline 3D eigenproblems, it was moved intact into &lt;code&gt;femcore::linalg::amg_elastic&lt;/code&gt; rather than rewritten.&lt;/p&gt;
&lt;h3 id=&quot;3-column-parallel-complex-solves-par-solve-min-n-5000&quot;&gt;3. Column-Parallel Complex Solves (&lt;code&gt;par_solve_min_n = 5000&lt;/code&gt;)&lt;/h3&gt;
&lt;p&gt;The ported solver library defaulted all triangular back-substitutions to &lt;code&gt;Sequential&lt;/code&gt; after its authors observed &lt;code&gt;faer&lt;/code&gt; 0.24.4 taking ~1.4 s for parallel multi-right-hand-side solves versus 12 ms sequentially on a 64,000-unknown scalar test. Yet the original complex waveguide solver (&lt;code&gt;csparse::CSolver::solve_many&lt;/code&gt;) had done something different: instead of calling a parallel BLAS-3 multi-RHS triangular kernel, it dispatched independent sequential column solves against one shared LU factorisation across rayon worker threads once unknowns exceeded 5,000.&lt;/p&gt;
&lt;p&gt;Benchmarking a P2 waveguide with PML up to 35,465 unknowns confirmed the original heuristic (&lt;code&gt;ADR 0033&lt;/code&gt;): strict sequential solves ran at 1.033 s, roughly 7% slower than the old stack at 0.963 s, whereas column-parallel dispatch recovered to 0.914 s while keeping identical effective indices to six digits (&lt;code&gt;NYX_PAR_SOLVE_MIN_N&lt;/code&gt; controls the threshold).&lt;/p&gt;
&lt;aside class=&quot;callout callout--note&quot;&gt;
  &lt;div class=&quot;callout-title&quot;&gt;
    &lt;span aria-hidden=&quot;true&quot;&gt;§&lt;/span&gt;
    &lt;span&gt;How Cancellation Crosses a Generic Krylov Trait&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&quot;callout-body&quot;&gt;
    &lt;p&gt;Because the library operator traits return vectors rather than &lt;code&gt;Result&lt;/code&gt;, aborting a stalled Krylov loop cleanly required an explicit boundary in &lt;code&gt;driver.rs&lt;/code&gt;. Every operator application polls the shared cancellation flag and raises a private &lt;code&gt;CancelUnwind&lt;/code&gt; panic payload caught immediately inside the driver as &lt;code&gt;Err(&quot;cancelled&quot;)&lt;/code&gt; — an intentional, local exception to &lt;code&gt;nyx&lt;/code&gt;’s no-panics convention.&lt;/p&gt;
  &lt;/div&gt;
&lt;/aside&gt;
&lt;h2 id=&quot;where-elegant-ideas-lost-to-measurement&quot;&gt;Where Elegant Ideas Lost to Measurement&lt;/h2&gt;
&lt;p&gt;Moving the solvers behind one facade exposed places where textbook expectations failed on real discretisations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Nested dissection lost to AMD on 3D elasticity (&lt;code&gt;FillOrdering::Auto&lt;/code&gt;):&lt;/strong&gt; The library’s &lt;code&gt;Auto&lt;/code&gt; heuristic runs a second symbolic analysis with nested dissection and chooses whichever ordering produces fewer factor nonzeros. On scalar 3D Laplacians this cut fill by 30%, yet on 205,479-unknown &lt;code&gt;P2&lt;/code&gt; 3D solid elasticity under parallel Cholesky, AMD beat &lt;code&gt;Auto&lt;/code&gt; on both timing runs (4.68 s and 10.92 s vs 13.46 s and 17.78 s). &lt;code&gt;AMD&lt;/code&gt; therefore stayed the default for standard elasticity.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Symmetric indefinite &lt;code&gt;LBL^H&lt;/code&gt; / &lt;code&gt;Sym LBL^T&lt;/code&gt; broke the 3D EM bottleneck (&lt;code&gt;ADR 0117&lt;/code&gt;):&lt;/strong&gt; Where nested dissection struggled on elasticity, exploiting symmetry transformed 3D $P_2$ Nédélec curl-curl solves. Factorising indefinite Maxwell matrices with unsymmetric &lt;code&gt;COLAMD&lt;/code&gt; LU stored both $L$ and $U$ with off-diagonal fill pivoting. Wiring &lt;code&gt;faer&lt;/code&gt; supernodal Bunch–Kaufman &lt;code&gt;LBL^H&lt;/code&gt; (for real-symmetric and Hermitian matrices) and &lt;code&gt;Sym LBL^T&lt;/code&gt; (for non-conjugate complex-symmetric PML/IBC matrices) guarded by a 1-vector backward residual check (&lt;code&gt;&amp;lt;= 1e-8&lt;/code&gt;) reduced factor nonzeros and RAM by 76%–77% and sped up factorisation 4–8× while falling back automatically to LU if any inter-supernode pivot fails.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Thin structures still defeat smoothed-aggregation LOBPCG:&lt;/strong&gt; Above 80,000 3D unknowns, &lt;code&gt;Auto&lt;/code&gt; tries multigrid-preconditioned &lt;code&gt;LOBPCG&lt;/code&gt; for the lowest eigenmodes, probes convergence, and trips &lt;code&gt;LobpcgOptions::stall_gain&lt;/code&gt; on slender two-element-thick shells where smoothed aggregates lock. When it stalls, the driver falls back explicitly to sparse factorisation and records the fallback in the solver log.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;what-was-ported-cleanly-and-sits-unused-today&quot;&gt;What Was Ported Cleanly — and Sits Unused Today&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;docs/ports/solvers/PROVENANCE.md&lt;/code&gt; documents the clean-room origin of &lt;code&gt;femsolve&lt;/code&gt;: every algorithm was either rewritten from documented PETSc/SLEPc specifications (without copying source or reading LGPL/CeCILL solvers such as BLOPEX or MUMPS) or derived directly from literature. Several solvers inside &lt;code&gt;femcore::linalg&lt;/code&gt; pass their own unit and contract tests yet are &lt;strong&gt;not selected automatically by production physics kernels&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ILU&lt;/code&gt; / &lt;code&gt;ICC&lt;/code&gt;, additive Schwarz (&lt;code&gt;schwarz&lt;/code&gt;), &lt;code&gt;fieldsplit&lt;/code&gt;, &lt;code&gt;Jacobi–Davidson&lt;/code&gt;, contour eigensolvers (&lt;code&gt;contour&lt;/code&gt; / &lt;code&gt;nep&lt;/code&gt;), &lt;code&gt;Chebyshev&lt;/code&gt; polynomial filtering (&lt;code&gt;chebfsi&lt;/code&gt;), &lt;code&gt;ADS&lt;/code&gt; H(div) auxiliary-space preconditioning, and &lt;code&gt;BLR&lt;/code&gt;/&lt;code&gt;HODLR&lt;/code&gt; low-rank factorisations.&lt;/li&gt;
&lt;li&gt;The standalone $P_2$ Nédélec Hiptmair–Xu auxiliary-space Maxwell solver &lt;code&gt;AmsP2&lt;/code&gt; (&lt;code&gt;crates/femcore/tests/linalg/fr16.rs&lt;/code&gt;): verified mathematically on 3D curl-curl systems, while &lt;code&gt;nyx-ems::cavity&lt;/code&gt; stays on &lt;code&gt;ShiftedFactorization&lt;/code&gt; (&lt;code&gt;LBL^H&lt;/code&gt; / &lt;code&gt;Sym LBL^T&lt;/code&gt;) until large-scale iterative cavity preconditioning is wired in (&lt;code&gt;ADR 0117&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Keeping those routines tested inside &lt;code&gt;femcore::linalg&lt;/code&gt; without letting uncalibrated heuristics pick them in user studies keeps failure modes honest and easy to inspect in the solver log.&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>3D Curved Cavities, Un-Averaged Slicing &amp; Epistemic Error Budgets</title>
        <published>2026-11-26T00:00:00+00:00</published>
        <updated>2026-11-26T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://nyxart.org/notes/05-asme-vv20-and-3d-cavity/"/>
        <id>https://nyxart.org/notes/05-asme-vv20-and-3d-cavity/</id>
        
        <content type="html" xml:base="https://nyxart.org/notes/05-asme-vv20-and-3d-cavity/">&lt;p&gt;Move a cavity simulation from 2D waveguides into 3D tetrahedra and two classic numerical headaches arrive at the same time: the infinite gradient nullspace $\nabla H^1(\Omega)$ threatens to flood zero-frequency modes into your eigensolver window, and curved metal or spherical boundaries turn jagged unless element geometry itself bends smoothly.&lt;/p&gt;
&lt;p&gt;In &lt;code&gt;nyx-ems::cavity&lt;/code&gt;, tetrahedral curl-curl discretisation uses first-kind tangentially continuous Nédélec elements (6 Whitney edges per tetrahedron at &lt;code&gt;order = 1&lt;/code&gt;, or 20 DOFs—12 edge/gradient plus 8 face functions—with quadratic &lt;code&gt;CurvedTet&lt;/code&gt; degree-6 integration at &lt;code&gt;order = 2&lt;/code&gt;), projecting out the discrete gradient kernel inside &lt;code&gt;projected_shift_invert_complex&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;plotting-fields-without-smearing-material-jumps&quot;&gt;Plotting Fields Without Smearing Material Jumps&lt;/h2&gt;
&lt;p&gt;Take &lt;code&gt;examples/20_cavity_3d_spherical_pml.nyx.json&lt;/code&gt;: a 25 mm air sphere surrounded by a 10 mm 5-layer spherical PML shell searched around 6.0 GHz. Solving 3,622 Nédélec DOFs finishes in 0.68 s and isolates the triply-degenerate fundamental leaky mode at &lt;code&gt;1.642 + 1.701i GHz&lt;/code&gt; ($Q = 0.483$) alongside a fourth mode at &lt;code&gt;2.824 + 2.557i GHz&lt;/code&gt; ($Q = 0.552$).&lt;/p&gt;
&lt;figure class=&quot;specimen-plate&quot;&gt;
  &lt;div class=&quot;specimen-plate-bar&quot;&gt;
    &lt;span class=&quot;specimen-plate-id&quot;&gt;PLATE 04&lt;/span&gt;
    &lt;span&gt;20_cavity_3d_spherical_pml · cutaway3d · 3,622 DOFs&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&quot;specimen-plate-media&quot;&gt;
    &lt;img src=&quot;https://nyxart.org/figures/cavity_3d_cutaway.png&quot; alt=&quot;3D orthographic cutaway rendering of four modes in an open spherical PML cavity&quot; loading=&quot;lazy&quot;&gt;
  &lt;/div&gt;
  &lt;figcaption class=&quot;specimen-plate-caption&quot;&gt;Orthographic cutaway3d view of 20_cavity_3d_spherical_pml (3,622 DOFs, 0.68 s): triply-degenerate fundamental leaky resonances (modes 1–3) followed by mode 4.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure class=&quot;specimen-plate&quot;&gt;
  &lt;div class=&quot;specimen-plate-bar&quot;&gt;
    &lt;span class=&quot;specimen-plate-id&quot;&gt;PLATE 05&lt;/span&gt;
    &lt;span&gt;20_cavity_3d_spherical_pml · slice3d plane=&quot;z&quot;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&quot;specimen-plate-media&quot;&gt;
    &lt;img src=&quot;https://nyxart.org/figures/cavity_3d_slice.png&quot; alt=&quot;Planar z-slice rendering of un-averaged CellFields inside the 3D spherical PML cavity&quot; loading=&quot;lazy&quot;&gt;
  &lt;/div&gt;
  &lt;figcaption class=&quot;specimen-plate-caption&quot;&gt;Planar slice3d cross-section across z = 0 evaluated directly on per-cell CellFields so normal-field discontinuities across material interfaces stay sharp.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Notice why &lt;code&gt;view3d&lt;/code&gt; deliberately refuses to average nodal values across shared vertices before drawing &lt;code&gt;cutaway3d&lt;/code&gt; and &lt;code&gt;slice3d&lt;/code&gt;: across any step in permittivity $\varepsilon$, normal electric fields $E_\perp$ jump physically. Traditional nodal post-processors average across element boundaries and erase the true surface peak. Keeping &lt;code&gt;CellFields&lt;/code&gt; per cell node (&lt;code&gt;cell_fields[c * nloc + a]&lt;/code&gt;) and evaluating expressions like &lt;code&gt;|E|&lt;/code&gt; or &lt;code&gt;abs2(E)&lt;/code&gt; inside each tetrahedron preserves every interface jump intact.&lt;span class=&quot;sn-wrap sn-wrap--labeled&quot;&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-sn-mms&quot; class=&quot;sn-toggle&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot;&gt;&lt;label for=&quot;sn-sn-mms&quot; class=&quot;sn-number&quot; role=&quot;button&quot; tabindex=&quot;0&quot; aria-controls=&quot;sn-note-sn-mms&quot; aria-expanded=&quot;false&quot; aria-label=&quot;Toggle sidenote 1&quot; title=&quot;Toggle sidenote&quot;&gt;1&lt;/label&gt;&lt;span id=&quot;sn-note-sn-mms&quot; class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sn-note-num&quot;&gt;1.&lt;/span&gt;To test assembly code without separate compilation paths, &lt;code&gt;femcore::vvuq&lt;/code&gt; uses a zero-sized generic &lt;code&gt;SourceField&lt;/code&gt; trait (&lt;code&gt;UniformSource&lt;/code&gt; in production runs; &lt;code&gt;FnSource&lt;/code&gt; in Method of Manufactured Solutions checks) so tests execute identical quadrature and Piola mappings.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div class=&quot;solver-log&quot;&gt;
  &lt;div class=&quot;solver-log-head&quot;&gt;
    &lt;span class=&quot;solver-log-title&quot;&gt;SOLVER STDOUT&lt;/span&gt;
    &lt;button type=&quot;button&quot;
            class=&quot;btn-copy&quot;
            data-copy-btn
            data-copy-text=&quot;nyx run render_site_figures.nys  # 20_cavity_3d_spherical_pml&quot;&gt;Copy&lt;/button&gt;
  &lt;/div&gt;
  &lt;div class=&quot;solver-log-cmd&quot;&gt;
    &lt;code&gt;$ nyx run render_site_figures.nys  # 20_cavity_3d_spherical_pml&lt;/code&gt;
  &lt;/div&gt;
  &lt;pre class=&quot;solver-log-pre&quot;&gt;&lt;code&gt;ems: cavity, order=1, dim=3, dofs=3622, seconds=0.6795
  solver_kind: projected_shift_invert_complex, converged: true, restarts: 135
  max_algebraic_residual: 1.0544204088520082e-08
  mode 1: 1.642024e9 + 1.701e9i Hz  (Q = 4.827e-1, layer_frac = 0.9067, res = 5.610e-09)
  mode 2: 1.642024e9 + 1.701e9i Hz  (Q = 4.827e-1, layer_frac = 0.9067, res = 1.054e-08)
  mode 3: 1.642024e9 + 1.701e9i Hz  (Q = 4.827e-1, layer_frac = 0.9067, res = 8.801e-09)
  mode 4: 2.824384e9 + 2.557e9i Hz  (Q = 5.522e-1, layer_frac = 0.7033, res = 2.225e-11)&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h2 id=&quot;keeping-epistemic-bounds-out-of-gaussian-error-bars&quot;&gt;Keeping Epistemic Bounds Out of Gaussian Error Bars&lt;/h2&gt;
&lt;p&gt;Throughout &lt;code&gt;crates/nyx-engine/tests/validation_*.rs&lt;/code&gt;, benchmarks follow the ASME V&amp;amp;V 20 comparison rule. Given a simulation output $S$ and experimental or cross-code reference $D$, the discrepancy $E = S - D$ must clear both the engineering tolerance and the expanded validation uncertainty together:&lt;/p&gt;
&lt;p&gt;$$
|E| \le \mathrm{tol}_{\mathrm{rel}}|D| + \mathrm{tol}_{\mathrm{abs}} \qquad \text{AND} \qquad |E| \le k \sqrt{u_{\mathrm{num}}^2 + u_{\mathrm{input}}^2 + u_D^2}
$$&lt;/p&gt;
&lt;p&gt;When mesh error comes from Richardson 2-grid or 3-grid refinement, $u_{\text{num}}$ enters inside the square root. When a dual Prager–Synge solve produces a hard deterministic interval $[S_{\mathrm{low}}, S_{\mathrm{up}}]$ instead, we never smear its epistemic half-width $\delta_{\mathrm{ep}} = \frac{1}{2}(S_{\mathrm{up}} - S_{\mathrm{low}})$ into Gaussian variance—the check adds $\delta_{\mathrm{ep}}$ linearly outside the radical so every single source of uncertainty stays visible.&lt;/p&gt;
&lt;p&gt;Representative baselines verified in this framework span the 40 × 20 × 30 mm lossy copper cavity (&lt;code&gt;TE101&lt;/code&gt; at 6.245676 GHz, Pozar surface-loss $Q_0 = 10,806.04$, plus driven &lt;code&gt;CircuitRom&lt;/code&gt; vs Taubin $S_{21}$ parity) and the NAFEMS &lt;code&gt;T1–T4&lt;/code&gt; thermal and Timoshenko Si/Al bimorph benchmarks.&lt;/p&gt;
&lt;h2 id=&quot;parallel-thread-drift-absorber-mode-filtering&quot;&gt;Parallel Thread Drift &amp;amp; Absorber Mode Filtering&lt;/h2&gt;
&lt;p&gt;Two practical limits from deep 3D runs are worth stating plainly:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Multi-threaded sparse direct factorisation drift in 3D &lt;code&gt;ems&lt;/code&gt;:&lt;/strong&gt; While 3D electrostatic AMG (&lt;code&gt;dfs&lt;/code&gt;) is bitwise reproducible (&lt;code&gt;0.000e+00&lt;/code&gt;) between 1 and 8 threads across every tested circuit, multi-threaded sparse LU/LDL&lt;sup&gt;T&lt;/sup&gt; inside &lt;code&gt;faer&lt;/code&gt; currently shows &lt;code&gt;3.59e-10&lt;/code&gt; to &lt;code&gt;1.15e-7&lt;/code&gt; relative drift across thread counts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Over-asking around open PML absorbers:&lt;/strong&gt; In cavities wrapped by lossy spherical shells, continuous absorber modes often cluster near the shift frequency. Asking the Krylov eigensolver for extra modes and pruning high &lt;code&gt;layer_frac&lt;/code&gt; solutions keeps physical resonances from being crowded out.&lt;/li&gt;
&lt;/ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Measuring MEMS Anchor Loss With Complex Coordinate Stretching</title>
        <published>2026-11-25T00:00:00+00:00</published>
        <updated>2026-11-25T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://nyxart.org/notes/04-anchor-loss-and-pml-elasticity/"/>
        <id>https://nyxart.org/notes/04-anchor-loss-and-pml-elasticity/</id>
        
        <content type="html" xml:base="https://nyxart.org/notes/04-anchor-loss-and-pml-elasticity/">&lt;p&gt;Clamp the base of a finite MEMS wafer block rigidly and every mechanical mode looks artificially lossless: elastic waves travelling down the support stem simply bounce off the outer mesh wall and echo back into the resonator. Swap the clamp for a viscous dashpot (&lt;code&gt;lrb&lt;/code&gt;) and waves hitting at oblique angles still reflect, while the frequency dependence turns the eigenproblem quadratic.&lt;/p&gt;
&lt;p&gt;Surround the substrate instead with a curvilinear Perfectly Matched Layer (&lt;code&gt;femcore::pml&lt;/code&gt; and &lt;code&gt;nyx-sms::pml&lt;/code&gt;) and the system stays a linear generalised eigenproblem $K(\tilde{\mathbf{x}})\mathbf{u} = \omega^2 M(\tilde{\mathbf{x}})\mathbf{u}$. Outgoing waves decay smoothly inside the absorbing collar, leaving complex eigenfrequencies $f = f_{\mathrm{re}} + i f_{\mathrm{im}}$ that report anchor radiation damping directly as $Q = \mathrm{Re}(f) / (2|\mathrm{Im}(f)|)$.&lt;/p&gt;
&lt;h2 id=&quot;pulling-back-strains-without-complex-conjugation&quot;&gt;Pulling Back Strains Without Complex Conjugation&lt;/h2&gt;
&lt;p&gt;Under &lt;code&gt;nyx&lt;/code&gt;’s $e^{+i\omega t}$ time convention, outgoing waves decay whenever real spatial coordinates continue into the fourth complex quadrant along each active absorbing normal:&lt;/p&gt;
&lt;p&gt;$$
s(t) = \kappa(t) - i \psi(t), \qquad \kappa(t) \ge 1, \quad \psi(t) \ge 0, \quad t \in [0, 1]
$$&lt;/p&gt;
&lt;p&gt;At each quadrature point, &lt;code&gt;pml_jacobian&lt;/code&gt; evaluates the metric Jacobian $J_s = \partial \tilde{\mathbf{x}} / \partial \mathbf{x}$, its analytical inverse, and $\det J_s$. One mathematical detail makes or breaks convergence: variational assembly must use the &lt;strong&gt;non-conjugated complex-symmetric bilinear form&lt;/strong&gt;, pulling strains back via $J_s^{-T}$ and scaling element volumes by $\det J_s$ rather than conjugating shape derivatives.&lt;span class=&quot;sn-wrap sn-wrap--labeled&quot;&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-sn-pml-order&quot; class=&quot;sn-toggle&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot;&gt;&lt;label for=&quot;sn-sn-pml-order&quot; class=&quot;sn-number&quot; role=&quot;button&quot; tabindex=&quot;0&quot; aria-controls=&quot;sn-note-sn-pml-order&quot; aria-expanded=&quot;false&quot; aria-label=&quot;Toggle sidenote 1&quot; title=&quot;Toggle sidenote&quot;&gt;1&lt;/label&gt;&lt;span id=&quot;sn-note-sn-pml-order&quot; class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sn-note-num&quot;&gt;1.&lt;/span&gt;A quadratic grading ramp (&lt;code&gt;order = 2.0&lt;/code&gt;) keeps $s(0) = 1$ at the substrate interface so mesh transitions stay reflectionless, while real stretching $\kappa &amp;gt; 1$ damps evanescent near-field tails faster inside compact boxes.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id=&quot;watching-substrate-modes-separate-from-beam-modes&quot;&gt;Watching Substrate Modes Separate From Beam Modes&lt;/h2&gt;
&lt;p&gt;In &lt;code&gt;examples/11_anchor_loss.nyx.json&lt;/code&gt;, a &lt;code&gt;20 mm × 300 mm&lt;/code&gt; steel beam rests atop a &lt;code&gt;600 mm × 350 mm&lt;/code&gt; substrate flanked on three sides by 5-layer Cartesian PML wings. Solving 4,832 P2 DOFs takes 0.086 seconds and cleanly separates sharp beam bending modes from continuous damped waves inside the substrate:&lt;/p&gt;
&lt;figure class=&quot;specimen-plate&quot;&gt;
  &lt;div class=&quot;specimen-plate-bar&quot;&gt;
    &lt;span class=&quot;specimen-plate-id&quot;&gt;PLATE 03&lt;/span&gt;
    &lt;span&gt;11_anchor_loss · sms::eigenfrequency · 4,832 DOFs&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&quot;specimen-plate-media&quot;&gt;
    &lt;img src=&quot;https://nyxart.org/figures/anchor_loss_modes.png&quot; alt=&quot;Six elastic-PML eigenmodes of a beam anchored to a PML substrate&quot; loading=&quot;lazy&quot;&gt;
  &lt;/div&gt;
  &lt;figcaption class=&quot;specimen-plate-caption&quot;&gt;First six modes of 11_anchor_loss (4,832 DOFs, 0.086 s): flexural beam resonances (modes 1, 2, and 6; Q = 14,444.6 down to 119.3) stand apart from strongly absorbed substrate modes 3–5 (Q = 1.46–1.61).&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div class=&quot;solver-log&quot;&gt;
  &lt;div class=&quot;solver-log-head&quot;&gt;
    &lt;span class=&quot;solver-log-title&quot;&gt;SOLVER STDOUT&lt;/span&gt;
    &lt;button type=&quot;button&quot;
            class=&quot;btn-copy&quot;
            data-copy-btn
            data-copy-text=&quot;nyx run render_site_figures.nys  # 11_anchor_loss&quot;&gt;Copy&lt;/button&gt;
  &lt;/div&gt;
  &lt;div class=&quot;solver-log-cmd&quot;&gt;
    &lt;code&gt;$ nyx run render_site_figures.nys  # 11_anchor_loss&lt;/code&gt;
  &lt;/div&gt;
  &lt;pre class=&quot;solver-log-pre&quot;&gt;&lt;code&gt;sms: eigenfrequency, order=2, dim=2, dofs=4832, seconds=0.0858
  solver_kind: shift_invert_complex, converged: true, restarts: 9
  max_algebraic_residual: 6.254677404565312e-12
  mode 1: 183.703 Hz + 6.359e-3i Hz   (Q = 14444.57, layer_frac = 2.714e-07, P_pml = 553.37 W)
  mode 2: 1132.207 Hz + 0.4566i Hz    (Q =  1239.95, layer_frac = 9.086e-05, P_pml = 251.08 kW)
  mode 3: 2286.157 Hz + 710.22i Hz    (Q =     1.61, layer_frac = 2.715e-01, P_pml = 36.66 GW)
  mode 4: 2410.962 Hz + 827.02i Hz    (Q =     1.46, layer_frac = 3.537e-01, P_pml = 105.59 GW)
  mode 5: 2762.168 Hz + 925.32i Hz    (Q =     1.49, layer_frac = 5.202e-01, P_pml = 87.59 GW)
  mode 6: 3096.439 Hz + 12.979i Hz    (Q =   119.28, layer_frac = 5.753e-03, P_pml = 20.48 MW)
  unstable_modes = 0&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Notice how &lt;code&gt;layer_frac&lt;/code&gt;—the fraction of elastic energy sitting inside the PML collar—acts as an automatic physical classifier: true cantilever modes keep 99.4% to 99.9999% of their motion in the beam and substrate core, whereas spurious box modes (&lt;code&gt;3&lt;/code&gt;, &lt;code&gt;4&lt;/code&gt;, &lt;code&gt;5&lt;/code&gt;) dump 27% to 52% of their energy straight into the absorber with $Q &amp;lt; 2$.&lt;/p&gt;
&lt;h2 id=&quot;taming-anisotropic-backward-waves-r-0-regularity&quot;&gt;Taming Anisotropic Backward Waves &amp;amp; $r = 0$ Regularity&lt;/h2&gt;
&lt;p&gt;Single-crystal substrates add a nasty physical trap: along concave regions of the Christoffel slowness surface, a wave’s group velocity and phase velocity can point in opposite directions ($\mathbf{v}_p \cdot \mathbf{v}_g &amp;lt; 0$). Feed one of those backward-wave cones into a standard complex stretch and the PML flips from an absorber into an amplifier (&lt;code&gt;Im f &amp;lt; 0&lt;/code&gt;), seeding unstable growing modes. Before assembling element matrices, &lt;code&gt;nyx-sms::pml&lt;/code&gt; inspects the wafer-rotated stiffness tensor via &lt;code&gt;backward_wave_mpml_ratio&lt;/code&gt;, applying multi-axial real stretching stabilisation automatically whenever backward cones cross an absorbing boundary.&lt;/p&gt;
&lt;p&gt;For circular disk resonators modelled in cylindrical coordinates (&lt;code&gt;sms::axisymmetric_eigenfrequency&lt;/code&gt;), azimuthal displacement varies as $e^{-i m \theta}$ and the $1/r$ hoop-strain terms require exact regularity right on the symmetry axis $r = 0$:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Torsional and radial-axial breathing modes ($m = 0$) clamp radial and twist motion ($u_r = u_\theta = 0$).&lt;/li&gt;
&lt;li&gt;Flexural tilt modes ($|m| = 1$) clamp axial lift ($u_z = 0$).&lt;/li&gt;
&lt;li&gt;Higher whispering-gallery harmonics ($|m| \ge 2$) vanish completely on axis ($u_r = u_z = u_\theta = 0$).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Validated against Bindel and Govindjee’s 2005 polysilicon disk-on-post benchmark (&lt;code&gt;R = 6 µm&lt;/code&gt;, &lt;code&gt;450.155 MHz&lt;/code&gt;), cylindrical PML wings remain invariant across absorber thickness and damping strength without spuriously pinning the axis.&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Bridging 3D Cavity Maxwell Solves and Nonlinear Circuit Hamiltonians</title>
        <published>2026-11-24T00:00:00+00:00</published>
        <updated>2026-11-24T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://nyxart.org/notes/03-craig-bampton-and-kubo-bbq/"/>
        <id>https://nyxart.org/notes/03-craig-bampton-and-kubo-bbq/</id>
        
        <content type="html" xml:base="https://nyxart.org/notes/03-craig-bampton-and-kubo-bbq/">&lt;p&gt;Weakly anharmonic transmons get along surprisingly well with textbook normal-mode Fock quantisation: cosine mixing drops off rapidly after six or eight photon levels per mode, so a tensor-product Fock basis captures qubit frequencies and cross-Kerr shifts effortlessly.&lt;/p&gt;
&lt;p&gt;Swap in a Fluxonium, a Cooper-pair box, or a flux-biased DC-SQUID coupler, however, and normal-mode quantisation falls behind almost immediately. Heavy inductive shunts and steep multi-well potentials require thirty or forty local port states before a junction wavefunction settles, and multiplying 40 states across four or five electromagnetic modes overflows workstation memory long before a single flux sweep finishes.&lt;/p&gt;
&lt;p&gt;The way out in &lt;code&gt;nyx-analysis::hamiltonian&lt;/code&gt; comes from structural dynamics: the Craig–Bampton method.&lt;/p&gt;
&lt;h2 id=&quot;splitting-nonlinear-junctions-from-linear-cavities&quot;&gt;Splitting Nonlinear Junctions From Linear Cavities&lt;/h2&gt;
&lt;p&gt;From the 3D Maxwell solve, &lt;code&gt;nyx-ems::cavity&lt;/code&gt; extracts a compact port-augmented reduced-order model (&lt;code&gt;CircuitRom&lt;/code&gt;). &lt;code&gt;build_linear_cb_decomposition&lt;/code&gt; rotates those reduced coordinates into two orthogonal blocks relative to the $J$ Josephson junctions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Port lifts ($T_p$):&lt;/strong&gt; static unit-flux displacements associated directly with each nonlinear port ($\mathbf{B}_{r,\mathrm{nl}}^T T_p = I_J$).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shorted interior cavity modes ($T_c$):&lt;/strong&gt; normal eigenmodes of the electromagnetic enclosure computed with every junction port shorted ($\mathbf{B}_{r,\mathrm{nl}}^T T_c = 0$).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Each 1D nonlinear port can then be diagonalised on its own before talking to the cavity modes: shunted loops ($E_{L,\mathrm{eff}} &amp;gt; 1,\text{kHz}$) use a 40-state harmonic basis with Padé-13 matrix exponentials, while charge-sensitive islands use a 31-state periodic charge basis. Keeping only the lowest 8 local eigenstates per junction before coupling shrinks the final many-body Hilbert space cleanly below 4,096 states—fast enough to sweep 100 bias flux points in roughly 1.1 seconds.&lt;span class=&quot;sn-wrap sn-wrap--labeled&quot;&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-sn-labeling&quot; class=&quot;sn-toggle&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot;&gt;&lt;label for=&quot;sn-sn-labeling&quot; class=&quot;sn-number&quot; role=&quot;button&quot; tabindex=&quot;0&quot; aria-controls=&quot;sn-note-sn-labeling&quot; aria-expanded=&quot;false&quot; aria-label=&quot;Toggle sidenote 1&quot; title=&quot;Toggle sidenote&quot;&gt;1&lt;/label&gt;&lt;span id=&quot;sn-note-sn-labeling&quot; class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sn-note-num&quot;&gt;1.&lt;/span&gt;To extract dressed frequencies, anharmonicities, and cross-Kerr couplings consistently as modes cross, eigenvalues are assigned to bare product labels via globally bijective greedy matching on overlap magnitudes $|\langle n | \psi_k \rangle|^2$.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id=&quot;three-independent-cross-checks-on-the-same-3d-mesh&quot;&gt;Three Independent Cross-Checks on the Same 3D Mesh&lt;/h2&gt;
&lt;p&gt;Because numerical bugs in quantum circuit extraction are notoriously easy to hide inside one method, we cross-checked Craig–Bampton against two completely separate linear-response derivations on 12 SQuADDS transmon-resonator meshes (six $\lambda/4$ couplers and six $\lambda/2$ &lt;code&gt;NCap&lt;/code&gt; designs, 149.8k–221.8k tetrahedra each):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Companion QEP (&lt;code&gt;M2&lt;/code&gt;):&lt;/strong&gt; Keeps feedline ports open and solves the balanced $2r \times 2r$ complex quadratic eigenvalue problem $(K + i k_0 C - k_0^2 M)\mathbf{z} = 0$ directly.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;3-Port Schur BBQ + Kubo Synthesis (&lt;code&gt;M3&lt;/code&gt;):&lt;/strong&gt; Drives the full 3D mesh across frequency, eliminates $50,\Omega$-terminated feedline ports via Schur complement&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;$$
Y_{\mathrm{red}}(\omega) = Y_{AA}(\omega) - Y_{AT}(\omega)\left(Y_{TT}(\omega) + Y_{\mathrm{load}}\right)^{-1} Y_{TA}(\omega)
$$&lt;/p&gt;
&lt;p&gt;and extracts Foster parallel zeros alongside exact two-pole Kubo linear susceptibilities.&lt;/p&gt;
&lt;p&gt;Across all 12 geometries on identical meshes, closed Craig–Bampton (&lt;code&gt;M1&lt;/code&gt;) agreed with companion QEP (&lt;code&gt;M2&lt;/code&gt;) to 1.38e-6% median frequency difference and with driven Schur BBQ (&lt;code&gt;M3&lt;/code&gt;) to 5.0e-6% (&lt;code&gt;11/12&lt;/code&gt; within &lt;code&gt;0.0001%&lt;/code&gt;), while the Thomas–Reiche–Kuhn oscillator-strength sum rule held to $1.000000000000 \pm 2.7\times 10^{-10}$.&lt;/p&gt;
&lt;div class=&quot;solver-log&quot;&gt;
  &lt;div class=&quot;solver-log-head&quot;&gt;
    &lt;span class=&quot;solver-log-title&quot;&gt;SOLVER STDOUT&lt;/span&gt;
    &lt;button type=&quot;button&quot;
            class=&quot;btn-copy&quot;
            data-copy-btn
            data-copy-text=&quot;cargo test --release -p nyx-analysis --test squadds_smoke -- --test-threads=1&quot;&gt;Copy&lt;/button&gt;
  &lt;/div&gt;
  &lt;div class=&quot;solver-log-cmd&quot;&gt;
    &lt;code&gt;$ cargo test --release -p nyx-analysis --test squadds_smoke -- --test-threads=1&lt;/code&gt;
  &lt;/div&gt;
  &lt;pre class=&quot;solver-log-pre&quot;&gt;&lt;code&gt;transmon_cross_3net_mode_g2_far_field_and_i_edge_thickness_smoke ... ok
dissipator_dc_squid_craig_bampton_vs_rom_port_flux_sweep_smoke ... ok
  4-mode S4.3 Dissipator ROM (qubit, dissipator_jj, readout, filter):
  25-point native squid_flux_sweep (10.32 -&gt; 2.93 GHz in &lt; 0.25 s)
  matches point-by-point ej_hz_override craig_bampton eigenvalues to &lt; 1e-12
muninn_3d_tls_participation_nine_param_oxide_and_purcell_smoke ... ok&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h2 id=&quot;what-cryogenic-hardware-tests-showed-and-where-accuracy-currently-stops&quot;&gt;What Cryogenic Hardware Tests Showed — and Where Accuracy Currently Stops&lt;/h2&gt;
&lt;p&gt;On full multi-qubit chips fabricated at cryogenic temperatures (&lt;code&gt;Phase 1&lt;/code&gt;, 30 of 30 runs completing cleanly):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;WM1 (6-qubit MIT-LL chip):&lt;/strong&gt; Including the mask-measured +0.9 µm lithographic over-etch bias, &lt;code&gt;ems::cavity&lt;/code&gt; predicts all six multiplexed readout frequencies to 1.32% RMSRE against mK measurements (2.3× closer than the 3.0% published HFSS baseline).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MUNINN (3-qubit coherence chip):&lt;/strong&gt; On a 1.085M-tet (1.402M-DOF) full-chip model solved in 82.55 s, &lt;code&gt;nyx&lt;/code&gt; reproduces the exact measured $T_1$ ranking across Ancilla, Qubit, and Environment resonators.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dissipator (flux-tunable coupler):&lt;/strong&gt; Sweeps 100 DC-SQUID bias points in 1.10 s, cleanly resolving the 166.8 MHz cavity avoided crossing.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Two practical trade-offs still govern day-to-day runs. First, refining mesh vertices directly inside thin lumped junction or port sheets drops zero-frequency gradient columns during 3D cavity projection and stalls Krylov–Schur; locking a narrow 30 µm unrefined box around rank-1 ports eliminates every stall (&lt;code&gt;163/163&lt;/code&gt; EM solves succeed), but forces P1 elements to overestimate local port capacitance across sub-micron gaps (&lt;code&gt;hybrid&lt;/code&gt; electrostatic coupling cuts that error 10×). Second, without dedicated 3D edge-singularity grading inside &lt;code&gt;ems::cavity&lt;/code&gt;, P1 Nédélec fields smooth over the sharp rim field divergence—preserving device-to-device $T_1$ rankings while underestimating absolute interface participation $p_{\mathrm{interface}}$.&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Avoiding Spurious Waveguide Modes in Mixed Nédélec Elements</title>
        <published>2026-11-23T00:00:00+00:00</published>
        <updated>2026-11-23T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://nyxart.org/notes/02-vector-p2-soi-waveguides/"/>
        <id>https://nyxart.org/notes/02-vector-p2-soi-waveguides/</id>
        
        <content type="html" xml:base="https://nyxart.org/notes/02-vector-p2-soi-waveguides/">&lt;p&gt;Anyone who has tried solving a high-index optical waveguide with ordinary scalar nodal elements recognizes the headache: mixed into the real guided modes are unphysical “spurious” eigenvalues whose fields oscillate wildly near sharp corners.&lt;/p&gt;
&lt;p&gt;The geometry of Maxwell’s equations explains why. At the boundary of a silicon wire ($n_{\mathrm{Si}} \approx 3.48$) clad in oxide ($n_{\mathrm{SiO}_2} \approx 1.44$), tangential electric fields remain continuous while the normal component $E_\perp$ must jump by a factor of $\varepsilon_1 / \varepsilon_2 \approx 5.8$. Nodal Lagrange elements force every vector component to be continuous across element edges—so either the solver smooths over a physical jump or it hallucinates gradient modes $\mathbf{E} = \nabla \psi$ that fail $\nabla \cdot (\varepsilon \mathbf{E}) = 0$.&lt;/p&gt;
&lt;p&gt;Inside &lt;code&gt;nyx-ems::modes&lt;/code&gt;, we banish spurious modes from the function space itself rather than trying to filter them out afterwards.&lt;/p&gt;
&lt;h2 id=&quot;mixed-curl-curl-eigenmodes-in-the-wafer-frame&quot;&gt;Mixed Curl-Curl Eigenmodes in the Wafer Frame&lt;/h2&gt;
&lt;p&gt;Every cross-section model lives in the wafer frame: &lt;code&gt;x&lt;/code&gt; lies laterally across the chip, &lt;code&gt;z&lt;/code&gt; points normal to the wafer surface, and guided waves propagate along &lt;code&gt;+y&lt;/code&gt; as $\mathbf{E}(x, y, z) = (\mathbf{E}_t(x, z) + \hat{\mathbf{y}} E_y(x, z)) e^{-j\beta y}$.&lt;span class=&quot;sn-wrap sn-wrap--labeled&quot;&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-sn-wafer&quot; class=&quot;sn-toggle&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot;&gt;&lt;label for=&quot;sn-sn-wafer&quot; class=&quot;sn-number&quot; role=&quot;button&quot; tabindex=&quot;0&quot; aria-controls=&quot;sn-note-sn-wafer&quot; aria-expanded=&quot;false&quot; aria-label=&quot;Toggle sidenote 1&quot; title=&quot;Toggle sidenote&quot;&gt;1&lt;/label&gt;&lt;span id=&quot;sn-note-sn-wafer&quot; class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sn-note-num&quot;&gt;1.&lt;/span&gt;Crystal permittivity and permeability tensors are rotated once inside &lt;code&gt;femcore::section::local_tensor&lt;/code&gt; so solvers operate in consistent local axes while fields export under wafer names (&lt;code&gt;Ex&lt;/code&gt;, &lt;code&gt;Ez&lt;/code&gt; transverse; &lt;code&gt;Ey&lt;/code&gt; along propagation).&lt;/span&gt;&lt;/span&gt; Rescaling the longitudinal component to $\phi = E_y / (j\beta)$ splits the transverse vector field into degree-2 Nédélec edge elements ($e_t$, 8 DOFs per triangle: 3 Whitney edge functions, 3 edge-bubble gradients, and 2 interior functions) paired with quadratic P2 Lagrange elements for $\phi$:&lt;/p&gt;
&lt;p&gt;$$
\begin{bmatrix} S - k_0^2 T_e &amp;amp; 0 \\ 0 &amp;amp; 0 \end{bmatrix} \begin{bmatrix} e_t \\ \phi \end{bmatrix} = -\beta^2 \begin{bmatrix} T_m &amp;amp; G \\ G^T &amp;amp; K_p - k_0^2 T_p \end{bmatrix} \begin{bmatrix} e_t \\ \phi \end{bmatrix}
$$&lt;/p&gt;
&lt;p&gt;Here $S$ is the curl-curl stiffness matrix, $T_e$ and $T_m$ are edge mass blocks weighted by $\varepsilon_r$ and $\mu_r^{-1}$, and $G$ couples edge fields to $\nabla_t \lambda$. Every discrete gradient field sits strictly at $\beta^2 = 0$ by de Rham exactness, leaving the shift-and-invert Krylov solver free to lock cleanly onto physical modes near a target index.&lt;/p&gt;
&lt;h2 id=&quot;testing-on-a-silicon-on-insulator-wire&quot;&gt;Testing on a Silicon-on-Insulator Wire&lt;/h2&gt;
&lt;p&gt;To see the formulation in action, take the standard &lt;code&gt;500 × 300 nm&lt;/code&gt; silicon strip waveguide (&lt;code&gt;15_soi_wire&lt;/code&gt;) at 1550 nm with 986 triangles across the core and oxide cladding:&lt;/p&gt;
&lt;figure class=&quot;specimen-plate&quot;&gt;
  &lt;div class=&quot;specimen-plate-bar&quot;&gt;
    &lt;span class=&quot;specimen-plate-id&quot;&gt;PLATE 01&lt;/span&gt;
    &lt;span&gt;15_soi_wire · 2,015 DOFs · 0.08 s&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&quot;specimen-plate-media&quot;&gt;
    &lt;img src=&quot;https://nyxart.org/figures/soi_wire_modes.png&quot; alt=&quot;SOI wire waveguide TE0 and TM0 electric field gallery at 1550 nm&quot; loading=&quot;lazy&quot;&gt;
  &lt;/div&gt;
  &lt;figcaption class=&quot;specimen-plate-caption&quot;&gt;Fundamental TE0 (left, neff = 2.671811, ng = 4.1969, 94.5% power in Si) and TM0 (right, neff = 2.333849, ng = 4.6294, 85.1% in Si) resolved on a 986-triangle P2 mesh.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Compared against archived Lumerical and MPB reference indices (&lt;code&gt;2.67179&lt;/code&gt; for TE0 and &lt;code&gt;2.33374&lt;/code&gt; for TM0), even this lightweight mesh lands within 7.9 ppm on TE0 and 47 ppm on TM0 in 80 milliseconds:&lt;/p&gt;
&lt;div class=&quot;solver-log&quot;&gt;
  &lt;div class=&quot;solver-log-head&quot;&gt;
    &lt;span class=&quot;solver-log-title&quot;&gt;SOLVER STDOUT&lt;/span&gt;
    &lt;button type=&quot;button&quot;
            class=&quot;btn-copy&quot;
            data-copy-btn
            data-copy-text=&quot;nyx --batch examples/15_soi_wire.nyx.json&quot;&gt;Copy&lt;/button&gt;
  &lt;/div&gt;
  &lt;div class=&quot;solver-log-cmd&quot;&gt;
    &lt;code&gt;$ nyx --batch examples/15_soi_wire.nyx.json&lt;/code&gt;
  &lt;/div&gt;
  &lt;pre class=&quot;solver-log-pre&quot;&gt;&lt;code&gt;986 cells, 515 points
ems: solved in 0.08 s, 2015 dofs, 2 solution(s)
  neff 1 = 2.671811
  v_g 1 (m/s) = 71431926.58486077
  n_g 1 = 4.19689727455199
  Ex share 1 = 0.8002390961141337
  Ey share 1 = 0.19720412785316194
  Ez share 1 = 0.0025567760327043277
  share in Si 1 = 0.9451175893630006
  neff 2 = 2.333849
  v_g 2 (m/s) = 64758283.71708667
  n_g 2 = 4.629407093457278
  Ex share 2 = 0.011127642624896001
  Ey share 2 = 0.38206400952785785
  Ez share 2 = 0.606808347847246
  share in Si 2 = 0.8510136106501677
  field frame = lateral x, normal z, propagation y, left-handed
what the solver did:
  solving EM waves (mode analysis) on a 2D mesh of 986 cells: 0.08 s
    factorising a sparse general matrix (6819 unknowns, 150676 non-zeros); this cannot be interrupted: 0.04 s&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;One honest detail the solver reports on this coarse 986-cell mesh: because the search shift sits at &lt;code&gt;n_target = 2.75&lt;/code&gt;, close to TE0 (&lt;code&gt;2.672&lt;/code&gt;), mode 1 converges cleanly (&lt;code&gt;1.33e-4&lt;/code&gt; residual) while mode 2 (&lt;code&gt;TM0&lt;/code&gt;, &lt;code&gt;2.334&lt;/code&gt;) finishes with a slightly higher &lt;code&gt;2.10e-3&lt;/code&gt; algebraic residual after 14 Arnoldi restarts. Aiming &lt;code&gt;n_target&lt;/code&gt; closer to &lt;code&gt;2.35&lt;/code&gt; or refining the cladding mesh drops both residuals below &lt;code&gt;1e-12&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;polarisation-invariants-that-ignore-solver-phase&quot;&gt;Polarisation Invariants That Ignore Solver Phase&lt;/h2&gt;
&lt;p&gt;Eigensolvers return fields scaled by an arbitrary complex phase $e^{i\theta}$, which means inspecting raw &lt;code&gt;Ex&lt;/code&gt; and &lt;code&gt;Ez&lt;/code&gt; components at one grid point can flip sign or swap real and imaginary parts across runs. &lt;code&gt;nyx-analysis::polarization&lt;/code&gt; solves this by integrating bilinear Stokes parameters across the waveguide cross-section:&lt;/p&gt;
&lt;p&gt;$$
S_0 = |E_{\mathrm{lat}}|^2 + |E_{\mathrm{nor}}|^2, \qquad S_1 = |E_{\mathrm{lat}}|^2 - |E_{\mathrm{nor}}|^2, \qquad S_2 = 2,\mathrm{Re}(E_{\mathrm{lat}}^* E_{\mathrm{nor}}), \qquad S_3 = -2,\mathrm{Im}(E_{\mathrm{lat}}^* E_{\mathrm{nor}})
$$&lt;/p&gt;
&lt;p&gt;Since every Stokes component pairs a conjugate field with an unconjugated field, arbitrary phase factors cancel out identically, making orientation angle, ellipticity, and Poincaré-sphere distance completely reproducible.&lt;/p&gt;
&lt;h2 id=&quot;cylindrical-pml-annuli-without-splitting-quads&quot;&gt;Cylindrical PML Annuli Without Splitting Quads&lt;/h2&gt;
&lt;p&gt;Open structures such as whispering-gallery cylinders radiate small amounts of light outwards even in well-confined modes. Instead of truncating air with a hard metal box or splitting structured ring grids into skewed triangles, &lt;code&gt;nyx-ems&lt;/code&gt; extrudes native quadrilateral cylindrical PML shells orthogonal to the outer boundary (&lt;code&gt;18_wgm_cylindrical_pml&lt;/code&gt;), solving 5,225 DOFs to &lt;code&gt;8.7e-14&lt;/code&gt; residual in 0.38 s:&lt;/p&gt;
&lt;figure class=&quot;specimen-plate&quot;&gt;
  &lt;div class=&quot;specimen-plate-bar&quot;&gt;
    &lt;span class=&quot;specimen-plate-id&quot;&gt;PLATE 02&lt;/span&gt;
    &lt;span&gt;18_wgm_cylindrical_pml · 5,225 DOFs · 0.38 s&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&quot;specimen-plate-media&quot;&gt;
    &lt;img src=&quot;https://nyxart.org/figures/wgm_cyl_pml.png&quot; alt=&quot;Four whispering-gallery modes inside a dielectric cylinder with outward cylindrical PML&quot; loading=&quot;lazy&quot;&gt;
  &lt;/div&gt;
  &lt;figcaption class=&quot;specimen-plate-caption&quot;&gt;Modes 1–4 of 18_wgm_cylindrical_pml (5,225 DOFs, 0.38 s, max residual 8.716e-14): tightly confined core mode 1 through higher-order leaky modes 2–4.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div class=&quot;solver-log&quot;&gt;
  &lt;div class=&quot;solver-log-head&quot;&gt;
    &lt;span class=&quot;solver-log-title&quot;&gt;SOLVER STDOUT&lt;/span&gt;
    &lt;button type=&quot;button&quot;
            class=&quot;btn-copy&quot;
            data-copy-btn
            data-copy-text=&quot;nyx run render_site_figures.nys  # 18_wgm_cylindrical_pml&quot;&gt;Copy&lt;/button&gt;
  &lt;/div&gt;
  &lt;div class=&quot;solver-log-cmd&quot;&gt;
    &lt;code&gt;$ nyx run render_site_figures.nys  # 18_wgm_cylindrical_pml&lt;/code&gt;
  &lt;/div&gt;
  &lt;pre class=&quot;solver-log-pre&quot;&gt;&lt;code&gt;ems: modes, order=2, dim=2, dofs=5225, seconds=0.3793
  solver_kind: shift_invert_complex, converged: true, restarts: 64
  max_algebraic_residual: 8.716388532767634e-14
  mode 1: neff = 2.400572 -1.559e-10i   (n_g = 4.9502, core = 0.9900, res = 1.375e-15)
  mode 2: neff = 2.414624 +6.653e-09i   (n_g = 4.9195, core = 0.9899, res = 4.588e-14)
  mode 3: neff = 2.385004 +3.849e-08i   (n_g = 5.0502, core = 0.9932, res = 6.400e-14)
  mode 4: neff = 2.379766 +6.144e-08i   (n_g = 5.0591, core = 0.9932, res = 8.716e-14)&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Less than &lt;code&gt;4.2e-10&lt;/code&gt; of each mode’s energy sits inside the PML ring itself—confirming the modes live genuinely inside the dielectric cylinder rather than being artificial absorber reflections.&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Two-Sided Energy Bounds in Electrostatics</title>
        <published>2026-11-22T00:00:00+00:00</published>
        <updated>2026-11-22T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://nyxart.org/notes/01-prager-synge-dual-bounds/"/>
        <id>https://nyxart.org/notes/01-prager-synge-dual-bounds/</id>
        
        <content type="html" xml:base="https://nyxart.org/notes/01-prager-synge-dual-bounds/">&lt;p&gt;Compute the capacitance matrix of a planar superconducting circuit with standard finite elements and you immediately run into an awkward epistemological gap: the number looks plausible, the matrix is symmetric and positive definite, and yet you have no idea how far away the true continuum value still sits.&lt;/p&gt;
&lt;p&gt;Because a standard electrostatic solver searches over conforming scalar potentials $V_h \in H^1(\Omega)$ that satisfy the terminal voltages exactly, Thomson’s minimum-energy theorem pushes the computed energy strictly above the exact electrostatic energy. Every self-capacitance entry on the diagonal is an overestimate. Refining the mesh lowers the numbers towards the truth, but unless you build a second, qualitatively different solver, you never know whether your last refinement brought you within 1% or left you 10% high.&lt;span class=&quot;sn-wrap sn-wrap--labeled&quot;&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-sn-thomson&quot; class=&quot;sn-toggle&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot;&gt;&lt;label for=&quot;sn-sn-thomson&quot; class=&quot;sn-number&quot; role=&quot;button&quot; tabindex=&quot;0&quot; aria-controls=&quot;sn-note-sn-thomson&quot; aria-expanded=&quot;false&quot; aria-label=&quot;Toggle sidenote 1&quot; title=&quot;Toggle sidenote&quot;&gt;1&lt;/label&gt;&lt;span id=&quot;sn-note-sn-thomson&quot; class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sn-note-num&quot;&gt;1.&lt;/span&gt;In multi-conductor layouts, cross-capacitance entries need a Loewner matrix bound rather than just a scalar interval, because cancellation between large electrode capacitances can amplify small field errors.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;To close that gap inside every run, &lt;code&gt;femcore::rt&lt;/code&gt; pairs each primal Lagrange solve with an equilibrated $H(\mathrm{div}; \Omega)$ flux field $\tilde{\mathbf{D}}^{(j)} \in \mathrm{RT}_{p-1}$, sandwiching the true Maxwell capacitance matrix from both sides:&lt;/p&gt;
&lt;p&gt;$$
C^{\mathrm{low}} \preceq C^{\mathrm{exact}} \preceq C^{\mathrm{up}}
$$&lt;/p&gt;
&lt;h2 id=&quot;solving-local-half-stars-around-metal-sheets&quot;&gt;Solving Local Half-Stars Around Metal Sheets&lt;/h2&gt;
&lt;p&gt;A complementary energy principle works in the opposite direction from Thomson’s theorem: any divergence-free vector field $\tilde{\mathbf{D}}^{(j)}$ matching the exterior far-field boundary law $\tilde{\mathbf{D}}^{(j)} \cdot \mathbf{n} = \alpha V_h^{(j)}$ gives a lower bound on electrostatic energy. Rather than assembling a second saddle-point problem across the whole mesh, &lt;code&gt;equilibrate_electro_flux_bounds&lt;/code&gt; visits each vertex patch one by one and solves a tiny local problem following the Braess–Schöberl construction.&lt;/p&gt;
&lt;p&gt;Zero-thickness metallic sheets complicate that story slightly. Along a coplanar trace or ground plane, tangential potential derivatives stay continuous across the sheet only along its plane, while the normal displacement field $\mathbf{D} \cdot \mathbf{n}$ jumps sharply between top and bottom faces. Trying to enforce normal flux continuity across a metal conductor would destroy the bound. Whenever a mesh vertex lands on an interior conductive sheet, the equilibration code splits its neighbourhood into separate half-stars and solves each side independently. Normal flux jumps remain exact while the bulk divergence stays cleanly near machine zero.&lt;/p&gt;
&lt;aside class=&quot;callout callout--note&quot;&gt;
  &lt;div class=&quot;callout-title&quot;&gt;
    &lt;span aria-hidden=&quot;true&quot;&gt;§&lt;/span&gt;
    &lt;span&gt;Local Raviart–Thomas Spaces&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class=&quot;callout-body&quot;&gt;
    &lt;p&gt;In two dimensions, RT0 uses 3 edge DOFs per triangle and RT1 expands to 8 DOFs (6 edge fluxes plus 2 interior bubbles). In three dimensions, tetrahedral patches jump to 4 DOFs for RT0 and 15 DOFs for RT1, mapped from the reference element via the contravariant Piola transform $\frac{1}{|\det J|} J \hat{\phi}$.&lt;/p&gt;
  &lt;/div&gt;
&lt;/aside&gt;
&lt;h2 id=&quot;turning-two-energies-into-an-entrywise-bracket&quot;&gt;Turning Two Energies Into an Entrywise Bracket&lt;/h2&gt;
&lt;p&gt;Once each terminal $j$ has both a primal potential $V_h^{(j)}$ and an equilibrated flux $\tilde{\mathbf{D}}^{(j)}$, two small $M \times M$ conductor matrices carry all the global error information:&lt;/p&gt;
&lt;p&gt;$$
W^{\mathrm{flux}}_{ij} = \int_\Omega \tilde{\mathbf{D}}^{(i)} \cdot \varepsilon^{-1} \tilde{\mathbf{D}}^{(j)}, d\Omega + \int_{\Gamma_\infty} \alpha^{-1} \left(\tilde{\mathbf{D}}^{(i)} \cdot \mathbf{n}\right)\left(\tilde{\mathbf{D}}^{(j)} \cdot \mathbf{n}\right) dS
$$&lt;/p&gt;
&lt;p&gt;$$
Q_{ij} = -\int_\Omega \nabla V_h^{(i)} \cdot \tilde{\mathbf{D}}^{(j)}, d\Omega + \int_{\Gamma_\infty} V_h^{(i)} \left(\tilde{\mathbf{D}}^{(j)} \cdot \mathbf{n}\right) dS
$$&lt;/p&gt;
&lt;p&gt;From Cauchy–Schwarz on the pairing $Q$, $C^{\mathrm{low}} = Q (W^{\mathrm{flux}})^+ Q^T$ defines the rigorous lower matrix bound. Reporting the midpoint $C^{\mathrm{mid}} = \frac{1}{2}(C^{\mathrm{up}} + C^{\mathrm{low}})$ yields an explicit worst-case bound on every matrix entry:&lt;/p&gt;
&lt;p&gt;$$
\left| C^{\mathrm{mid}}_{ij} - C^{\mathrm{exact}}_{ij} \right| \le \frac{1}{2}\sqrt{\left(C^{\mathrm{up}}_{ii} - C^{\mathrm{low}}_{ii}\right)\left(C^{\mathrm{up}}_{jj} - C^{\mathrm{low}}_{jj}\right)}
$$&lt;/p&gt;
&lt;p&gt;Just as importantly, the triangle-by-triangle Prager–Synge mismatch $\left| \varepsilon^{-1/2}(\tilde{\mathbf{D}} - \mathbf{D}_h) \right|_{L^2(T)}^2$ tells adaptive mesh refinement exactly where energy accuracy is being lost—almost always at sharp trace corners and tight coupler gaps.&lt;span class=&quot;sn-wrap sn-wrap--labeled&quot;&gt;&lt;input type=&quot;checkbox&quot; id=&quot;sn-sn-epistemic&quot; class=&quot;sn-toggle&quot; aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot;&gt;&lt;label for=&quot;sn-sn-epistemic&quot; class=&quot;sn-number&quot; role=&quot;button&quot; tabindex=&quot;0&quot; aria-controls=&quot;sn-note-sn-epistemic&quot; aria-expanded=&quot;false&quot; aria-label=&quot;Toggle sidenote 2&quot; title=&quot;Toggle sidenote&quot;&gt;2&lt;/label&gt;&lt;span id=&quot;sn-note-sn-epistemic&quot; class=&quot;sidenote&quot; role=&quot;note&quot;&gt;&lt;span class=&quot;sn-note-num&quot;&gt;2.&lt;/span&gt;Because this interval measures numerical discretisation spread rather than random laboratory noise, validation checks keep its half-width separate from aleatoric uncertainties like thickness variation.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 id=&quot;why-quarter-point-singular-cells-live-in-a-separate-lane&quot;&gt;Why Quarter-Point Singular Cells Live in a Separate Lane&lt;/h2&gt;
&lt;p&gt;At the knife-edge of a zero-thickness trace, the real electric field blows up like $r^{-1/2}$. One classic way to capture that singularity on a coarse mesh is Barsoum quarter-point grading: sliding quadratic mid-edge nodes towards the conductor rim so the element Jacobian itself embeds the $r^{-1/2}$ decay without flooding the mesh with tiny triangles.&lt;/p&gt;
&lt;p&gt;The catch is subtle: at that collapsed corner, $\det J$ goes to zero. Evaluating the contravariant Piola transform divides by $|\det J|$, which blows up on the very elements introduced to capture the corner field. Rather than letting both features silently corrupt each other, the engine isolates them cleanly—quarter-point meshes stay out of dual equilibration and integrate safely through interior collapsed quadrature instead.&lt;/p&gt;
&lt;h2 id=&quot;what-happened-against-ansys-q3d&quot;&gt;What Happened Against Ansys Q3D&lt;/h2&gt;
&lt;p&gt;Tested across the SQuADDS cQED benchmark suite, both approaches pulled their weight in complementary regimes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Goal-oriented &lt;code&gt;amr_ps&lt;/code&gt; with &lt;code&gt;flux_bounds&lt;/code&gt; bracketed 68 of 69 Ansys Q3D capacitance matrix entries (100% across interdigital capacitors &lt;code&gt;NCap&lt;/code&gt;, &lt;code&gt;CapNInterdigitalTee&lt;/code&gt;, and &lt;code&gt;GenIDC&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Quarter-point P2 meshes with spherical-harmonic far-field boundaries matched Q3D to 1.11% unweighted median self-capacitance error (1.04% Horvitz–Thompson weighted, 1.369 fF MAE) across all 60 &lt;code&gt;S1.1–S1.3&lt;/code&gt; devices, with bitwise-identical (&lt;code&gt;0.000e+00&lt;/code&gt;) results between 1 and 8 threads.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;solver-log&quot;&gt;
  &lt;div class=&quot;solver-log-head&quot;&gt;
    &lt;span class=&quot;solver-log-title&quot;&gt;SOLVER STDOUT&lt;/span&gt;
    &lt;button type=&quot;button&quot;
            class=&quot;btn-copy&quot;
            data-copy-btn
            data-copy-text=&quot;cargo test --release -p nyx-engine --test validation_cqed_cross_code&quot;&gt;Copy&lt;/button&gt;
  &lt;/div&gt;
  &lt;div class=&quot;solver-log-cmd&quot;&gt;
    &lt;code&gt;$ cargo test --release -p nyx-engine --test validation_cqed_cross_code&lt;/code&gt;
  &lt;/div&gt;
  &lt;pre class=&quot;solver-log-pre&quot;&gt;&lt;code&gt;coax_cylinder_electrostatic (a=10 um, b=30 um, L=100 um, eps_r=11.7):
  exact C_coax = 5.924750e-14 F
  Prager-Synge [C_low, C_up] brackets exact value with deterministic delta_ep
  dfs::electro NYX_THREADS=1 vs NYX_THREADS=8 max rel drift: 0.000e+00 (bitwise exact)&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The main boundary we ran into was narrow-gap volumetric locking on dense &lt;code&gt;200–300 nm&lt;/code&gt; GDS fillet chords inside &lt;code&gt;2–3 µm&lt;/code&gt; gaps (&lt;code&gt;S1.4&lt;/code&gt; &lt;code&gt;GenIDC&lt;/code&gt;): standard Ruppert refinement hits its Steiner ceiling near short arc chords, inflating volumetric FEM error. Switching layered chips onto the 3-layer Green-function solver &lt;code&gt;planar_bem&lt;/code&gt; removes the airbox mesh altogether and solves &lt;code&gt;S1.4&lt;/code&gt; 76× faster (1.03 s median) at 4.04% self-capacitance median error.&lt;/p&gt;
</content>
        
    </entry>
</feed>
