Search NASA⌕ Search

SEARCH · Search NASA

Results for “Python implementation”

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 253 records · Page 14

Native Natural circulation in VERA

This work seeks to introduce a native natural circulation solver to VERA's thermohydraulics capabilities. This work begins with initial investigations into the viability of such a solver by determining the fundamental equations as well as necessary inputs. The method was then implemented in the form of a Python script coupled to CTF which was compared to TRACE. Once viability of the natural circulation solver was established, it was then implemented natively in MPACT for use with previously created simplified thermohydraulics solvers. This new implementation of the native natural circulation solver in MPACT is then tested for single physics problems for both a BWR and PWR single channel model and compared to TRACE where it shows an error of about 30% for BWRs and about 15% for PWRs. The solver is additionally tested for NuScale based models where it demonstrates an error to the reported flow rate of about 10%, resulting in an eigenvalue error of only 138 pcm when comparing fixed flow rate multiphysics runs. Finally, the solver is tested in multiphysics systems for a small PWR assembly, a small BWR assembly, and a full core approximate model of the NuScale design. In these multiphysics runs, it demonstrates no impact on multiphysics convergence stability, as well as negligible impact on runtimes. (authors)

21 SPECIFIC NUCLEAR REACTORS AND ASSOCIATED PLANTS↗

TEQUILA: a platform for rapid development of quantum algorithms

Variational quantum algorithms are currently the most promising class of algorithms for deployment on near-term quantum computers. In contrast to classical algorithms, there are almost no standardized methods in quantum algorithmic development yet, and the field continues to evolve rapidly. As in classical computing, heuristics play a crucial role in the development of new quantum algorithms, resulting in a high demand for flexible and reliable ways to implement, test, and share new ideas. In this paper, inspired by this demand, we introduce TEQUILA, a development package for quantum algorithms in PYTHON, designed for fast and flexible implementation, prototyping and deployment of novel quantum algorithms in electronic structure and other fields. TEQUILA operates with abstract expectation values which can be combined, transformed, differentiated, and optimized. On evaluation, the abstract data structures are compiled to run on state of the art quantum simulators or interfaces.

71 CLASSICAL AND QUANTUM MECHANICS, GENERAL PHYSIC↗

Umbrella sampling: a powerful method to sample tails of distributions

We present the umbrella sampling (US) technique and show that it can be used to sample extremely low-probability areas of the posterior distribution that may be required in statistical analyses of data. In this approach sampling of the target likelihood is split into sampling of multiple biased likelihoods confined within individual umbrella windows. We show that the US algorithm is efficient and highly parallel and that it can be easily used with other existing Markov Chain Monte Carlo (MCMC) samplers. The method allows the user to capitalize on their intuition and define umbrella windows and increase sampling accuracy along specific directions in the parameter space. Alternatively, one can define umbrella windows using an approach similar to parallel tempering. We provide a public code that implements US as a standalone PYTHON package. We present a number of tests illustrating the power of the US method in sampling low-probability areas of the posterior and show that this ability allows a considerably more robust sampling of multimodal distributions compared to standard sampling methods. We also present an application of the method in a real world example of deriving cosmological constraints using the supernova type Ia data. We show that US can sample the posterior accurately down to the approximate to 15 sigma credible region in the Omega(m) - Omega(Lambda) plane, while for the same computational effort the affine-invariant MCMC sampling implemented in the emcee code samples the posterior reliably only to approximate to 3 sigma.

cosmology: cosmological parameters↗

CrysFieldExplorer : rapid optimization of the crystal field Hamiltonian

A new approach to the fast optimization of crystal electric field (CEF) parameters to fit experimental data is presented. This approach is implemented in a lightweight Python-based program, CrysFieldExplorer. The main novelty of the method is the development of a unique loss function, referred to as the spectrum characteristic loss (L Spectrum ), which is based on the characteristic polynomial of the Hamiltonian matrix. Particle swarm optimization and a covariance matrix adaptation evolution strategy are used to find the minimum of the total loss function. It is demonstrated that CrysFieldExplorer can perform direct fitting of CEF parameters to any experimental data such as a neutron spectrum, susceptibility or magnetization measurements etc. CrysFieldExplorer can handle a large number of non-zero CEF parameters and reveal multiple local and global minimum solutions. Crystal field theory, the loss function, and the implementation and limitations of the program are discussed within the context of two examples.

42 ENGINEERING↗

CMLM (Co-Optimized Machine-Learned Manifolds) [SWR-23-41]

Co-optimized Machine-Learned Manifolds (CMLM) is a data-driven approach for developing reduced-order manifold models for high-dimensional chemically reacting systems. It involves a specially designed neural network, the training of which simultaneously optimizes linear combinations of species that define the manifold, nonlinear mapping to outputs of interest such as reaction rates, and (optionally) subfilter closure for large eddy simulation. This software package provides an implementation of the CMLM approach in Python using the PyTorch machine learning library. A few example cases are included, showing how the tool can be applied to different types of data from 0D and 1D reacting simulations performed using Cantera. The neural networks can be saved in a format that is readable by the Pele suite of combustion solvers for use in reacting computational fluid dynamics simulations. This software repository contains several python scripts to perform various tasks associated with the Co-optimized Machine Learned Manifolds (CMLM) model, which is described in Perry, Henry de Frahan, and Yellapantula, CNF, 2022 (https://doi.org/10.1016/j.combustflame.2022.112286). This includes not only the code that defines the CMLM model, but also scripts to generate suitable training data, scripts to pre-process the data, scripts to train the CMLM model, and scripts to plot the output, as well as various other helper files. The scripts depend on several commonly used python libraries for data analysis and chemical reaction computations. The trained models that result from this tool are designed to work with the an interface being implemented in the Pele suite of reacting flow solvers (https://github.com/AMReX-Combustion).

Perry, Bruce↗

brulilo, Version 0.x

brulilo is a Python package for building and evolving thermonuclear reaction networks, such as those used in astrophysical explosion calculations. It is very much a current work in progress, and much of the intended functionality is still under development. The main goal of brulilo is an easy-to-use code for quick calculations or post-processing, as well as a learning tool to test various implementations of solvers on both CPUs and GPUs. Currently, brulilo parses an input text file that specifies the reactions to be included in the network. The notation of the inputs are in the typical astrophysical notation; i.e. hydrogen burning to deuterium in the sun, "p + p + e --> d + neutrino", is given as "p(p,)d." Each reaction is added to a list comprising the reaction network, and once completed, the network contains a list of all isotopes and reactions involved. brulilo then parses publicly available nuclear data (binding energy, spin, partition function data, etc.) for each isotope from the WebNucleo group's data at nucleo.ces.clemson.edu. Fits to reaction rate data for each reaction are obtained from the publicly available data provided by the Joint Institute for Nuclear Astrophysics' Reaclib database. Reverse reactions are calculated from detailed balance. The reaction network then consists of a sparse system of mathematically stiff ordinary differential equations (ODEs). Physically, "stiffness" here means that there are some reaction rates that are occurring much faster than others; the ratio of the fast to slow often being greater than 10^15 in astrophysics. Numerical integration of such systems typically involves implicit integration schemes, which brulilo will leverage from the scientific computing Python package, Numpy, as well as implement its own. There has recently been work from researchers at Oak Ridge National Lab who have found good results from applying quasi-equilibrium and quasi-asymptotic conditions to the stiff system of ODEs, which effectively remove some of the stiffness and allow for efficient explicit integration techniques to be used. The original intent of brulilo was to implement these stiffness-alleviating techniques with explicit integrators and compare the performance to traditional implicit integrations of the full stiff system. This is still underway, as the code is very much in an alpha-release state. Furthermore, explicit integrators are often much easier to parallelize than their implicit counterparts. brulilo will implement parallelization of these techniques, leveraging both the Python implementation of MPI, mpi4py, as well as highly parallelized versions targeted at GPUs with PyOpenCL and/or PyCUDA.

Malone, Chris↗

brulilo, Version 0.x

brulilo is a Python package for building and evolving thermonuclear reaction networks, such as those used in astrophysical explosion calculations. It is very much a current work in progress, and much of the intended functionality is still under development. The main goal of brulilo is an easy-to-use code for quick calculations or post-processing, as well as a learning tool to test various implementations of solvers on both CPUs and GPUs. Currently, brulilo parses an input text file that specifies the reactions to be included in the network. The notation of the inputs are in the typical astrophysical notation; i.e. hydrogen burning to deuterium in the sun, "p + p + e --> d + neutrino", is given as "p(p,)d." Each reaction is added to a list comprising the reaction network, and once completed, the network contains a list of all isotopes and reactions involved. brulilo then parses publicly available nuclear data (binding energy, spin, partition function data, etc.) for each isotope from the WebNucleo group's data at nucleo.ces.clemson.edu. Fits to reaction rate data for each reaction are obtained from the publicly available data provided by the Joint Institute for Nuclear Astrophysics' Reaclib database. Reverse reactions are calculated from detailed balance. The reaction network then consists of a sparse system of mathematically stiff ordinary differential equations (ODEs). Physically, "stiffness" here means that there are some reaction rates that are occurring much faster than others; the ratio of the fast to slow often being greater than 10^15 in astrophysics. Numerical integration of such systems typically involves implicit integration schemes, which brulilo will leverage from the scientific computing Python package, Numpy, as well as implement its own. There has recently been work from researchers at Oak Ridge National Lab who have found good results from applying quasi-equilibrium and quasi-asymptotic conditions to the stiff system of ODEs, which effectively remove some of the stiffness and allow for efficient explicit integration techniques to be used. The original intent of brulilo was to implement these stiffness-alleviating techniques with explicit integrators and compare the performance to traditional implicit integrations of the full stiff system. This is still underway, as the code is very much in an alpha-release state. Furthermore, explicit integrators are often much easier to parallelize than their implicit counterparts. brulilo will implement parallelization of these techniques, leveraging both the Python implementation of MPI, mpi4py, as well as highly parallelized versions targeted at GPUs with PyOpenCL and/or PyCUDA.

Malone, Chris↗

FireWorks: a Dynamic Workflow System Designed for High-Throughput Applications

This work introduces FireWorks, a workflow software for running high-throughput calculation workflows at supercomputing centers. FireWorks has been used to complete over 50 million CPU-hours worth of computational chemistry and materials science calculations at the National Energy Research Supercomputing Center. It has been designed to serve the demanding high-throughput computing needs of these applications, with extensive support for (i) concurrent execution through job packing, (ii) failure detection and correction, (iii) provenance and reporting for long-running projects, (iv) automated duplicate detection, and (v) dynamic workflows (i.e., modifying the workflow graph during runtime). We have found that these features are highly relevant to enabling modern data-driven and high-throughput science applications, and we discuss our implementation strategy that rests on Python and NoSQL databases (MongoDB). Finally, we present performance data and limitations of our approach along with planned future work.

97 MATHEMATICS AND COMPUTING↗

Spectroscopic Probe Molecule Selection Using Quantum Theory, First-Principles Calculations, and Machine Learning

Probe molecule vibrational spectra have a long history of being used to characterize materials including metals, oxides, metal-organic frameworks, and even human proteins. Furthermore, recent advances in machine learning have enabled computationally generated spectra to aid in detailed characterization of complex surfaces with probe molecules. Despite widespread use of probe molecules, the science of probe molecule selection is underdeveloped. Here, we develop physical concepts, including orbital interaction energy and the energy overlap integral, to explain and predict the ability of probe molecules to discriminate structural descriptors. We resolve the crystal orbital overlap population (COOP) to specific molecular orbitals and quantify their bonding character, which directly influences vibrational frequencies. Using only a single adsorbate calculation from density function theory (DFT), we compute the interaction energy of individual adsorbate molecular orbitals with adsorption site atomic orbitals across many different sites. Combining the molecular orbital resolved COOP and changes in orbital interaction energy enables probe molecule selection for improved discrimination of various sites. We demonstrate these concepts by comparing the predicted effectiveness of carbon monoxide (CO), nitric oxide (NO), and ethylene (C 2 H 4 ) to probe Pt adsorption sites. Finally, using a previously developed machine learning framework, we show that models trained on hundreds of thousand C 2 H 4 spectra, computed from DFT, which regress surface binding-type and generalized coordination number (GCN), outperform those trained using CO and NO spectra. Lastly, a python package, pDOS_overlap, for implementing the electron density based analysis on any combination of adsorbates and materials, is also made available.

77 NANOSCIENCE AND NANOTECHNOLOGY↗

Using Convex Optimization to Efficiently Apportion Tracer and Pollutant Sources From Point Concentration Observations

Abstract Rivers transport elements, minerals, chemicals, and pollutants produced in their upstream basins. A sample from a river is a mixture of all of its upstream sources, making it challenging to pinpoint the contribution from each individual source. Here, we show how a nested sample design and convex optimization can be used to efficiently unmix downstream samples of a well‐mixed, conservative tracer in a steady state system into the contributions of their upstream sources. Our approach is significantly faster than previous methods. We represent the river's sub‐catchments, defined by sampling sites, using a directed acyclic graph. This graph is used to build a convex optimization problem which, thanks to its convexity, can be quickly solved to global optimality—in under a second on desktop hardware for data sets of ∼100 samples or fewer. Uncertainties in the upstream predictions can be generated using Monte Carlo resampling. We provide an open‐source implementation of this approach in Python. The inputs required are straightforward: a table containing sample locations and observed tracer concentrations, along with a D8 flow‐direction raster map. As a case study, we use this method to map the elemental geochemistry of sediment sources for rivers draining the Cairngorms mountains, UK. This method could be extended to non‐conservative and non‐steady state tracers. We also show, theoretically, how multiple tracers could be simultaneously inverted to recover upstream run‐off or erosion rates as well as source concentrations. Overall, this approach can provide valuable insights to researchers in various fields, including water quality, geochemical exploration, geochemistry, hydrology, and wastewater epidemiology.

Barnes, Richard↗

High-accuracy method for modeling nucleation and growth of particles

State-of-the-art numerical models describing the kinetics of aerosol particle nucleation and growth from a cooling vapor primarily use a nodal method, in which particles that are smaller than the critical size are omitted from consideration because they are thermodynamically unfavorable. This omission is based on the assumption that most newly formed particles are above the critical size, so that subcritical-size particles are not important to take into account. Due to the nature of the nodal method, it suffers from numerical diffusion, which can cause an artificial broadening of the cluster size distribution leading to a significant overestimation of the number of large-size particles. To address these issues, we propose a more accurate numerical method that explicitly models particles of all sizes, and uses a special numerical scheme that substantially reduces the numerical diffusion and provides high solution accuracy and numerical stability. We extensively compare this novel method to the commonly used nodal solver of the general dynamic equation (GDE) for particle growth and demonstrate that it offers GDE solutions with higher accuracy with low numerical diffusion. Incorporating small subcritical clusters into the solution is crucial for: 1) more precise determination of the entire particle size distribution function and 2) wider applicability of the model to experimental studies with non-monotonic temperature variations leading to particle evaporation. The computational code implementing this numerical method in Python is available upon request.

42 ENGINEERING↗

A NEW TOOL FOR IMAGE ANALYSIS BASED ON CHEBYSHEV RATIONAL FUNCTIONS: CHEF FUNCTIONS

We introduce a new approach to the modeling of the light distribution of galaxies, an orthonormal polar basis formed by a combination of Chebyshev rational functions and Fourier polynomials that we call CHEF functions, or CHEFs. We have developed an orthonormalization process to apply this basis to pixelized images, and implemented the method as a Python pipeline. The new basis displays remarkable flexibility, being able to accurately fit all kinds of galaxy shapes, including irregulars, spirals, ellipticals, highly compact, and highly elongated galaxies. It does this while using fewer components than similar methods, as shapelets, and without producing artifacts, due to the efficiency of the rational Chebyshev polynomials to fit quickly decaying functions like galaxy profiles. The method is linear and very stable, and therefore is capable of processing large numbers of galaxies in a fast and automated way. Due to the high quality of the fits in the central parts of the galaxies, and the efficiency of the CHEF basis modeling galaxy profiles up to very large distances, the method provides highly accurate estimates of total galaxy fluxes and ellipticities. Future papers will explore in more detail the application of the method to perform multiband photometry, morphological classification, and weak shear measurements.

79 ASTRONOMY AND ASTROPHYSICS↗

Snekmer: a scalable pipeline for protein sequence fingerprinting based on amino acid recoding

Abstract Motivation The vast expansion of sequence data generated from single organisms and microbiomes has precipitated the need for faster and more sensitive methods to assess evolutionary and functional relationships between proteins. Representing proteins as sets of short peptide sequences (kmers) has been used for rapid, accurate classification of proteins into functional categories; however, this approach employs an exact-match methodology and thus may be limited in terms of sensitivity and coverage. We have previously used similarity groupings, based on the chemical properties of amino acids, to form reduced character sets and recode proteins. This amino acid recoding (AAR) approach simplifies the construction of protein representations in the form of kmer vectors, which can link sequences with distant sequence similarity and provide accurate classification of problematic protein families. Results Here, we describe Snekmer, a software tool for recoding proteins into AAR kmer vectors and performing either (i) construction of supervised classification models trained on input protein families or (ii) clustering for de novo determination of protein families. We provide examples of the operation of the tool against a set of nitrogen cycling families originally collected using both standard hidden Markov models and a larger set of proteins from Uniprot and demonstrate that our method accurately differentiates these sequences in both operation modes. Availability and implementation Snekmer is written in Python using Snakemake. Code and data used in this article, along with tutorial notebooks, are available at http://github.com/PNNL-CompBio/Snekmer under an open-source BSD-3 license. Supplementary information Supplementary data are available at Bioinformatics Advances online.

59 BASIC BIOLOGICAL SCIENCES↗

FEM Analysis of Hybrid LTS/HTS Cos-Theta Dipole Magnet With Heterogeneous Cable Model

The Lawrence Berkeley National Laboratory (LBNL) and the National High Magnetic Field Laboratory (NHMFL) have published results on Bi-2212 superconductive magnets realized and tested in the canted cosine-theta and solenoid designs, respectively. Fermilab is now preparing for the assembly of the first Bi-2212 stress-managed cosine-theta insert magnet. The insert will be part of the first hybrid cosine-theta magnet made of Nb$_3$Sn outer layers within the US-MDP effort to reach a 20 T bore field. This paper presents the analytical analysis of the cosine-theta Nb$_3$Sn/Bi-2212 hybrid magnet. We report the parameters, logic, and implementation method of the 2D electromagnetic and mechanical FEM analysis of the LTS/HTS hybrid magnet. Results from a detailed heterogeneous model are compared to the homogeneous model implemented in the past. A Python code has been developed to simulate the current degradation due to stresses in the detail-modeled conductor areas. The current degradation has been introduced in the simulation dynamics for the HTS conductor as an iteration process, updating the input load of Lorentz forces of the energization at each step. The magnetic and mechanical analysis results of the 2D cosine-theta LTS/HTS dipole magnet have been described and analyzed.

72 PHYSICS OF ELEMENTARY PARTICLES AND FIELDS↗

End-to-End Workflow for Machine-Learning-Based Qubit Readout With QICK and hls4ml

In this article, we present an end-to-end workflow for superconducting qubit readout that embeds codesigned neural networks into the quantum instrumentation control kit (QICK). Capitalizing on the custom firmware and software of the QICK platform, which is built on Xilinx radiofrequency system-on-chip field-programmable gate arrays (FPGAs), we aim to leverage machine learning (ML) to address critical challenges in qubit readout accuracy and scalability. The workflow utilizes the hls4ml package and employs quantization-aware training to translate ML models into hardware-efficient FPGA implementations via user-friendly Python application programming interfaces. We experimentally demonstrate the design, optimization, and integration of an ML algorithm for single transmon qubit readout, achieving 96% single-shot fidelity with a latency of 32.25 ns and less than 16% FPGA lookup table resource utilization. Our results offer the community an accessible workflow to advance ML-driven readout and adaptive control in quantum information processing applications.

42 ENGINEERING↗

Mantaray: A Rust Package for Ray Tracing Ocean Surface Gravity Waves

Ocean surface gravity waves are an important component of air-sea interaction, influencing energy, momentum, and gas exchanges across the ocean-atmosphere interface. In specific applications such as refraction by ocean currents or bathymetry, ray tracing provides a computationally efficient way to gain insight into wave propagation. In this paper, we introduce Mantaray, an open-source software package implemented in Rust, with a Python interface, that solves the ray equations for ocean surface gravity waves. Mantaray is designed for performance, robustness, and ease of use. The package is modular to facilitate further development and can currently be applied to both idealized and realistic wave propagation problems (Fig. 1).

16 TIDAL AND WAVE POWER↗

Variance reduction via simultaneous importance sampling and control variates techniques using vegas

Monte Carlo (MC) integration is an important calculational technique in the physical sciences. Practical considerations require that the calculations are performed as accurately as possible for a given set of computational resources. To improve the accuracy of MC integration, a number of useful variance reduction algorithms have been developed, including importance sampling and control variates. In this work, we demonstrate how these two methods can be applied simultaneously, thus combining their benefits. We provide a python wrapper, named CoVVVR, which implements our approach in the VEGAS program. The improvements are quantified with several benchmark examples from the literature.

72 PHYSICS OF ELEMENTARY PARTICLES AND FIELDS↗

Codebase release r1.4 for CoVVVR

Monte Carlo (MC) integration is an important calculational technique in the physical sciences. Practical considerations require that the calculations are performed as accurately as possible for a given set of computational resources. To improve the accuracy of MC integration, a number of useful variance reduction algorithms have been developed, including importance sampling and control variates. In this work, we demonstrate how these two methods can be applied simultaneously, thus combining their benefits. We provide a python wrapper, named COVVVR, which implements our approach in the VEGAS program. The improvements are quantified with several benchmark examples from the literature.

Shyamsundar, Prasanth↗