Skip to the content
6 layers119.9 × 127.5 mmNsf neuromod phased array, the printed circuit board in 3D

Nsf neuromod phased array

ryancinsight/kwavers7

K-wave inspired ultrasound physics in rust with acoustics and optics

Size
119.9 × 127.5 mm
Copper layers
6
Thickness
1.6 mm
Parts
54
Nets
69
Pads
314
Tracks, vias
2,151, 248
Routed
Yes
KiCad
KiCad 8 (file 20240108)
Created
24 Feb 2025
Updated
31 Oct 2026

Overview

Nsf neuromod phased array is an open-source printed circuit board by ryancinsight, from the ryancinsight/kwavers repository on GitHub, published under the MIT licence. It is a 6-layer board of 119.9 × 127.5 mm with 54 parts on 69 nets, routed with 2,151 tracks and 248 vias.

It is built around the XC7A200T-2FBG484I, MD1822K6-G and STPS2200U, with the TC8020K6-G and BLM18PG471SN1 among its other parts. Its parts include 16 diodes, 9 ICs, 8 capacitors, 8 resistors and 3 connectors. It belongs with the FPGA and CPLD boards of this library.

Main components

5

README

README.md

Kwavers 🌀

Version License Documentation Rust

An interdisciplinary ultrasound-light physics simulation library. Kwavers models acoustic wave propagation, cavitation dynamics, and sonoluminescence for multi-modal imaging research and physics studies.

Theranostic feedback loop

📋 Library Components

Physics Models

  • Acoustic Wave Propagation: Linear and nonlinear wave equations
  • Cavitation Dynamics: Bubble physics implementations
  • Multi-Physics Coupling: Basic acoustic-thermal interactions
  • Electromagnetic Models: Wave propagation in various media

Numerical Methods

  • FDTD Solver: Finite difference time domain implementation
  • PSTD Solver: Pseudospectral time domain method
  • PINN Support: Physics-informed neural networks (experimental)
  • Boundary Conditions: Various absorbing and reflecting boundaries

Application Areas

  • Research Simulations: Acoustic wave propagation studies
  • Imaging Algorithms: Basic beamforming and reconstruction
  • Material Modeling: Acoustic properties of different media
  • Signal Processing: Filtering and analysis utilities

📊 Current Development Status

Recently completed: the workspace crate split (ADR-011) — the ~460k-LOC kwavers monolith is decomposed into per-layer crates to cut incremental build times. There is no facade: consumers (including the Python bindings) depend on the layer crates directly (kwavers_core, kwavers_grid, kwavers_solver, …). The kwavers crate is now only a thin top-level app/integration crate — it hosts the binary and the cross-cutting tests/examples/benches, and re-exports nothing.

Workspace layout

CrateLayer / responsibility
kwavers-coreConstants, error types, arena allocation, time/logging utilities
kwavers-mathFFT, linear algebra, numerics, geometry, statistics, SIMD
kwavers-gridCartesian/cylindrical grids, coordinates, topology, operators, geometric domains
kwavers-fieldField component indices (SSOT), field-type mapping, operations, statistics
kwavers-signalWaveforms, pulses, sweeps, modulation, windowing, filters
kwavers-mediumHomogeneous/heterogeneous media, acoustic/elastic/optical/thermal properties
kwavers-phantomClinical tissue-phantom builders and Shepp-Logan references
kwavers-meshTetrahedral FEM meshes, quality metrics, gaia bridge
kwavers-boundaryCPML/PML absorbing layers, FEM/BEM boundaries, coupling, periodic
kwavers-sourceSource trait, grid/mask sources, wavefronts, apodization
kwavers-receiverSensor-array geometry (SSOT), recorders, point sensors, grid sampling
kwavers-transducerBowls, phased/linear/matrix/hemispherical arrays, beamforming, PAM, ultrafast
kwavers-imagingDICOM/CT/NIfTI loaders, ultrasound/photoacoustic models, CEUS, fusion
kwavers-physicsNonlinear acoustics, bubble dynamics, thermal, optics, chemistry, elastic waves
kwavers-solverFDTD / PSTD / k-space / Helmholtz, BEM, FWI / RTM / CBS, PINN
kwavers-gpuHephaestus-backed provider-generic GPU backend; concrete ComputeBackend impls
kwavers-simulationBuilders, runners, multi-physics coupling, modality pipelines, backends
kwavers-analysisSignal processing, conservation, validation, ML/uncertainty, plotting
kwavers-diagnosticsReconstruction, multi-modal fusion, Doppler, spectroscopy, decision support
kwavers-therapyHIFU / histotripsy / lithotripsy planning, theranostic guidance, dose & safety
kwavers-driverPhysics-guided, manufacturing-aware driver-electronics (PCB) design
kwaversThin top-level app/integration crate: binary + cross-cutting tests/examples/benches (no re-exports)
kwavers-pythonPyO3 bindings (pykwavers); depends on the layer crates directly; no domain logic

Tyche owns reproducible counter streams, Latin-hypercube and Sobol designs, online moments, correlation screening, and finite-sample conformal calibration. Kwavers owns physical-domain transforms, model execution, Leto array presentation, and domain-specific score definitions. Geometry maps Tyche designs directly into validated rectangles, disks, and balls through one single-allocation collector; Analysis and PINN fixed-design code carry no independent provider algorithms, while model-residual adaptive refinement remains solver-owned. See ADR 043.

Layer crates are at 3.0.0; the completed split targets 4.0.0 (see RELEASE_v4.0.0 notes in CHANGELOG). kwavers-python is 0.1.0.

Validation status: the k-space pseudospectral solver matches the k-Wave reference solver on the homogeneous-water IVP benchmark at Pearson r = 1.000000000 (2-D) and r = 0.999999994 (3-D). The comparison is a Rust test in the default gate against reference fields committed to this repository — see Reference Benchmark Coverage.

Python Releases

GitHub Releases tagged kwavers-python-v<version> build one locked Python-3.8-compatible stable-ABI wheel per operating system for Linux, Windows, and macOS. The workflow installs and imports each wheel as pykwavers, verifies the kwavers-python distribution identity and Cargo-owned version, attests and attaches the exact artifacts, then publishes that same wheel set to PyPI through OIDC Trusted Publishing.

Rust Crate Releases

The 23 reusable Rust packages publish to crates.io in local dependency order. The Crates.io Release workflow validates a named workspace package on manual dispatch. After its required first release is bootstrapped and its crates.io Trusted Publisher is registered, a GitHub Release tagged crate-<package>-v<version> packages, verifies, and publishes the matching Cargo version with a short-lived OIDC token. Validation runs in a separate read-only job. The publish job is bound to the GitHub crates-io environment. The PyO3 and xtask packages are explicitly non-publishable; all Rust library releases use their package names.

Detailed history lives in CHANGELOG.md; current work and gaps are tracked in backlog.md, CHECKLIST.md, and gap_audit.md.

Architecture Overview

Kwavers follows a layered architecture designed for scientific computing:

text
Therapy / Diagnostics → Clinical planning, theranostic guidance, dose & safety
Simulation Layer      → Multi-physics orchestration, modality pipelines
Analysis Layer        → Signal processing, beamforming, imaging algorithms
Solver Layer          → Numerical methods (FDTD, PSTD, k-space, FWI, PINN)
Physics Layer         → Wave equations, bubble dynamics, constitutive relations
Domain Layer          → Problem geometry, materials, sources, sensors
Math Layer            → Linear algebra, FFT, numerical primitives
Core Layer            → Fundamental types, error handling

The module DAG is acyclic and linear (core → math → domain → physics → solver → analysis → simulation → diagnostics/therapy); each layer is now its own crate.

Cross-repository foundations remain below that DAG. Public Asclepius owns CEM43, Arrhenius thermal damage, and independent-insult composition. Kwavers converts stored temperatures to Aequitas quantities at its boundaries and retains spatial fields, tissue presets, clinical thresholds, and an independent validation oracle. See ADR 044.

Public Hyperion owns photon and optical interaction coefficients, reduced scattering, optical depth, Beer-Lambert transmission, and the diffusion-derived coefficient laws. kwavers-medium retains tissue identity, refractive index, presets, and maps; kwavers-physics and kwavers-solver retain spatial transport algorithms and photoacoustic coupling. This boundary removes the former kwavers-optics formula module plus the parallel DiffusionOpticalProperties and OpticalAbsorption models instead of adding a facade around them. See ADR 046.

Key architectural decisions:

  • Layer Separation: Unidirectional dependencies prevent circular imports
  • Domain Purity: Core entities remain free of application logic
  • Trait-Based Design: Physics specifications defined as traits for testability
  • Feature Flags: Optional components (GPU, PINN, API) can be enabled as needed

🚀 Quick Start

Installation

Add the layer crates you need to your Cargo.toml:

toml
[dependencies]
kwavers-grid = "3.0.0"
kwavers-medium = "4.0.0"

For GPU acceleration and advanced features, add the top-level integration crate:

toml
[dependencies]
kwavers = { version = "3.0.0", features = ["gpu", "pinn"] }

Example 1: Basic Grid Setup

rust
use kwavers_grid::Grid;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create a 3D computational grid
    let grid = Grid::new(100, 100, 100, 0.001, 0.001, 0.001)?;
    println!("Created grid: {}×{}×{} points", grid.nx, grid.ny, grid.nz);
    println!("Grid spacing: {} m", grid.dx);
    Ok(())
}

Example 2: Material Properties

rust
use kwavers_grid::Grid;
use kwavers_medium::HomogeneousMedium;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create a computational grid
    let grid = Grid::new(100, 100, 100, 0.001, 0.001, 0.001)?;

    // Define acoustic properties for water
    let density = 1000.0;      // kg/m³
    let sound_speed = 1500.0;  // m/s
    let mu_a = 0.0;            // optical absorption coefficient (1/m)
    let mu_s_prime = 0.0;      // reduced optical scattering coefficient (1/m)

    // Create a homogeneous water medium
    let medium = HomogeneousMedium::new(
        density,
        sound_speed,
        mu_a,
        mu_s_prime,
        &grid,
    );

    println!("Water properties:");
    println!("  Density: {} kg/m³", density);

Example 3: Basic Acoustic Calculations

rust
// Basic acoustic property calculations
fn main() {
    // Acoustic impedance calculation: Z = ρc
    let density_water = 1000.0;     // kg/m³
    let speed_water = 1500.0;       // m/s
    let impedance_water = density_water * speed_water; // Pa·s/m

    println!("Water acoustic impedance: {:.0} Pa·s/m", impedance_water);

    // Reflection coefficient: R = (Z2 - Z1)/(Z2 + Z1)
    let density_air = 1.2;          // kg/m³
    let speed_air = 343.0;          // m/s
    let impedance_air = density_air * speed_air;

    let reflection_coeff = (impedance_air - impedance_water) /
                          (impedance_air + impedance_water);

    println!("Air-water reflection coefficient: {:.4}", reflection_coeff);
}

📚 Documentation

📖 Documentation

🎯 Basic Usage

See the examples/ directory for basic usage patterns:

bash
# List available examples
cargo run --example

# Run a basic example (if available)
cargo run --example basic_simulation

Basic Test: Check compilation

bash
cargo check

🏗️ Architecture

Kwavers is structured with layered separation intended to support scientific computing workflows:

text
Clinical Applications    → Research use cases, safety monitoring
Analysis & Imaging       → Signal processing, reconstruction algorithms
Simulation Orchestration → Multi-physics coupling, time integration
Numerical Solvers        → FDTD, PSTD, PINN, spectral methods
Physics Specifications   → Wave equations, constitutive relations
Problem Domain           → Geometry, materials, boundary conditions
Mathematical Primitives  → Linear algebra, FFT, interpolation
Core Infrastructure      → Error handling, memory management

The architecture aims to separate concerns while maintaining flexibility for different research applications. Layer boundaries help organize code but are not strictly enforced in all areas during active development.

🤝 Contributing

This is an active research project under development. Contributions are welcome! The codebase follows strict quality standards and clean architecture principles.

📝 Development Philosophy

  • Clean Codebase: No dead code, deprecated code, or build artifacts
  • Deep Vertical Hierarchy: Modules organized by domain with clear separation of concerns
  • Single Source of Truth: Shared accessors, no duplication
  • Zero Technical Debt: All TODOs resolved with full implementation or removed
  • Architectural Purity: Unidirectional dependencies, no circular imports

🚀 Getting Started

  1. Check Status: Review CHECKLIST.md for current task status

  2. Review Plans: See backlog.md for planned work and gap_audit.md for known gaps

  3. Build a crate: cargo check -p kwavers-core (per-crate checks are fast post-split)

  4. Run Tests: cargo nextest run -p <crate>; use cargo test-gpu-consumers when changing the shared GPU simulation/Python dependency graph, so Cargo compiles their common graph once; use cargo test -p <crate> --doc for doctests

  5. Read Docs: docs/book/ for narratives, docs/ADR/ for design decisions

  6. Install the hooks: git config core.hooksPath .githooks

    Git never applies tracked hooks on its own, so this is a one-time step per clone. The pre-push hook runs scripts/lockfile.py --check, which is the same check CI runs. It matters most when working inside the Atlas stack: the stack's [patch] overlay makes cargo resolve first-party dependencies to local paths and write a Cargo.lock with every source = "git+..." line stripped. That lock resolves fine under the overlay and fails every --locked job in CI, so without the hook the corruption is invisible until a runner reports it. Repair with python3 scripts/lockfile.py --regenerate.

📊 Development Approach

Artifact-driven sprints (see CLAUDE.md governance):

  • backlog.md — strategy and prioritized work
  • CHECKLIST.md — tactical tasks with change-class tags
  • gap_audit.md — physics/numerics gap findings
  • CHANGELOG.md — version history

Quality Standards:

  • Zero compilation errors (enforced)
  • Minimal compiler warnings (dead code not allowed)
  • 100% test pass rate for all refactoring
  • API compatibility maintained across refactors
  • Mathematical specifications with literature references

🔬 Research Integration

Kwavers is being enhanced with methods from leading ultrasound simulation projects:

  • k-Wave (MATLAB): k-space pseudospectral methods, advanced source modeling
  • jwave (JAX/Python): Differentiable simulations, GPU parallelization
  • k-wave-python: Python binding patterns, HDF5 standards
  • KWave.jl (Julia): MATLAB-free k-Wave implementation for 1-D/2-D/3-D reference benchmarking
  • optimus: Optimization frameworks, inverse problems
  • fullwave25: Full-wave simulation, clinical workflows
  • dbua: Neural beamforming, real-time inference
  • simsonic: Advanced tissue models, multi-modal integration

📊 History

Per-version history is consolidated in CHANGELOG.md. The historical per-sprint/per-phase reports formerly under docs/ were pruned during the workspace-split docs cleanup and remain recoverable from git history.

📄 License

Kwavers is licensed under the MIT License. See LICENSE for details.

📚 References

Key Physics Texts

  • Hamilton, M.F. & Blackstock, D.T. - Nonlinear Acoustics
  • Szabo, T.L. - Diagnostic Ultrasound Imaging
  • Duck, F.A. - Physical Properties of Tissues

Numerical Methods

  • Yee, K.S. (1966) - FDTD method
  • Liu, Q.H. (1997) - PSTD method
  • Hesthaven, J.S. (2007) - DG methods

Related Simulation Projects

  • k-Wave: MATLAB toolbox for acoustic wave simulation (GitHub)
  • jwave: JAX-based differentiable acoustic simulations (GitHub)
  • k-wave-python: Python interface to k-Wave (GitHub)
  • KWave.jl: Julia implementation of k-Wave for MATLAB-free acoustic simulation benchmarks (GitHub)
  • optimus: Optimization framework for ultrasound (GitHub)
  • fullwave25: Full-wave ultrasound simulator (GitHub)
  • dbua: Deep learning beamforming (GitHub)
  • simsonic: Advanced ultrasound simulation platform (Website)

Reference Benchmark Coverage

crates/kwavers/tests/kwave_reference_parity.rs compares the k-space pseudospectral solver against k-Wave on the homogeneous-water IVP Gaussian case. The reference fields live in crates/kwavers/tests/reference/kwave/ (156 KB), so the test runs from a clean clone in the default gate with no external solver present. scripts/generate_kwave_reference.py regenerates them by driving k-wave-python over the reference kspaceFirstOrder-OMP binary.

Both codes run the same grid, time step, step count, and Treeby-Cox k-space correction, and are compared over a centred window the wavefront has entered but neither code's boundary treatment has reached.

CaseGridStepsRelative L2Relative L-infPearson r
ivp_homogeneous_2d64 × 641005.50e-71.05e-61.000000000
ivp_homogeneous_3d32 × 32 × 32501.06e-42.20e-40.999999994
ivp_absorbing_2d64 × 641008.10e-34.99e-30.999999924
ivp_layered_2d80 × 641207.97e-31.54e-20.999963422
src_tone_burst_2d96 × 801512.58e-32.20e-30.999996674
src_nonlinear_2d96 × 801513.30e-32.80e-30.999994550

The finite-difference solver is measured against the same reference as a cross-scheme check, since the pseudospectral solver shares its k-space machinery and cannot be an independent oracle for it. It separates by 2.53e-2 relative L2 at r = 0.999647, which is its own fourth-order dispersion error and is gated as such rather than at the pseudospectral bound.

ivp_absorbing_2d is the lossless 2-D case with power-law absorption (40 dB/(MHz^1.5 cm), y = 1.5) and nothing else changed, so the pair isolates the absorption model; the test asserts both that kwavers matches the absorbing reference and that the absorbing field separates from the lossless one, since agreement alone would not prove the model ran.

ivp_layered_2d steps sound speed and density across a smoothed interface eight cells from the seed, so the recorded field carries a transmitted wave, a reflection, and a refracted front; it is measured against a uniform-medium run at the same discretization, which it separates from by 0.27. Its grid is deliberately non-square — a square case cannot distinguish a correct axis orientation from a transposed one, and two such conventions were live in the harness until this case exposed them.

src_tone_burst_2d drives a Gaussian-windowed 3 MHz burst from a single off-centre cell, starting from a zero field. It is the only case that reaches the source injection path, and it checks four conventions at once: the mask's cell lookup, the per-step signal indexing, k-Wave's source-term scaling, and the k-space source correction.

src_nonlinear_2d is that case with finite-amplitude propagation switched on (B/A = 20 at 5 MPa), sized to reach roughly seventy percent of the plane-wave shock distance — as far into the nonlinear regime as the smooth-wave assumption reaches, since neither code has shock capturing. It separates from a linear run by 4.58e-2, fourteen times its own residual.

k-wave-python ships no 1-D solver, so there is no 1-D row; the axisymmetric case is a separate geometry and is not yet covered. Elastic propagation and distributed (multi-cell) sources have no committed reference field yet and are not covered by this result. ADR 119 records the reference provenance, the tolerance derivation, and what the comparison does not establish.

Key Publications

  1. Treeby & Cox (2010) - "k-Wave: MATLAB toolbox for photoacoustic simulation" - J. Biomed. Opt. 15(2), 021314
  2. Treeby et al. (2012) - "Nonlinear ultrasound propagation in heterogeneous media" - J. Acoust. Soc. Am. 131(6), 4324-4336
  3. Wise et al. (2019) - "Arbitrary acoustic source distributions" - J. Acoust. Soc. Am. 146(1), 278-288
  4. Treeby et al. (2020) - "Axisymmetric k-space method" - J. Acoust. Soc. Am. 148(4), 2288-2300

📞 Contact & Support


A research library for acoustic and optical physics simulations.

Parts

54
QtyValueFootprintReferences
16STPS2200kicad-routing:STPS2200D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15, D16
8CL10B104KB8NNNCkicad-routing:CL10B104KB8NNNCC1, C2, C3, C4, C100, C101, C102, C103
8RC0805FR-0756RLkicad-routing:RC0805FR-0756RLR1, R2, R3, R4, R5, R6, R7, R8
4ADUM3480kicad-routing:ADUM3480U2, U3, U4, U5
4MD1822K6-Gkicad-routing:MD1822K6-GU10, U11, U12, U13
4—kicad-routing:MountingHoleMH, MH, MH, MH
3—kicad-routing:FIDUCIALFID, FID, FID
2TC8020K6-Gkicad-routing:TC8020K6-GQ1, Q2
1BLM18PG471SN1kicad-routing:BLM18PG471SN1FB1
1CON16_2X8_TU_TSW_SAIkicad-routing:CON16_2X8_TU_TSW_SAIJ1
1J_HV_INkicad-routing:J_HV_INJ2
1J_LV_INkicad-routing:J_LV_INJ3
1XC7A200T-2FBG484Ikicad-routing:XC7A200T-2FBG484IU1

More from ryancinsight/kwavers

4
  • 6 layers110 × 80 mmHv7355 tile, the printed circuit board in 3D

    Hv7355 tile

    ryancinsight/kwavers

    K-wave inspired ultrasound physics in rust with acoustics and optics

    51 parts7MIT
  • 4 layers110 × 80 mmFpga tile, the printed circuit board in 3D

    Fpga tile

    ryancinsight/kwavers

    K-wave inspired ultrasound physics in rust with acoustics and optics

    20 parts7MIT
  • 4 layers78 × 52 mmNsf driver unit cell, the printed circuit board in 3D

    Nsf driver unit cell

    ryancinsight/kwavers

    K-wave inspired ultrasound physics in rust with acoustics and optics

    14 parts7MIT
  • 2 layers39.9 × 24 mmReal footprint demo, the printed circuit board in 3D

    Real footprint demo

    ryancinsight/kwavers

    K-wave inspired ultrasound physics in rust with acoustics and optics

    9 parts7MIT

Similar boards

  • 2 layers70.5 × 40.1 mmKicad flyback, the printed circuit board in 3D

    Kicad flyback

    nguyenthanhluan171205-tech/flyback-converter-10w

    Design, simulation, PCB layout, and experimental validation of a 10W Flyback converter (80-220VAC to 12VDC, 90% efficiency).

    63 parts
  • 2 layers43 × 35 mmLYFT CTRL, the printed circuit board in 3D

    LYFT CTRL

    mgkoenig/lyft

    LYFT is a sophisticated remote control for your IKEA BEKANT desk.

    43 parts88GPL-3.0
  • 2 layersSmd aio, the printed circuit board in 3D

    Smd aio

    freeDSP/freeDSP-ALLinONE

    All-in-One Version with amp and ADAU1701

    434 parts17
  • 2 layers53 × 39 mmHeartbeat Logger, the printed circuit board in 3D

    Heartbeat Logger

    Utstumo/Heartbeat-Logger

    A small, portable device that will continuously log your ECG - the "waveform" of your heart - onto a memory card for analysis.

    78 parts4
  • 2 layers176 × 100 mmSmartDesk v1p0, the printed circuit board in 3D

    SmartDesk v1p0

    daverowntree/SmartDesk

    I open sourced a design I made a few years back for a non-paying client. Use it as you see fit!

    190 parts
  • 4 layers63.2 × 183.1 mmNeflow, the printed circuit board in 3D

    Neflow

    DrNotThatEvil/neflow

    Not Evils Reflow Oven (neflow

    63 parts
  • 4 layers50.2 × 72.4 mmRaceTracker, the printed circuit board in 3D

    RaceTracker

    jonaschramm/race-tracker

    Custom PCB data logger for motorcycle racing: GPS position + IMU motion data, logged to a microSD card, with an e-Paper status display. Built around an ESP32-S3 (WiFi/BT built in) so it can also stream/sync over WiFi.

    135 parts
  • 2 layers120 × 70 mmSMART THERMOSTAT, the printed circuit board in 3D

    SMART THERMOSTAT

    leo-recover/domotics

    A simple domotics system using Raspberry-Pi, several smart nodes, and radio modules

    64 partsMIT

Questions

How big is the Nsf neuromod phased array PCB?

It measures 119.9 × 127.5 mm and has 6 copper layers, 1.6 mm thick.

What parts does the Nsf neuromod phased array use?

54 parts, built around the XC7A200T-2FBG484I, MD1822K6-G, STPS2200U and TC8020K6-G. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Nsf neuromod phased array KiCad files?

From the ryancinsight/kwavers repository on GitHub, at the commit this page was made from: the board is output/boards/nsf_neuromod_phased_array/nsf_neuromod_phased_array.kicad_pcb and its schematic crates/kwavers-driver/docs/reference_design/fpga_tile.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Nsf neuromod phased array design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).