Pub Date : 2025-11-26DOI: 10.1016/j.cpc.2025.109954
Mehmet Ali Sarsıl , Mubashir Mansoor , Mert Saraçoğlu , Servet Timur , Onur Ergen
<div><div>The diverse spectrum of material characteristics, including band gap, mechanical moduli, color, phonon and electronic density of states, along with catalytic and surface properties, are intricately intertwined with the atomic structure and the corresponding interatomic bond lengths. This interconnection extends to the manifestation of interplanar spacings within a crystalline lattice. Analysis of these interplanar spacings and the comprehension of any deviations-whether it be lattice compression or expansion, commonly referred to as strain, hold paramount significance in unraveling various unknowns within the field. Transmission Electron Microscopy (TEM) is widely used to capture these atomic-scale ordering, facilitating direct investigation of interplanar spacings. However, creating critical contour maps for visualizing and interpreting lattice stresses in TEM images remains a challenging task. This study introduces an open-source, AI-assisted application, developed entirely in Python, for processing TEM images to facilitate strain analysis through advanced visualization techniques. This application is designed to process a diverse range of materials, including nanoparticles, 2D materials, pure crystals, and solid solutions. By converting local variations in interplanar spacings into contour maps, it provides a visual representation of lattice expansion and compression. With highly versatile settings, as detailed in this paper, the tool is readily accessible for TEM image-based material analysis. It facilitates an in-depth exploration of strain engineering by generating strain contour maps at the atomic scale, offering valuable insights into material properties. <strong>Program summary</strong> <em>Program Title:</em> PyNanoSpacing <em>CPC Library link to program files:</em> “<span><span>https://doi.org/10.17632/y864t5ykxx.1</span><svg><path></path></svg></span> ” <em>Developer’s repository link:</em> “<span><span>https://github.com/malisarsil/PyNanoSpacing</span><svg><path></path></svg></span> ” <em>Licensing provisions:</em> MIT license <em>Programming language:</em> Python 3.11 <em>Nature of problem:</em> Transmission Electron Microscopy (TEM) is widely used to analyze lattice structures in materials, but extracting quantitative strain information from TEM images remains challenging. Existing tools often lack automation, requiring manual calibration and region selection, leading to inconsistencies. Researchers need a user-friendly, automated solution to analyze local lattice strains and interplanar spacing variations efficiently. <em>Solution method:</em> The developed desktop application simplifies TEM image strain analysis by automating key steps. It extracts image details (such as scale and resolution) and detects atomic regions using AI-based segmentation. A correction step ensures proper alignment before measuring interlayer distances, which are then color-mapped to show strain variations. A smoothing technique is applied to re
{"title":"Mapping strain at the atomic scale with PyNanospacing: An AI-assisted approach to TEM image processing and visualization","authors":"Mehmet Ali Sarsıl , Mubashir Mansoor , Mert Saraçoğlu , Servet Timur , Onur Ergen","doi":"10.1016/j.cpc.2025.109954","DOIUrl":"10.1016/j.cpc.2025.109954","url":null,"abstract":"<div><div>The diverse spectrum of material characteristics, including band gap, mechanical moduli, color, phonon and electronic density of states, along with catalytic and surface properties, are intricately intertwined with the atomic structure and the corresponding interatomic bond lengths. This interconnection extends to the manifestation of interplanar spacings within a crystalline lattice. Analysis of these interplanar spacings and the comprehension of any deviations-whether it be lattice compression or expansion, commonly referred to as strain, hold paramount significance in unraveling various unknowns within the field. Transmission Electron Microscopy (TEM) is widely used to capture these atomic-scale ordering, facilitating direct investigation of interplanar spacings. However, creating critical contour maps for visualizing and interpreting lattice stresses in TEM images remains a challenging task. This study introduces an open-source, AI-assisted application, developed entirely in Python, for processing TEM images to facilitate strain analysis through advanced visualization techniques. This application is designed to process a diverse range of materials, including nanoparticles, 2D materials, pure crystals, and solid solutions. By converting local variations in interplanar spacings into contour maps, it provides a visual representation of lattice expansion and compression. With highly versatile settings, as detailed in this paper, the tool is readily accessible for TEM image-based material analysis. It facilitates an in-depth exploration of strain engineering by generating strain contour maps at the atomic scale, offering valuable insights into material properties. <strong>Program summary</strong> <em>Program Title:</em> PyNanoSpacing <em>CPC Library link to program files:</em> “<span><span>https://doi.org/10.17632/y864t5ykxx.1</span><svg><path></path></svg></span> ” <em>Developer’s repository link:</em> “<span><span>https://github.com/malisarsil/PyNanoSpacing</span><svg><path></path></svg></span> ” <em>Licensing provisions:</em> MIT license <em>Programming language:</em> Python 3.11 <em>Nature of problem:</em> Transmission Electron Microscopy (TEM) is widely used to analyze lattice structures in materials, but extracting quantitative strain information from TEM images remains challenging. Existing tools often lack automation, requiring manual calibration and region selection, leading to inconsistencies. Researchers need a user-friendly, automated solution to analyze local lattice strains and interplanar spacing variations efficiently. <em>Solution method:</em> The developed desktop application simplifies TEM image strain analysis by automating key steps. It extracts image details (such as scale and resolution) and detects atomic regions using AI-based segmentation. A correction step ensures proper alignment before measuring interlayer distances, which are then color-mapped to show strain variations. A smoothing technique is applied to re","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"320 ","pages":"Article 109954"},"PeriodicalIF":3.4,"publicationDate":"2025-11-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"145681710","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
We present a software package for the simulation and analysis of far-field diffraction patterns in transient grating (TG) spectroscopy. The code is designed to assist both experimental planning and post-processing interpretation by modeling the optical response of TG configurations across a wide range of conditions. It supports input through structured MATLAB variables or Excel-based spreadsheets and provides automated consistency checks and visual output generation. The implementation includes integration over detector pixels, enabling realistic simulations that account for spatial averaging and resolution effects. We demonstrate the software’s capabilities through representative use cases, including the influence of the grating-to-sample distance, the pump-to-probe intensity ratio, and the selection of the division parameter governing pixel integration accuracy. The code is freely available and modular, facilitating its adaptation to different experimental geometries and beam conditions. While full validation is provided elsewhere, this work establishes the core methodology and illustrates the practical value of the tool for TG spectroscopy research.
Program summary
Program title: TGCalc.
Licensing provisions: GNU GPLv3.
Programming language: MATLAB/GNU Octave.
Operating system: Linux and Windows.
Nature of problem: The code has been developed to compute diffraction patterns of light in a transient grating geometry scheme. The output intensity distribution is calculated based on the diffraction integral in the Fresnel and Fraunhofer regimes. Together with the diffraction pattern, the spatial harmonics are obtained using a post-processing script based on the input data filename.
Solution method: The diffraction image is calculated as the diffraction integral over the whole space of a Gaussian beam and normalized by its maximum value. For a Gaussian beam with a spherical approximation of the wavefront, an analytical expression of the electromagnetic field in the Fresnel and Fraunhofer regimes is developed, and a calculation code is implemented.
Additional comments: The TGCalc script has been tested with MATLAB versions R2021a, R2022b, and R2024b. The script also works under GNU Octave software (tested with version 4.0.0). However, under GNU Octave, the matrix data writing could give an error due to the file writeout permissions.
{"title":"Software for simulation and analysis of far-field diffraction patterns in transient grating spectroscopy","authors":"Andrii Goloborodko , Myhailo Kotov , Carles Serrat","doi":"10.1016/j.cpc.2025.109964","DOIUrl":"10.1016/j.cpc.2025.109964","url":null,"abstract":"<div><div>We present a software package for the simulation and analysis of far-field diffraction patterns in transient grating (TG) spectroscopy. The code is designed to assist both experimental planning and post-processing interpretation by modeling the optical response of TG configurations across a wide range of conditions. It supports input through structured MATLAB variables or Excel-based spreadsheets and provides automated consistency checks and visual output generation. The implementation includes integration over detector pixels, enabling realistic simulations that account for spatial averaging and resolution effects. We demonstrate the software’s capabilities through representative use cases, including the influence of the grating-to-sample distance, the pump-to-probe intensity ratio, and the selection of the division parameter governing pixel integration accuracy. The code is freely available and modular, facilitating its adaptation to different experimental geometries and beam conditions. While full validation is provided elsewhere, this work establishes the core methodology and illustrates the practical value of the tool for TG spectroscopy research.</div><div><strong>Program summary</strong></div><div><em>Program title</em>: TGCalc.</div><div><em>Licensing provisions</em>: GNU GPLv3.</div><div><em>Programming language</em>: MATLAB/GNU Octave.</div><div><em>Operating system</em>: Linux and Windows.</div><div><em>Nature of problem</em>: The code has been developed to compute diffraction patterns of light in a transient grating geometry scheme. The output intensity distribution is calculated based on the diffraction integral in the Fresnel and Fraunhofer regimes. Together with the diffraction pattern, the spatial harmonics are obtained using a post-processing script based on the input data filename.</div><div><em>Solution method</em>: The diffraction image is calculated as the diffraction integral over the whole space of a Gaussian beam and normalized by its maximum value. For a Gaussian beam with a spherical approximation of the wavefront, an analytical expression of the electromagnetic field in the Fresnel and Fraunhofer regimes is developed, and a calculation code is implemented.</div><div><em>Additional comments</em>: The <span>TGCalc</span> script has been tested with MATLAB versions R2021a, R2022b, and R2024b. The script also works under GNU Octave software (tested with version 4.0.0). However, under GNU Octave, the matrix data writing could give an error due to the file writeout permissions.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"320 ","pages":"Article 109964"},"PeriodicalIF":3.4,"publicationDate":"2025-11-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"145681709","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Pub Date : 2025-11-25DOI: 10.1016/j.cpc.2025.109956
Alessio Roccon
We present an extended version of MHIT36, a GPU-tailored solver for interface-resolved simulations of multiphase turbulence. The framework couples direct numerical simulation (DNS) of the Navier–Stokes equations, which describe the flow field, with a phase-field method to capture interfacial phenomena. In addition, the transport equation for a scalar can also be solved. The governing equations are discretized using a second-order finite difference scheme. The Navier–Stokes equations are time advanced with an explicit fractional-step method, and the resulting pressure Poisson equation is solved using a FFT-based method. The accurate conservative diffuse interface (ACDI) formulation is used to describe the transport of the phase-field variable. Simulations can be performed in two configurations: a triply-periodic cubic domain or a rectangular domain of arbitrary dimensions bounded by two walls. From a computational standpoint, MHIT36 employs a two-dimensional domain decomposition to distribute the workload across MPI tasks. The cuDecomp library is used to perform pencil transpositions and halo updates, while the cuFFT library and OpenACC directives are leveraged to offload the remaining computational kernels to the GPU. MHIT36 is developed using the managed memory feature and it provides a baseline code that is easy to further extend and modify. MHIT36 is released open source under the MIT license.
{"title":"MHIT36: Extension to wall-bounded turbulence and scalar transport equation","authors":"Alessio Roccon","doi":"10.1016/j.cpc.2025.109956","DOIUrl":"10.1016/j.cpc.2025.109956","url":null,"abstract":"<div><div>We present an extended version of MHIT36, a GPU-tailored solver for interface-resolved simulations of multiphase turbulence. The framework couples direct numerical simulation (DNS) of the Navier–Stokes equations, which describe the flow field, with a phase-field method to capture interfacial phenomena. In addition, the transport equation for a scalar can also be solved. The governing equations are discretized using a second-order finite difference scheme. The Navier–Stokes equations are time advanced with an explicit fractional-step method, and the resulting pressure Poisson equation is solved using a FFT-based method. The accurate conservative diffuse interface (ACDI) formulation is used to describe the transport of the phase-field variable. Simulations can be performed in two configurations: a triply-periodic cubic domain or a rectangular domain of arbitrary dimensions bounded by two walls. From a computational standpoint, MHIT36 employs a two-dimensional domain decomposition to distribute the workload across MPI tasks. The cuDecomp library is used to perform pencil transpositions and halo updates, while the cuFFT library and OpenACC directives are leveraged to offload the remaining computational kernels to the GPU. MHIT36 is developed using the managed memory feature and it provides a baseline code that is easy to further extend and modify. MHIT36 is released open source under the MIT license.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"320 ","pages":"Article 109956"},"PeriodicalIF":3.4,"publicationDate":"2025-11-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"145616112","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Pub Date : 2025-11-21DOI: 10.1016/j.cpc.2025.109962
Lianhe Sun , Bin Wang , Yaochen Zhang , Jiacheng Jin , Zelong Mao , Haizhu Wang , Mao Sheng , Bing Yang , Sergey Stanchits , Alexey Cheremisin
Fractures in rock masses are a central focus in research areas such as unconventional energy extraction, nuclear waste disposal, and carbon sequestration. Laboratory investigations of fracture parameters are essential for optimizing field operations. In recent years, CT scanning has emerged as a widely adopted non-destructive inspection technique. However, existing methods for post-processing CT scan data face persistent challenges in achieving high accuracy and efficiency. To address these challenges, we propose a novel Python-based post-processing framework that integrates a slice-by-slice thinning algorithm, local thickness computation, and point cloud data processing techniques. This framework enables precise characterization of fractured digital rocks by quantifying fracture width distribution and fracture surface orientation, alongside standard structural evaluation metrics such as the fractal dimension, volume ratio, and the H-index. Its feasibility, accuracy, and flexibility are validated through analyses of diverse fracturing samples, including fluid-fractured samples, shear-induced fracture samples, and samples containing multiple secondary fractures. PROGRAM SUMMARYProgram title:Digifrac CPC Library link to program files: https://10.17632/hcynpd9hf4.1Developer’s repository link: https://github.com/BinWang0213/DigiFracLicensing provisions: GPLv3 Programming language: Python Nature of problem: This program quantitatively calculates the three-dimensional structural parameters of fracture networks in rocks based on CT scan data. In addition to basic parameters such as fractal dimension, fracture volume, and surface area, it also provides accurate determinations of fracture width distribution and fracture surface orientation. Solution method: The random forest algorithm is employed to improve the accuracy of CT data segmentation, while a slice-by-slice thinning algorithm is used to extract the fracture medial surface, thereby enhancing the precision of fracture aperture distribution calculations. Furthermore, the three-dimensional orientation distribution of fractures is determined from the 3D point cloud data of the extracted medial surface.
{"title":"Digifrac: Reconstruction and quantification of discrete fractures in rocks using micro-CT images","authors":"Lianhe Sun , Bin Wang , Yaochen Zhang , Jiacheng Jin , Zelong Mao , Haizhu Wang , Mao Sheng , Bing Yang , Sergey Stanchits , Alexey Cheremisin","doi":"10.1016/j.cpc.2025.109962","DOIUrl":"10.1016/j.cpc.2025.109962","url":null,"abstract":"<div><div>Fractures in rock masses are a central focus in research areas such as unconventional energy extraction, nuclear waste disposal, and carbon sequestration. Laboratory investigations of fracture parameters are essential for optimizing field operations. In recent years, CT scanning has emerged as a widely adopted non-destructive inspection technique. However, existing methods for post-processing CT scan data face persistent challenges in achieving high accuracy and efficiency. To address these challenges, we propose a novel Python-based post-processing framework that integrates a slice-by-slice thinning algorithm, local thickness computation, and point cloud data processing techniques. This framework enables precise characterization of fractured digital rocks by quantifying fracture width distribution and fracture surface orientation, alongside standard structural evaluation metrics such as the fractal dimension, volume ratio, and the H-index. Its feasibility, accuracy, and flexibility are validated through analyses of diverse fracturing samples, including fluid-fractured samples, shear-induced fracture samples, and samples containing multiple secondary fractures. <strong>PROGRAM SUMMARY</strong> <em>Program title</em>:Digifrac <em>CPC Library link to program files</em>: <span><span>https://10.17632/hcynpd9hf4.1</span><svg><path></path></svg></span> <em>Developer’s repository link</em>: <span><span>https://github.com/BinWang0213/DigiFrac</span><svg><path></path></svg></span> <em>Licensing provisions</em>: GPLv3 <em>Programming language</em>: Python <em>Nature of problem</em>: This program quantitatively calculates the three-dimensional structural parameters of fracture networks in rocks based on CT scan data. In addition to basic parameters such as fractal dimension, fracture volume, and surface area, it also provides accurate determinations of fracture width distribution and fracture surface orientation. <em>Solution method</em>: The random forest algorithm is employed to improve the accuracy of CT data segmentation, while a slice-by-slice thinning algorithm is used to extract the fracture medial surface, thereby enhancing the precision of fracture aperture distribution calculations. Furthermore, the three-dimensional orientation distribution of fractures is determined from the 3D point cloud data of the extracted medial surface.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"320 ","pages":"Article 109962"},"PeriodicalIF":3.4,"publicationDate":"2025-11-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"145616214","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Pub Date : 2025-11-21DOI: 10.1016/j.cpc.2025.109948
Antti Vaaranta , Marco Cattaneo
The Markovian dynamics of open quantum systems is typically described through Lindblad equations, which are derived from the Redfield equation via the full secular approximation. The latter neglects the rotating terms in the master equation corresponding to pairs of jump operators with different Bohr frequencies. However, for many physical systems this approximation breaks down, and thus a more accurate treatment of the slowly rotating terms is required. Indeed, more precise physical results can be obtained by performing the partial secular approximation, which takes into account the relevant time scale associated with each pair of jump operators and compares it with the time scale arising from the system-environment coupling. In this work, we introduce a general code for performing the partial secular approximation in the Redfield equation for structured open quantum systems. The code can be applied to a generic Hamiltonian of any multipartite system coupled to bosonic baths. Moreover, it can also reproduce the unified master equation, which captures the same physical behavior as the Redfield equation under the partial secular approximation, but is mathematically guaranteed to generate a completely positive dynamical map. Finally, the code can compute both the local and global version of the master equation for the same physical problem. We illustrate the code by studying the steady-state heat flow in a structured open quantum system composed of two superconducting qubits, each coupled to a bosonic mode, which in turn interacts with a thermal bath. The results in this work can be employed for the numerical study of a wide range of complex open quantum systems.
{"title":"Numerical implementation of the partial secular approximation and unified master equation in structured open quantum systems","authors":"Antti Vaaranta , Marco Cattaneo","doi":"10.1016/j.cpc.2025.109948","DOIUrl":"10.1016/j.cpc.2025.109948","url":null,"abstract":"<div><div>The Markovian dynamics of open quantum systems is typically described through Lindblad equations, which are derived from the Redfield equation via the <em>full</em> secular approximation. The latter neglects the rotating terms in the master equation corresponding to pairs of jump operators with different Bohr frequencies. However, for many physical systems this approximation breaks down, and thus a more accurate treatment of the slowly rotating terms is required. Indeed, more precise physical results can be obtained by performing the <em>partial</em> secular approximation, which takes into account the relevant time scale associated with each pair of jump operators and compares it with the time scale arising from the system-environment coupling. In this work, we introduce a general code for performing the partial secular approximation in the Redfield equation for structured open quantum systems. The code can be applied to a generic Hamiltonian of any multipartite system coupled to bosonic baths. Moreover, it can also reproduce the <em>unified master equation</em>, which captures the same physical behavior as the Redfield equation under the partial secular approximation, but is mathematically guaranteed to generate a completely positive dynamical map. Finally, the code can compute both the local and global version of the master equation for the same physical problem. We illustrate the code by studying the steady-state heat flow in a structured open quantum system composed of two superconducting qubits, each coupled to a bosonic mode, which in turn interacts with a thermal bath. The results in this work can be employed for the numerical study of a wide range of complex open quantum systems.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"320 ","pages":"Article 109948"},"PeriodicalIF":3.4,"publicationDate":"2025-11-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"145616216","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Pub Date : 2025-11-21DOI: 10.1016/j.cpc.2025.109958
Martin Thümmler , Thomas Lettau , Alexander Croy , Ulf Peschel , Stefanie Gräfe
The semiconductor Bloch equations (SBEs) with a dephasing operator for the microscopic polarizations are a well established approach to simulate high-harmonic spectra in solids. We discuss the impact of the dephasing operator on the stability of the numerical integration of the SBEs in the Wannier gauge. It is shown that the commonly used phenomenological approach to apply dephasing is ill-defined in the presence of band crossings and leads to artifacts in the carrier distribution. They are caused by rapid changes of the dephasing operator matrix elements in the Wannier gauge, which render the convergence of the simulation in the stationary basis infeasible. In the comoving basis, also called Houston basis, these rapid changes can be resolved, but only at the cost of a largely increased computation time. As a remedy, we propose a modification of the dephasing operator with reduced magnitude in energetically close subspaces. This approach removes the artifacts in the carrier distribution and significantly speeds up the calculations, while affecting the high-harmonic spectrum only marginally. To foster further development, we provide our parallelized source code.
{"title":"Semiconductor Bloch equations in Wannier gauge with well-behaved dephasing","authors":"Martin Thümmler , Thomas Lettau , Alexander Croy , Ulf Peschel , Stefanie Gräfe","doi":"10.1016/j.cpc.2025.109958","DOIUrl":"10.1016/j.cpc.2025.109958","url":null,"abstract":"<div><div>The semiconductor Bloch equations (SBEs) with a dephasing operator for the microscopic polarizations are a well established approach to simulate high-harmonic spectra in solids. We discuss the impact of the dephasing operator on the stability of the numerical integration of the SBEs in the Wannier gauge. It is shown that the commonly used phenomenological approach to apply dephasing is ill-defined in the presence of band crossings and leads to artifacts in the carrier distribution. They are caused by rapid changes of the dephasing operator matrix elements in the Wannier gauge, which render the convergence of the simulation in the stationary basis infeasible. In the comoving basis, also called Houston basis, these rapid changes can be resolved, but only at the cost of a largely increased computation time. As a remedy, we propose a modification of the dephasing operator with reduced magnitude in energetically close subspaces. This approach removes the artifacts in the carrier distribution and significantly speeds up the calculations, while affecting the high-harmonic spectrum only marginally. To foster further development, we provide our parallelized source code.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"320 ","pages":"Article 109958"},"PeriodicalIF":3.4,"publicationDate":"2025-11-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"145616215","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Pub Date : 2025-11-19DOI: 10.1016/j.cpc.2025.109942
Roman Vetter
This article introduces TinyDEM, a lightweight implementation of a full-fledged discrete element method (DEM) solver in 3D. Newton’s damped equations of motion are solved explicitly for translations and rotations of a polydisperse ensemble of dry, soft, granular spherical particles, using quaternions to represent their orientation in space without gimbal lock. Particle collisions are modeled as inelastic and frictional, including full exchange of torque. With a general particle-mesh collision routine, complex rigid geometries can be simulated. TinyDEM is designed to be a compact standalone program written in simple C++11, devoid of explicit pointer arithmetics and advanced concepts such as manual memory management or polymorphism. It is parallelized with OpenMP and published freely under the 3-clause BSD license. TinyDEM can serve as an entry point into classical DEM simulations or as a foundation for more complex models of particle dynamics.
PROGRAM SUMMARY
Program Title: TinyDEM
CPC Library link to program files: (to be added by Technical Editor)
Developer’s repository link: —
Licensing provisions: BSD 3-clause
Programming language: C++11
Supplementary material: Videos 1–6
Nature of problem:
Dynamics and statics of polydisperse ensembles of visco-elastic, frictional, non-adhesive spherical particles (such as in granular media) in 1D, 2D and 3D. All three modes of torque exchange (sliding, rolling and twisting) are modeled with slip-stick Coulomb friction.
Solution method:
The discrete element method is used to solve Newton’s damped equations of motion for particle translations and rotations with the semi-implicit Euler scheme. Quaternions are used to represent particle orientations. For efficient collision detection, a linked cell list is used. A static geometrical environment can be defined with a discrete mesh. The program is parallelized with OpenMP for shared-memory systems.
Additional comments including restrictions and unusual features:
The source code is exceptionally compact, consisting of only about 600 commented lines in two files—a header and a source file. With no dependencies, it is highly portable and accessible, making it also suited for educational purposes.
{"title":"TinyDEM: Minimal open granular DEM code with sliding, rolling and twisting friction","authors":"Roman Vetter","doi":"10.1016/j.cpc.2025.109942","DOIUrl":"10.1016/j.cpc.2025.109942","url":null,"abstract":"<div><div>This article introduces TinyDEM, a lightweight implementation of a full-fledged discrete element method (DEM) solver in 3D. Newton’s damped equations of motion are solved explicitly for translations and rotations of a polydisperse ensemble of dry, soft, granular spherical particles, using quaternions to represent their orientation in space without gimbal lock. Particle collisions are modeled as inelastic and frictional, including full exchange of torque. With a general particle-mesh collision routine, complex rigid geometries can be simulated. TinyDEM is designed to be a compact standalone program written in simple C++11, devoid of explicit pointer arithmetics and advanced concepts such as manual memory management or polymorphism. It is parallelized with OpenMP and published freely under the 3-clause BSD license. TinyDEM can serve as an entry point into classical DEM simulations or as a foundation for more complex models of particle dynamics.</div><div><strong>PROGRAM SUMMARY</strong></div><div><em>Program Title:</em> TinyDEM</div><div><em>CPC Library link to program files:</em> (to be added by Technical Editor)</div><div><em>Developer’s repository link:</em> —</div><div><em>Licensing provisions:</em> BSD 3-clause</div><div><em>Programming language:</em> C++11</div><div><em>Supplementary material:</em> Videos 1–6</div><div><strong>Nature of problem:</strong></div><div>Dynamics and statics of polydisperse ensembles of visco-elastic, frictional, non-adhesive spherical particles (such as in granular media) in 1D, 2D and 3D. All three modes of torque exchange (sliding, rolling and twisting) are modeled with slip-stick Coulomb friction.</div><div><strong>Solution method:</strong></div><div>The discrete element method is used to solve Newton’s damped equations of motion for particle translations and rotations with the semi-implicit Euler scheme. Quaternions are used to represent particle orientations. For efficient collision detection, a linked cell list is used. A static geometrical environment can be defined with a discrete mesh. The program is parallelized with OpenMP for shared-memory systems.</div><div><strong>Additional comments including restrictions and unusual features:</strong></div><div>The source code is exceptionally compact, consisting of only about 600 commented lines in two files—a header and a source file. With no dependencies, it is highly portable and accessible, making it also suited for educational purposes.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"320 ","pages":"Article 109942"},"PeriodicalIF":3.4,"publicationDate":"2025-11-19","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"145616218","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Pub Date : 2025-11-19DOI: 10.1016/j.cpc.2025.109955
Laurent Hascoët , Matt Menickelly , Sri Hari Krishna Narayanan , Jared O’Neal , Nicolas Schunck , Stefan M. Wild
The HFBTHO code implements a nuclear energy density functional solver to model the structure of atomic nuclei. HFBTHO has previously been used to calibrate energy functionals and perform sensitivity analysis by using derivative-free methods. To enable derivative-based optimization and uncertainty quantification approaches, we must compute the derivatives of HFBTHO outputs with respect to the parameters of the energy functional, which are a subset of all input parameters of the code. We use the algorithmic/automatic differentiation (AD) tool Tapenade to differentiate HFBTHO. We compare the derivatives obtained using AD against finite-difference approximation and examine the performance of the derivative computation.
{"title":"HFBTHO-AD: Differentiation of a nuclear energy density functional code","authors":"Laurent Hascoët , Matt Menickelly , Sri Hari Krishna Narayanan , Jared O’Neal , Nicolas Schunck , Stefan M. Wild","doi":"10.1016/j.cpc.2025.109955","DOIUrl":"10.1016/j.cpc.2025.109955","url":null,"abstract":"<div><div>The HFBTHO code implements a nuclear energy density functional solver to model the structure of atomic nuclei. HFBTHO has previously been used to calibrate energy functionals and perform sensitivity analysis by using derivative-free methods. To enable derivative-based optimization and uncertainty quantification approaches, we must compute the derivatives of HFBTHO outputs with respect to the parameters of the energy functional, which are a subset of all input parameters of the code. We use the algorithmic/automatic differentiation (AD) tool Tapenade to differentiate HFBTHO. We compare the derivatives obtained using AD against finite-difference approximation and examine the performance of the derivative computation.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"320 ","pages":"Article 109955"},"PeriodicalIF":3.4,"publicationDate":"2025-11-19","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"145681674","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Pub Date : 2025-11-19DOI: 10.1016/j.cpc.2025.109935
Javier López Miras, Fuensanta Vilches
We introduce mosca, a Mathematica package designed to facilitate on-shell calculations in effective field theories (EFTs). This initial release focuses on the reduction of Green’s bases to physical bases, as well as transformations between arbitrary operator bases. The core of the package is based on a diagrammatic on-shell matching procedure, grounded in the equivalence of physical observables derived from both redundant and non-redundant Lagrangians. mosca offers a complete set of tools for performing basis transformations, diagram isomorphism detection, numerical substitution of kinematic configurations, and symbolic manipulation of algebraic expressions. Planned future developments include extension to one-loop computations, thus providing support for EFT renormalization directly in a physical basis and automated computation of one-loop finite matching, including contributions from evanescent operators.
PROGRAM SUMMARYProgram Title: mosca CPC Library link to program files: (to be added by Technical Editor) Developer’s repository link:https://gitlab.com/matchingonshell/moscaLicensing provisions: GPLv3 Programming language: Mathematica Nature of problem: Matching calculations in effective field theories are traditionally performed off-shell, involving complicated basis reductions through non-trivial field redefinitions to eliminate redundant operators. This process is algebraically intensive and prone to errors. Although on-shell matching, which focuses directly on physical observables, could simplify these steps by avoiding field redefinitions, it has been considered impractical due to the presence of apparent non-localities that must cancel precisely. Automating on-shell matching has therefore been a long-standing challenge. Solution method: Our approach is based on a numerical solution of the on-shell matching equations, which naturally and effortlessly enforces the delicate cancellation of non-local terms between the full theory and the effective theory. By employing rational on-shell kinematics, the method achieves an exact analytic solution despite using numerical techniques. This allows the matching to be performed entirely within a physical operator basis. Additional comments including restrictions and unusual features: The workflow for handling Lagrangians and Feynman diagrams in mosca is based on the integration of FeynArts and FeynCalc. Consequently, users need to provide specific FeynArts model files patched for compatibility with FeynCalc. Additionally, a specialized input format is required to define Wilson coefficients along with their corresponding EFT order (EFTOrder). These requirements ensure the correct processing of models and coefficients.
{"title":"Automation of a matching on-shell calculator","authors":"Javier López Miras, Fuensanta Vilches","doi":"10.1016/j.cpc.2025.109935","DOIUrl":"10.1016/j.cpc.2025.109935","url":null,"abstract":"<div><div>We introduce <span>mosca</span>, a <span>Mathematica</span> package designed to facilitate on-shell calculations in effective field theories (EFTs). This initial release focuses on the reduction of Green’s bases to physical bases, as well as transformations between arbitrary operator bases. The core of the package is based on a diagrammatic on-shell matching procedure, grounded in the equivalence of physical observables derived from both redundant and non-redundant Lagrangians. <span>mosca</span> offers a complete set of tools for performing basis transformations, diagram isomorphism detection, numerical substitution of kinematic configurations, and symbolic manipulation of algebraic expressions. Planned future developments include extension to one-loop computations, thus providing support for EFT renormalization directly in a physical basis and automated computation of one-loop finite matching, including contributions from evanescent operators.</div><div><strong>PROGRAM SUMMARY</strong> <em>Program Title:</em> mosca <em>CPC Library link to program files:</em> (to be added by Technical Editor) <em>Developer’s repository link:</em> <span><span>https://gitlab.com/matchingonshell/mosca</span><svg><path></path></svg></span> <em>Licensing provisions:</em> GPLv3 <em>Programming language:</em> Mathematica <em>Nature of problem:</em> Matching calculations in effective field theories are traditionally performed off-shell, involving complicated basis reductions through non-trivial field redefinitions to eliminate redundant operators. This process is algebraically intensive and prone to errors. Although on-shell matching, which focuses directly on physical observables, could simplify these steps by avoiding field redefinitions, it has been considered impractical due to the presence of apparent non-localities that must cancel precisely. Automating on-shell matching has therefore been a long-standing challenge. <em>Solution method:</em> Our approach is based on a numerical solution of the on-shell matching equations, which naturally and effortlessly enforces the delicate cancellation of non-local terms between the full theory and the effective theory. By employing rational on-shell kinematics, the method achieves an exact analytic solution despite using numerical techniques. This allows the matching to be performed entirely within a physical operator basis. <em>Additional comments including restrictions and unusual features:</em> The workflow for handling Lagrangians and Feynman diagrams in mosca is based on the integration of FeynArts and FeynCalc. Consequently, users need to provide specific FeynArts model files patched for compatibility with FeynCalc. Additionally, a specialized input format is required to define Wilson coefficients along with their corresponding EFT order (EFTOrder). These requirements ensure the correct processing of models and coefficients.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"320 ","pages":"Article 109935"},"PeriodicalIF":3.4,"publicationDate":"2025-11-19","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"145681672","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Pub Date : 2025-11-17DOI: 10.1016/j.cpc.2025.109961
Jian Zhang , Ping Zhu , Chris C. Hegna
A hybrid spectral/finite-element code is developed to numerically solve the resistive finite-pressure magnetohydrodynamic equilibria without the necessity of postulating nested magnetic flux surfaces in the non-axisymmetric toroidal systems. The adopted approach integrates a hyperbolic parallel damping equation for pressure updating, along with a dynamic resistive relaxation for magnetic field. To address the non-axisymmetry in toroidal geometry, a pseudo flux mapping is employed to relate the axisymmetric computational domain to the physical domain. On the computational mesh, an isoparametric C1-continuous triangular element is utilized to discretize the poloidal plane, which is complemented with a Fourier decomposition in the toroidal direction. The versatility of the code is demonstrated through its application to several different non-axisymmetric toroidal systems, including the inherently three-dimensional equilibria in stellarators, the helical-core equilibrium states in tokamak plasmas, and the quasi-single-helicity states in a reversed-field pinch.
{"title":"Numerical solutions of resistive finite-pressure magnetohydrodynamic equilibria for stellarator and non-axisymmetric toroidal plasmas","authors":"Jian Zhang , Ping Zhu , Chris C. Hegna","doi":"10.1016/j.cpc.2025.109961","DOIUrl":"10.1016/j.cpc.2025.109961","url":null,"abstract":"<div><div>A hybrid spectral/finite-element code is developed to numerically solve the resistive finite-pressure magnetohydrodynamic equilibria without the necessity of postulating nested magnetic flux surfaces in the non-axisymmetric toroidal systems. The adopted approach integrates a hyperbolic parallel damping equation for pressure updating, along with a dynamic resistive relaxation for magnetic field. To address the non-axisymmetry in toroidal geometry, a pseudo flux mapping is employed to relate the axisymmetric computational domain to the physical domain. On the computational mesh, an isoparametric C1-continuous triangular element is utilized to discretize the poloidal plane, which is complemented with a Fourier decomposition in the toroidal direction. The versatility of the code is demonstrated through its application to several different non-axisymmetric toroidal systems, including the inherently three-dimensional equilibria in stellarators, the helical-core equilibrium states in tokamak plasmas, and the quasi-single-helicity states in a reversed-field pinch.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"320 ","pages":"Article 109961"},"PeriodicalIF":3.4,"publicationDate":"2025-11-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"145571120","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}