Search NASASearch

SEARCH · Search NASA

Results for “SUBROUTINE”

Search indexed NASA NTRS and DOE OSTI research on propulsion, heat transfer, battery materials and energy systems. Follow report and document links to the original sources.

Quote a phrase for an exact phrase match. Source license links do not imply unrestricted reuse.

At least 19 records

Two-Tower Quantum Matrix Chain Multiplication: Trading Qubits for Depth

Matrix chain multiplication -- computing $\mathcal{W} = M^{(0)}\cdots M^{(K-1)}$ where $M^{(k)} \in \mathbb{R}^{P_k \times P_{k+1}}$-- arises in scientific computing, machine learning, and graph analysis. Despite the importance of this problem, for chains of distinct matrices, the classical number of operations grows linearly with the chain length $K$ and polynomially in the matrix dimensions. We present \emph{Two-Tower Matrix Multiplication}, a quantum subroutine that encodes the product $\mathcal{W}$ of the $K$ matrices into a quantum state in circuit depth $\mathcal{O}(\max_{k} \mathrm{polylog} (P_k P_{k+1}))$, which is independent of~$K$ within the QRAM-based state-preparation model, whereas the qubit count is $\mathcal{O}\bigl(\sum_{k} \log P_k \bigr)$; the total gate count remains linear in $K$, so the gain is in the circuit depth. The construction interleaves state-preparation operators across two layers; within each layer, all operators act on disjoint registers and execute in parallel. This subroutine can be specialized for the chain-vector case, which computes the product of $K-1$ matrices applied to a vector. We prove the correctness of the subroutine for all $K$ and provide two implementations using the Qiskit and QCLAB frameworks. The subroutine is applicable to any downstream quantum algorithm that operates on a matrix encoded in the statevector, including norm estimation, graph-matrix powers, linear system solving, and quantum machine learning kernels.

Antonioli, Giacomo [Pisa U.] (ORCID:00090000668703

Graph decomposition techniques for solving combinatorial optimization problems with variational quantum algorithms

The quantum approximate optimization algorithm (QAOA) has the potential to approximately solve complex combinatorial optimization problems in polynomial time. However, current noisy quantum devices cannot solve large problems due to hardware constraints. In this work, we develop an algorithm that decomposes the QAOA input problem graph into a smaller problem and solves MaxCut using QAOA on the reduced graph. The algorithm requires a subroutine that can be classical or quantum—in this work, we implement the algorithm twice on each graph. One implementation uses the classical solver Gurobi in the subroutine and the other uses QAOA. We solve these reduced problems with QAOA. On average, the reduced problems require only approximately 1/10 of the number of vertices than the original MaxCut instances. Furthermore, the average approximation ratio of the original MaxCut problems is 0.75, while the approximation ratios of the decomposed graphs are on average of 0.96 for both Gurobi and QAOA. With this decomposition, we are able to measure optimal solutions for ten 100-vertex graphs by running single-layer QAOA circuits on the Quantinuum trapped-ion quantum computer H1-1, sampling each circuit only 500 times. This approach is best suited for sparse, particularly k-regular graphs, as k-regular graphs on n vertices can be decomposed into a graph with at most $\frac{nk}{k+1}$ vertices in polynomial time. Further reductions can be obtained with a potential trade-off in computational time. In conclusion, while this paper applies the decomposition method to the MaxCut problem, it can be applied to more general classes of combinatorial optimization problems.

97 MATHEMATICS AND COMPUTING

Optimization performance, fidelity, and cost: SIAM VQE

This dataset contains files storing results from classically-simulated quantum subroutines within a dynamical mean-field theory workflow, and jupyter notebooks processing the data in these files to generate plots. The files store: (1) Results from variational quantum eigensolver (VQE) simulations searching for optimal parameters allowing parametrized quantum circuits to prepare approximations to ground states of different Anderson impurity models (AIMs) (2) Results from simulations of a quantum Lanczos algorithm (QLA) estimating the Lanczos coefficients defining the continued-fraction representation of an (AIM) Green’s function Description: Any file named vqe_gs_results* stores approximations to the ground state and energy of a given AIM estimated using three different methods: (1) Numerical diagonalization (2) Ideal VQE simulation (3) VQE simulation with sampling noise For each VQE simulations metadata about the optimization (optimization results plus number of quantum circuits that would have been executed on real hardware) is also stored. Any file named qla_dos_results* estimations for the Lanczos coefficients defining the Green’s function of an AIM. The stored estimations are achieved using different methods: (1) Numerical Lanczos algorithm from initial states obtained from numerical diagonalization (2) Simulated quantum Lanczos algorithm from initial states prepared from parametrized quantum circuits yielded by corresponding ideal and noisy VQE subroutines. The dataset is used and described in M. Karabin et al., "Quantum solver for single-impurity Anderson models with particle-hole symmetry", Phys. Rev. Research 8, 033066 (2026). DOI: https://doi.org/10.1103/7ys3-tl4l

71 CLASSICAL AND QUANTUM MECHANICS, GENERAL PHYSIC

Feasibility of an Accelerometer-Based Structural Health Monitoring System for the LANL Blast Tube

A modeling- and simulation-based study was conducted on the feasibility of implementing an accelerometer-based SHM system on the Los Alamos National Laboratory blast tube. A blast tube experiment was modeled using the Abaqus explicit finite element solver. A custom user subroutine was written to apply test-like pressure loading to the inside surface of the blast tube. The subroutine applies analytically defined pressure loads derived from tracer output taken from a Compressible Flow Computational Fluid Dynamics Solver model of the blast tube. Five unique versions of the model were created: an undamaged reference model at 65°F was used as the baseline and compared to equivalent models at 10°F and 100°F. These three models were compared to models with small damage at the reference temperature. The two types of damage considered were a radial (circumferential) crack in the main tube body and a longitudinal crack in the supports. Acceleration outputs were extracted from accelerometer bodies included in the model and were post processed using a variety of standard SHM techniques. Different potential features signaling failure were extracted and compared using statistical methods in the time and frequency domains. A method was identified that clearly shows that differences in structural response resulting from the modeled damage can be differentiated from the structural response resulting from changing environmental conditions. However, the amount of damage applied to create observable differences in the accelerometer data was so large that simpler methods of damage detection would be more cost effective in locating damage.

42 ENGINEERING

Parallel Runtime Interface for Fortran (PRIF) Specification (Rev. 0.5)

This document specifies an interface to support the parallel features of Fortran, named the Parallel Runtime Interface for Fortran (PRIF). PRIF is a proposed solution in which the runtime library is primarily responsible for implementing coarray allocation, deallocation and accesses, image synchronization, atomic operations, events, teams and collective subroutines. In this interface, the compiler is responsible for transforming the invocation of Fortran-level parallel features into procedure calls to the necessary PRIF subroutines. The interface is designed for portability across shared- and distributed-memory machines, different operating systems, and multiple architectures. Implementations of this interface are intended as an augmentation for the compiler's own runtime library. With an implementation-agnostic interface, alternative parallel runtime libraries may be developed that support the same interface. One benefit of this approach is the ability to vary the communication substrate. A central aim of this document is to define a parallel runtime interface in standard Fortran syntax, which enables us to leverage Fortran to succinctly express various properties of the procedure interfaces, including argument attributes.

97 MATHEMATICS AND COMPUTING

Parallel Runtime Interface for Fortran (PRIF) Specification (Rev. 0.6)

This document specifies an interface to support the multi-image parallelism features of Fortran, named the Parallel Runtime Interface for Fortran (PRIF). PRIF is a solution in which a runtime library is primarily responsible for implementing coarray allocation, deallocation and accesses, image synchronization, atomic operations, events, teams and collective subroutines. The Fortran compiler is responsible for transforming the invocation of Fortran-level multi-image parallelism features into procedure calls to the necessary PRIF subroutines. The interface is designed for portability across shared- and distributed-memory machines, different operating systems, and multiple architectures. Implementations of this interface are intended as an augmentation for the compiler's own runtime library. With an implementation-agnostic interface, alternative parallel runtime libraries may be developed that support the same interface. One benefit of this approach is the ability to vary the communication substrate. A central aim of this document is to define a parallel runtime interface in standard Fortran syntax, which enables us to leverage Fortran to succinctly express various properties of the procedure interfaces, including argument attributes.

97 MATHEMATICS AND COMPUTING

Validating automated resonance evaluation with synthetic data

The integrity and precision of nuclear data are crucial for a broad spectrum of applications, from national security and nuclear reactor design to medical diagnostics, where the associated uncertainties can significantly impact outcomes. A substantial portion of uncertainty in nuclear data originates from the subjective biases in the evaluation process, a crucial phase in the nuclear data production pipeline. Recent advancements indicate that automation of certain routines can mitigate these biases, thereby standardizing the evaluation process and enhancing reproducibility. This research aims to provide a methodology, framework, and metrics for the validation of automated nuclear data evaluation software leveraging high-quality synthetic data that closely mimic real experimental observables. An introduced error metric provides a scale and intuitive measure of the evaluation quality by quantifying the estimate’s accuracy and performance across the specified energy range. Synthetic data provides access to experimental observables and underlying resonance parameters, enabling comparison of different evaluations. The methodology is demonstrated using Ta-181 isotope data in the resolved resonance region. The Automated Resonance Identification Subroutine (ARIS), which operates without prior resonance information, was used to test and showcase the framework’s capabilities utilizing the proposed error metrics. The results demonstrate the effectiveness of the proposed approach and framework for optimizing software parameters and testing hypotheses through “what-if” controlled experiments, such as modifying assumptions about experimental conditions or average resonance parameters.

22 GENERAL STUDIES OF NUCLEAR REACTORS

Exploring the impact of hydro-mechanical coupling on compaction localization

In deep subsurface environments, where porous rocks are saturated with fluids, hydromechanical coupling plays a critical role in the formation and propagation of localized deformation zones, such as compaction bands. In this study, we numerically investigate the influence of fluid-rock interactions on the development of compaction localization in fluid-saturated rocks. For this purpose, it uses a numerical framework that adapts the heat equation to model the diffusion of pore pressure caused by deformation. This is achieved with specialized subroutines for material behavior and heat transfer formulated within the ABAQUS platform and by allowing changes in rock permeability during strain localization. The results highlight that hydromechanical coupling significantly alters the compaction behavior compared to dry conditions. Under high confining stress, excess pore pressure inhibits the progression of compaction fronts, while in time-dependent processes like rock creep, pore pressure transients accelerate deformation by creating feedback loops between mechanical forces and fluid flow. These findings underscore the importance of saturation in controlling the dynamics of compaction localization and provide insights into the interplay between pore pressure, deformation, and permeability. The implications of this study extend to applications in geological storage, resource extraction, and subsurface geomechanics, offering a deeper understanding of coupled hydromechanical processes in porous rocks.

58 GEOSCIENCES

Hamiltonian simulation in Zeno subspaces

Here, we investigate the quantum Zeno effect as a framework for designing and analyzing quantum algorithms for Hamiltonian simulation. We show that frequent projective measurements of an ancilla qubit register can be used to simulate quantum dynamics on a target qubit register with a circuit complexity similar to randomized approaches. The classical sampling overhead in the latter approaches is traded for ancilla qubit overhead in Zeno-based approaches. A second-order Zeno sequence is developed to improve scaling and implementations through unitary kicks are discussed. We derive rigorous error bounds that allow for identifying the associated circuit complexities for the first- and second-order Zeno sequences. We show that the circuits over the combined register can be identified as a subroutine commonly used in post-Trotter Hamiltonian simulation methods. We build on this observation to reveal connections between different Hamiltonian simulation algorithms.

Hamiltonian simulation

Unification of finite symmetries in the simulation of many-body systems on quantum computers

Symmetry is fundamental in the description and simulation of quantum systems. Leveraging symmetries in classical simulations of many-body quantum systems can result in significant overhead due to the exponentially growing size of some symmetry groups as the number of particles increases. Quantum computers hold the promise of achieving exponential speedup in simulating quantum many-body systems; however, a general method for utilizing symmetries in quantum simulations has not yet been established. In this work, we present a unified framework for incorporating symmetry group transforms on quantum computers to simulate many-body systems. The core of our approach lies in the development of efficient quantum circuits for symmetry-adapted projection onto irreducible representations of a group or pairs of commuting groups. We provide resource estimations for common groups, including the cyclic and permutation groups. Our algorithms demonstrate the capability to prepare coherent superpositions of symmetry-adapted states and to perform quantum evolution across a wide range of models in condensed-matter physics and ab initio electronic structure in quantum chemistry. Specifically, we execute a symmetry-adapted quantum subroutine for small molecules in first-quantization on noisy hardware and demonstrate the emulation of symmetry-adapted quantum phase estimation for preparing coherent superpositions of quantum states in various irreducible representations of a symmetry group. In addition, we present a discussion of open problems regarding treating symmetries in digital quantum simulations of many-body systems, paving the way for future systematic investigations into leveraging symmetries quantumly for practical quantum advantage. The broad applicability and rigorous resource estimation for symmetry transformations make our framework appealing for achieving provable quantum advantage on fault-tolerant quantum computers, especially for symmetry-related properties.

quantum algorithms

Nonvariational ADAPT algorithm for quantum simulations

We explore a nonvariational quantum state preparation approach combined with the ADAPT operator selection strategy in the application of preparing the ground state of a desired target Hamiltonian. In this algorithm, energy gradient measurements determine both the operators and the gate parameters in the quantum circuit construction. We compare this nonvariational algorithm with ADAPT-VQE and with feedback-based quantum algorithms in terms of the rate of energy reduction, the circuit depth, and the measurement cost in molecular simulation. We find that, despite using deeper circuits, this new algorithm reaches chemical accuracy at a similar measurement cost to ADAPT-VQE. Since it does not rely on a classical optimization subroutine, it may provide robustness against circuit parameter errors due to imperfect control or gate synthesis.

Tang'S, Ho Lun [Virginia Polytechnic Inst. and Sta

Leveraging Qubit Loss Detection in Fault-Tolerant Quantum Algorithms

Qubit loss errors constitute a dominant source of noise in many quantum hardware systems, particularly in neutral-atom quantum computers. We develop a theoretical framework to effectively detect and correct loss errors in logical algorithms and leverage such loss information in decoding. Considering general quantum error correction codes and logical circuits, we introduce a delayed-erasure decoder for experimentally motivated error models which leverages information from delayed loss detection to accurately correct loss errors, even when the precise moment of the error is unknown. Using this decoder, we identify strategies for detecting and correcting loss errors based on the logical circuit structure. For deep circuits prior to logical measurement, we explore methods to integrate loss detection into syndrome extraction with minimal overhead, identifying optimal strategies depending on the qubit loss fraction in the noise and hardware capabilities. In contrast, we find that many key algorithmic subroutines involve frequent gate teleportation, shortening the circuit depth before logical measurement and naturally replacing qubits with no additional experimental overhead. We simulate this setting using a toy model algorithm for small-angle synthesis and find a significant performance improvement as the loss fraction increases. These results provide a path forward for advancing large-scale fault-tolerant quantum computation in systems with loss error detection.

atoms

Optimizing the Weather Research and Forecasting Model with OpenMP Offload and Codee

Currently, the Weather Research and Forecasting model (WRF) utilizes shared memory (OpenMP) and distributed memory (MPI) parallelisms. To take advantage of GPU resources on the Perlmutter supercomputer at NERSC, we port parts of the computationally expensive routine Fast Spectral Bin Microphysics (FSBM) to NVIDIA GPUs using OpenMP device offloading directives. To facilitate this process, we explore a workflow for optimization which uses both runtime profilers and a static code inspection tool Codee to refactor the subroutine. We observe an 2.24x overall speedup for the CONUS-12km storm test case.

Wichitrnithed, Chayanon (Namo) [Odin Institute]

Communication Lower Bounds and Optimal Algorithms for Symmetric Matrix Computations

In this article, we focus on the communication costs of three symmetric matrix computations: (i) multiplying a matrix with its transpose, known as a symmetric rank-k update (SYRK) (ii) adding the result of the multiplication of a matrix with the transpose of another matrix and the transpose of that result, known as a symmetric rank-2k update (SYR2K) (iii) performing matrix multiplication with a symmetric input matrix (SYMM). All three computations appear in the Level 3 Basic Linear Algebra Subroutines (BLAS) and have wide use in applications involving symmetric matrices. We establish communication lower bounds for these kernels using sequential and distributed-memory parallel computational models, and we show that our bounds are tight by presenting communication-optimal algorithms for each setting. Our lower bound proofs rely on applying a geometric inequality for symmetric computations and analytically solving constrained nonlinear optimization problems. As a result, the symmetric matrix and its corresponding computations are accessed and performed according to a triangular block partitioning scheme in the optimal algorithms.

Al Daas, Hussam [Rutherford Appleton Laboratory, D

sinbad-dt-source

MCNP6 source subroutine for simulating D-T neutrons in Ti-T Target

Armstrong, Jerawan [Los Alamos National Laboratory

Goated: goal-oriented tensor decompositions in python

SAND2026-20464O Goated performs goal-oriented tensor decompositions in Python, enabling efficient compression of multi-dimensional simulation data. It extends common tensor decomposition methods by incorporating domain-specific knowledge, such as conservation laws in physics, through a penalty term in the optimization process. This approach improves data compression and modeling accuracy across various applications, including physics simulations, by using specialized algorithms and structure-aware subroutines to accelerate solver performance. Sandia National Laboratories is a multimission laboratory managed and operated by National Technology & Engineering Solutions of Sandia, LLC, a wholly owned subsidiary of Honeywell International Inc., for the U.S. Department of Energy's National Nuclear Security Administration under contract DE-NA0003525.

SciDAC

CodeScribe Agent

SF-26-086 CodeScribe introduces a structured, multi-stage pipeline that combines deterministic program analysis with LLM-powered translation to enable incremental, testable Fortran-to-C++ migration. First, `code-scribe index` traverses the project directory tree and produces `scribe.yaml` metadata files recording all modules, subroutines, and functions at each level, giving the LLM accurate structural context instead of a hallucinated codebase model. Second, `code-scribe draft` performs the deterministic portion of translation — converting Fortran types to C++ equivalents, replacing `use` statements with `#include` and `using namespace` directives, and detecting constructs requiring special handling — while embedding`scribe-prompt` annotations that guide the LLM through non-trivial cases such as statement-function-to-lambda conversions and `extern "C"` wrapper generation. Third, `code-scribe translate` applies project-specific TOML-based few-shot prompt templates and submits the composed prompt to a pluggable LLM backend (OpenAI, Anthropic, Argonne ARGO, any OpenAI-compatible endpoint, or local Hugging Face checkpoints), producing a C++ source file, a header, and a Fortran-C++ interface file for each translated routine so the codebase compiles and runs correctly throughout the migration. Beyond translation, CodeScribe includes a tool-using coding agent (`code-scribe agent`) with read, bash, edit, and write capabilities, and a bounded loop mode (`code-scribe loop`) that runs repeated stateless agent sessions over a task file with restricted tool access — enabling sustained, auditable software development workflows for broader scientific computing tasks.

Dhruv, Akash [Argonne National Laboratory (ANL), A

Simulation Tools for Characterizing Stress Distribution in Laser Welded Dissimilar Joints

This project focuses on developing a thermo-metallurgical-mechanical modeling method to accurately predict the microstructural evolution and residual stress in laser welding between dissimilar metals, such as HSLA steel and high carbon equivalent (CE) gear steel. The method leverages a comprehensive material database to model the temperature and rate dependent phase transformations, along with their associated effects on material properties, such as thermal expansion and flow stress, throughout the welding process. A key innovation is the incorporation of phase transformation and phase-specific properties, which enhances the accuracy of residual stress predictions. The mixture material in the fusion zone due to the dissimilar metals will also be addressed in the numerical model. This is especially critical in scenarios involving phase transformations in the fusion zone and heat-affected zone (HAZ), where the phase changes can induce substantial residual stress variations. The material database has been generated using JMatPro. The modeling approach is implemented through a custom User Material (UMAT) subroutine, executed with the commercial finite element software Abaqus.

36 MATERIALS SCIENCE