Research software engineering (RSE) methodology for quantum and scientific computing codes. Covers continuous integration, automated testing, compiler warning correction, continuous benchmarking, and detection of critical defects in scientific software. Applicable to Fortran, C/C++, and any high-performance scientific computing project.
Scanned 9/11/2026
Install to Claude Code
npx -y skills add hiyenwong/ai_collection --skill quantum-software-engineering --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Quantum Software Engineering?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hiyenwong-quantum-software-engineering)More formats (shields.io, HTML) on the badges page.
---
name: quantum-software-engineering
description: "Research software engineering (RSE) methodology for quantum and scientific computing codes. Covers continuous integration, automated testing, compiler warning correction, continuous benchmarking, and detection of critical defects in scientific software. Applicable to Fortran, C/C++, and any high-performance scientific computing project."
---
# Quantum Software Engineering
## Description
Research software engineering (RSE) methodology for quantum and scientific computing codes. Covers practical approaches to code quality assurance including continuous integration, automated testing, compiler warning correction, and performance engineering through continuous benchmarking. Reveals critical defect patterns in scientific software including uninitialized memory reads, out-of-bounds writes, and misunderstood mathematical models in boundary condition handling. Applicable to Fortran, C/C++, and any high-performance scientific computing project.
## Activation Keywords
- research software engineering
- RSE scientific code
- quantum code quality
- scientific software testing
- continuous benchmarking
- scientific code defects
- Fortran CI testing
- 科研软件工程
- 科学代码质量保证
- HPC code quality
## Core Methodology
### Step 1: Continuous Integration for Scientific Code
Establish automated CI pipeline:
- **Build automation**: Automated compilation on every commit
- **Compiler warnings**: Enable all warnings (-Wall -Wextra for GCC/Clang, -warn all for Intel Fortran)
- **Multi-platform testing**: Test across different compilers, architectures, HPC systems
- **Version control integration**: Automated PR checks before merge
### Step 2: Automated Testing Strategy
Implement testing layers for scientific code:
- **Unit tests**: Individual function/method correctness
- **Integration tests**: Component interaction validation
- **Regression tests**: Known physics results as reference
- **Convergence tests**: Numerical accuracy verification
### Step 3: Continuous Benchmarking
Monitor performance over time:
- **Baseline establishment**: Record performance metrics on stable versions
- **Automated benchmarking**: Run performance tests on every commit
- **Regression detection**: Alert on performance degradation
- **System dependency tracking**: Document how HPC configuration changes affect performance
### Step 4: Critical Defect Detection
Identify and prevent dangerous defect classes:
- **Uninitialized memory reads**: Especially prevalent in Fortran scientific codes
- **Out-of-bounds writes**: Array boundary violations
- **Misunderstood mathematical models**: Boundary condition handling errors
- **Processor-dependent behavior**: Code that behaves differently on different architectures
## Error Handling & Pitfalls
### Undefined Behavior in Scientific Code
- **Fortran undefined behavior**: Equivalent to C/C++ UB but often less documented
- **Compiler optimization surprises**: Aggressive optimization may mask or expose bugs
- **Platform-dependent results**: Same code produces different results on different systems
### Performance Regression Causes
- **HPC system changes**: Configuration, compiler updates, hardware changes
- **Code changes**: Algorithm modifications with unintended performance impact
- **Dependency updates**: Library version changes affecting performance
### Boundary Condition Modeling
- **Mathematical model mismatch**: Implementation differs from theoretical model
- **Physical vs numerical**: Physical boundary conditions may not map cleanly to numerical schemes
- **Verification gap**: Need physics-based tests, not just code coverage
## Usage Patterns
### Pattern 1: Scientific Code CI Setup
```yaml
# Example CI pipeline for scientific computing code
name: CI Pipeline
on: [push, pull_request]
jobs:
build-test:
runs-on: [self-hosted, hpc]
steps:
- uses: actions/checkout@v4
- name: Build with all warnings
run: cmake -DENABLE_WARNINGS=ON ..
- name: Run unit tests
run: ctest --output-on-failure
- name: Run physics regression tests
run: ./run_regression_tests.sh
- name: Performance benchmark
run: ./run_benchmark.sh
```
### Pattern 2: Continuous Benchmarking Dashboard
Track performance metrics over time:
1. Define key performance indicators (runtime, memory, accuracy)
2. Run benchmarks on every significant commit
3. Store results in time-series database
4. Generate trend reports and regression alerts
### Pattern 3: Defect Detection Pipeline
Systematic defect hunting:
1. Run static analysis tools (Valgrind, AddressSanitizer, ThreadSanitizer)
2. Analyze compiler warnings as errors, not suggestions
3. Compare results across compilers to detect undefined behavior
4. Document all defects and their root causes
## Examples
### Example: Detecting Boundary Condition Bug
```fortran
! BAD: Misunderstood mathematical model in boundary condition
! The physical model requires zero-flux, but implementation uses Dirichlet
! This caused incorrect results for 2 years before detection
! CORRECT: Zero-flux boundary condition (Neumann)
! df/dn = 0 at boundary
do i = 1, n
gradient(i) = (f(i+1) - f(i-1)) / (2*dx)
enddo
! Set boundary gradient to zero (zero-flux)
gradient(1) = 0.0
gradient(n) = 0.0
```
## Resources
- arXiv: 2605.21334 - "RSE of a Quantum Transport Code and its Effects"
- Related: continuous-integration, scientific-computing, hpc-benchmarking
## Notes
- Dangerous defects in Fortran scientific codes are as prevalent as in C/C++
- Continuous benchmarking revealed performance regressions from HPC system changes
- Most RSE recommendations apply regardless of implementation language
- Practices can be adopted selectively for both new and existing projects
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!