How barbarousmagic/dsp works
Purpose and Build Surface
This is a C++ framework for quantum-hardware-adjacent DSP and quantum-state simulation: noisy cryogenic readout filtering, high-throughput noise processing, tensor-based gate simulation, and simulated quantum random-bit generation. CMake is the build entry point in CMakeLists.txt; executable-oriented source entry points are under src/, notably src/main.cpp, src/csd_2d_filter.cpp, and src/qrng.cpp.
1. Tensor and Quantum-State Core
include/Tensor.h defines the custom tensor/matrix abstraction used for memory-conscious numerical work. The architecture centers on cache-friendly matrix multiplication and Kronecker-product composition for multi-qubit state spaces. include/QuantumCircuit.h layers quantum-circuit concepts over this numerical substrate, supporting gate application and entanglement workflows.
Relevant paths:
• include/Tensor.h
• include/QuantumCircuit.h
• src/tensor_test.cpp
2. Quantum Gate / Entanglement Flow
The quantum simulation path constructs qubit state vectors, composes gates such as Hadamard and CNOT through tensor/Kronecker operations, and applies them to produce Bell-state-style entanglement. The key boundary is between generic numerical storage and quantum semantics: tensor operations belong in include/Tensor.h, while circuit/gate orchestration belongs in include/QuantumCircuit.h.
Relevant paths:
• include/QuantumCircuit.h
• include/Tensor.h
• src/unit_tests.cpp
3. 2D Charge Stability Diagram Filtering
The CSD pipeline models noisy two-dimensional charge-transition measurements, then applies a custom moving-average-style 2D convolution to smooth Gaussian white noise. Its output is intended as cleaner readout data for downstream automated tuning or transition-boundary extraction, rather than a UI-facing visualization product.
Relevant paths:
• src/csd_2d_filter.cpp
• src/main.cpp
4. High-Throughput 1D DSP Workload
A separate DSP-oriented execution path generates large Gaussian-noise streams and filters them to exercise serial and OpenMP-parallel processing limits. The main architectural concern is contiguous memory behavior, loop ordering, reserved vector capacity, and parallel processing of large arrays rather than generalized signal-processing extensibility.
Relevant paths:
• src/main.cpp
• CMakeLists.txt
5. QRNG Simulation
The QRNG module implements a classical simulation of quantum measurement: initialize a qubit in |0⟩, apply a Hadamard transform, then sample collapse using Born-rule probabilities and a uniform random distribution. This is logically independent of the noisy-readout DSP pipeline, though it may reuse the quantum-state abstractions.
Relevant paths:
• src/qrng.cpp
• include/QuantumCircuit.h
• include/Tensor.h
6. Runtime and Infrastructure Boundaries
The project is native C++ built with CMake and uses OpenMP for CPU parallelism where enabled. It has no indicated network service, database, cloud runtime, or web layer. External dependencies appear limited to the C++ standard library and OpenMP; numerical kernels and quantum abstractions are implemented in-repository. Validation is represented by focused tensor and unit-test sources rather than a separate test framework directory.
Relevant paths:
• CMakeLists.txt
• src/unit_tests.cpp
• src/tensor_test.cpp
Main entry points: CMakeLists.txt CMake build · Tensor.h Tensor abstraction · QuantumCircuit.h Quantum circuit · qrng.cpp QRNG simulation
Components 12
Numerical & Quantum Core
- Tensor abstraction · Memory-conscious matrix and tensor storage with multiplication and Kronecker composition.
include/Tensor.h - Quantum circuit · Provides gate application and multi-qubit circuit semantics.
include/QuantumCircuit.h - Gate & entanglement flow · Composes Hadamard and CNOT operations into Bell-style states.
Native Workloads
- 1D noise filtering · Generates and filters large Gaussian-noise arrays with contiguous-memory focus.
src/main.cpp - 2D CSD filtering · Smooths noisy charge-stability measurements with custom 2D convolution.
src/csd_2d_filter.cpp - Cleaned readout data · Input for automated tuning or transition-boundary extraction.
- QRNG simulation · Applies a Hadamard then samples measurement collapse using Born probabilities.
src/qrng.cpp
Validation
- Tensor checks
src/tensor_test.cpp - Quantum unit checks
src/unit_tests.cpp
Other components
- CMake build · Build entry point for native executables and OpenMP support.
CMakeLists.txt - OpenMP runtime · CPU parallelism for enabled high-throughput processing.
- C++ standard library · Provides containers, random distributions, and native utilities.
Connections 15
- CMake build → 1D noise filtering: builds
- CMake build → 2D CSD filtering: builds
- CMake build → QRNG simulation: builds
- CMake build → OpenMP runtime: enables
- Tensor abstraction → Quantum circuit: numerical substrate
- Tensor abstraction → Gate & entanglement flow: matrix and Kronecker ops
- Quantum circuit → Gate & entanglement flow: orchestrates gates
- Tensor abstraction → QRNG simulation: state representation
- Quantum circuit → QRNG simulation: Hadamard semantics
- C++ standard library → QRNG simulation: uniform sampling
- OpenMP runtime → 1D noise filtering: parallel filtering
- 2D CSD filtering → Cleaned readout data: smooths measurements
- Tensor checks → Tensor abstraction: validates
- Quantum unit checks → Quantum circuit: validates
- Quantum unit checks → Gate & entanglement flow: checks workflows