TL;DR
SpM is a new sparse modeling tool that improves the stability of analytic continuation of imaginary-time Green's functions in quantum Monte Carlo simulations, effectively handling noise and errors.
Contribution
It introduces a regularization-based sparse modeling approach that automatically selects relevant bases, enhancing the stability of analytic continuation in noisy data.
Findings
SpM achieves stable analytic continuation despite noise.
The method automatically identifies noise-robust bases.
Applications demonstrate improved spectral data extraction.
Abstract
We present SpM, a sparse modeling tool for the analytic continuation of imaginary-time Green's function, licensed under GNU General Public License version 3. In quantum Monte Carlo simulation, dynamic physical quantities such as single-particle and magnetic excitation spectra can be obtained by applying analytic continuation to imaginary-time data. However, analytic continuation is an ill-conditioned inverse problem and thus sensitive to noise and statistical errors. SpM provides stable analytic continuation against noise by means of a modern regularization technique, which automatically selects bases that contain relevant information unaffected by noise. This paper details the use of this program and shows some applications.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
SpM: Sparse modeling tool for analytic continuation of imaginary-time Green’s function
Kazuyoshi Yoshimi
Junya Otsuki
Yuichi Motoyama
Masayuki Ohzeki
Hiroshi Shinaoka
Institute for Solid State Physics, University of Tokyo, Chiba 277-8581, Japan
Research Institute for Interdisciplinary Science, Okayama University, Okayama 700-8530, Japan
Graduate School of Information Sciences, Tohoku University, Sendai 980-8578, Japan
Department of Physics, Saitama University, Saitama 338-8570, Japan
Abstract
We present SpM, a sparse modeling tool for the analytic continuation of imaginary-time Green’s function, licensed under GNU General Public License version 3. In quantum Monte Carlo simulation, dynamic physical quantities such as single-particle and magnetic excitation spectra can be obtained by applying analytic continuation to imaginary-time data. However, analytic continuation is an ill-conditioned inverse problem and thus sensitive to noise and statistical errors. SpM provides stable analytic continuation against noise by means of a modern regularization technique, which automatically selects bases that contain relevant information unaffected by noise. This paper details the use of this program and shows some applications.
keywords:
Sparse modeling, Analytic continuation, Imaginary-time/Matsubara Green’s function
††journal: Computer Physics Communications
PROGRAM SUMMARY
Program Title: SpM
Journal Reference:
Catalogue identifier:
Licensing provisions: GNU General Public License version 3
Programming language: C++.
Computer: PC
Operating system: Any, tested on Linux and Mac OS X
Keywords: Sparse modeling, Analytic continuation, Imaginary-time/Matsubara Green’s function
Classification: 4.4
External routines/libraries: BLAS, LAPACK, and CPPLapack libraries.
Nature of problem: The analytic continuation of imaginary-time input data to real-frequency spectra is known to be an ill-conditioned inverse problem and very sensitive to noise and the statistic errors.
Solution method: By using a modern regularization technique, analytic continuation is made robust against noise since the basis that is unaffected by the noise is automatically selected.
1 Introduction
The method of imaginary-time Green’s function is a fundamental framework for computations of quantum many-body systems[1]. This framework, however, has an intrinsic problem in numerical calculations of spectral functions, which requires analytic continuation from imaginary-frequency to real-frequency domains. Mathematically, the analytic continuation is classified as an ill-conditioned inverse problem with an infinitely large condition number. This causes serious problems, in particular, in quantum Monte Carlo simulations[2]: Statistical errors in the imaginary-time quantities are enormously amplified to result in unphysical spectra. To overcome this problem, several methods have been proposed, including Padé approximation [3, 4], the maximum entropy method [5, 6, 7], stochastic methods [8, 9, 10], and the neural network method[11]. However, a definitive method has yet to be established.
Some of the present authors have recently proposed a method for analytic continuation that uses the sparse modeling method [12]. In this method, stable analytic continuation against noise is achieved by selecting bases that are insensitive to the noise. SpM is a software package that implements the above method [13]. In SpM, L1-norm regularization is used to separate relevant information in imaginary-time data from irrelevant information that makes the spectrum unphysical. Furthermore, the solution can be obtained under some constraints, such as the sum rule and non-negativity.
The rest of this paper is organized as follows. The basic usage of SpM, from installation to execution, is described in Sec. 2. The algorithm implementation is presented in Sec. 3. Numerical results and an analysis of output data for a sample file are also demonstrated in Sec 4. The conclusions are given in Sec.5.
2 Basic usage
2.1 Install
The stable version of SpM can be downloaded from its Github page [13]. The gzipped tar file contains the source code and samples. To build SpM, a C++ compiler and the BLAS, LAPACK and CPPLapack libraries are required. The CMake utility can be used to manage the build process. An example of the procedure for compiling SpM is shown below:
mkdir spm.build && cd spm.build make
Here, x.y.z indicates the version number of SpM and spm.src is a directory that contains the source code. In this case, the executable file SpM is generated in the spm.build/src directory.
Some scripts are included for test calculations. For example, the fermionic spectrum can be obtained by running a test calculation as follows:
ln -s spm.build/src/SpM.out .. $ sh ./run.sh
The results can be found in the output directory.
2.2 Usage
In this subsection, we explain the usage of SpM. An overview of the basic usage flow of SpM is shown in Fig. 1.
- Make a data file
In SpM, the imaginary-time is automatically determined from the inverse temperature beta, which is specified in the parameter file, and the total number of steps, e.g. . The number of the column where the values of are stored is indicated in the parameter file. An example of the data file is shown in the upper-right corner of Fig. 1.
- Make a parameter file
Parameters defined in this input file are classified into the following four sections:
(1) INPUT or OUTPUT: Information regarding input and output data, such as statistics, inverse temperature, and input (output) file name for (spectrum), is specified.
(2) OMEGA: The minimum and maximum values of real frequencies and the total number of target frequencies are given.
(3) SVD: The truncation value of singular values (SV) is given.
(4) ADMM: The parameters for L1 regression, conducted using an algorithm named the alternating direction method of multipliers (ADMM) [14], are given.
An example of the parameter file is shown in the upper-left corner of Fig. 1. For details regarding the input files, please see the official website[13].
- Calculation
After the two input files have been prepared, SpM can be run by typing the following command in the terminal:
$ spm.build/src/SpM.out -i param.in
Here, param.in is the parameter input file.
- Output
After calculation, the output directory is automatically created. The following files are output in this directory:
(1) spectrum.dat: Real frequency spectrum for the optimal value of the hyper parameter .
(2) lambda_dep.dat: Several quantities such as square error in the SV/original basis and L1 norm in the SV basis as a function of .
(3) find_lambda_opt.dat : Auxiliary data that are used to determine the optimal value of .
(4) SV.dat: SV of the kernel .
The lambda_opt directory contains the dataset at the optimized . The lambda directory contains subdirectories lambda_* for each , which are used to store the detailed numerical results.
- Post-processing
To visualize the results, gnuplot script files are included in the samples directory. These script files can be used by typing the following command in the output directory:
$ gnuplot spm.src/samples/plt/*
This command generates four Encapsulated PostScript (EPS) files, namely spectrum.eps, lambda_dep.eps, find_lambda_opt.eps and SV_log.eps. These scripts can be used by typing the following command in the lambda_* directory:
$ gnuplot spm.src/samples/plt/ lambda_fix/*
For details regarding the output files, please see the official website[13].
3 Algorithm
In this section, we explain the calculation flow of SpM used to obtain the spectrum using -norm regularization. The calculation procedure consists of the four steps shown in Fig. 2. Each step is detailed below.
- Make a kernel matrix
The input of the analytic continuation is the imaginary-time Green’s function computed in the range . For numerical data, one may use the exact integral equation between and : 111Note that the sign of is opposite to that in the ordinary definition. Here, is positive definite in .
[TABLE]
Here, and are defined as
[TABLE]
where is the spectrum.
For convenience, we recast Eq. (1) into a conventional linear equation as
[TABLE]
Here, the vector is defined as , where is the -division of . The quantities on the right-hand side are defined as and , which are obtained after replacing the integral over with -point finite differences in the range .
- Singular value decomposition
The singular value decomposition (SVD) of the matrix is conducted as
[TABLE]
where is an diagonal matrix, and and are orthogonal matrices of sizes and , respectively.
- Get the spectrum at fixed
Introducing new vectors
[TABLE]
we consider cost function that includes the regularization term
[TABLE]
where is a positive constant and denotes the norm defined as This form of optimization problem is referred to as least absolute shrinkage and selection operators (LASSO) [15]. We solve this optimization problem using the ADMM algorithm developed by Boyd et al. [14].
It is noted that the solution must satisfy two conditions: non-negativity and the sum rule , where for the fermionic case and for the bosonic case. These constraints are expressed in terms of the vector as
[TABLE]
Each constraint can be switched on or off to meet the user’s needs. This is a technical advantage over the maximum entropy method, in which the entropy term requires positiveness, 222For non-negative spectra in the maximum entropy method, see Refs. [16] and [17].. The details of the ADMM method with these constraints are presented in a previous paper [12].
- Get the optimal value of
To find the optimal value of , we first define the function , which connects the left and right endpoints of . Then, the peak in the ratio corresponds to the position of the kink in . In this way, we obtain . A similar method was adopted in the literature [18, 19].
4 Examples
4.1 Calculation of spectrum
In this section, we first demonstrate SpM by calculating the spectrum. The input files are located in the samples directory spm.src/samples/fermion. In this sample, the exact spectrum function, which has three peaks, at , respectively, is prepared by superimposing three Gaussian functions, as shown in Fig. 3(a) (blue line). By using Eq. (1), the exact imaginary-time Green’s function is obtained. Then, white noise with standard deviation is added to . The obtained is output to the file Gtau.in.
Next, we prepare the input file to set the parameters as explained in Sec. 2.2. Here, the sample file param.in is as follows:
INPUT/OUTPUT
statistics="fermion" beta=100 filein_G="Gtau.in" column=1 fileout_spec="spectrum.dat"
OMEGA
Nomega=1001 omegamin=-4 omegamax=4
ADMM
lambdalogbegin=2 lambdalogend=-6 tolerance=1e-10 maxiteration=1000
After the above two files have been prepared, SpM is executed by typing the following command:
$ spm.build/src/SpM.out -i param.in
Figure 3(a) shows the real-frequency spectrum function (red line). It can be seen that the spectrum function becomes smooth and thus the effect of noise is suppressed by this method. In Fig. 3(b), the root-mean-squared error (RMSE) in the SV basis is shown by the red line, and that in the original basis is shown by the pink line. The L1 norm corresponding the second term in Eq. (7) is plotted as the blue line. The L1 norm monotonically increases with decreasing ; i.e., the number of bases that have non-zero coefficients becomes large. The RMSE first decreases toward , but then becomes saturated in the sufficiently small region due to over-fitting.
This over-fitting can be avoided by choosing a suitable . In SpM, the elbow method is adopted to get the optimal value of , as explained in Sec. 3. In this method, the optimal value is determined from the peak position of . As can be seen in Fig. 3(c), is obtained as for this sample. The spectrum function shown in Fig. 3(a) is that at .
4.2 Robustness against noise
Finally, we demonstrate the robustness of SpM against the noise of the Green function. For comparison, we also show the results of Padé approximation. Padé approximation is one of the standard methods for analytic continuation [3, 4]. In this method, the Green’s function in Matsubara frequency is approximated by a rational function and the spectrum is calculated using analytic continuation as . Since is obtained along the imaginary axis, the accuracy of the analytic continuation is high around the zero frequency. Accuracy decreases with distance away from the zero frequency. Thus, it is expected that the effect of noise will be strong in high-frequency regions.
To evaluate robustness against noise, we first prepared the “exact” fermionic spectrum depicted in Fig. 3(a) and generated 30 independent Green’s functions with white noise as samples. Next, we reconstructed the spectrum from these samples using SpM and Padé approximation and estimated the mean and standard deviation of the spectrum at each frequency. Figure 4 shows the numerical results. The black dashed curve depicts the “exact” spectrum, and the blue lines and the shaded regions represent the mean values and standard deviations, respectively. At , the effect of noise is large around the peak frequencies at for Padé approximation. For SpM, although the spectrum is stable against noise, the peak frequencies shift from . At , the effect of noise becomes small but the deviation around remains for Padé approximation. For SpM, the shape of the spectrum matches that of the exact spectrum. These results indicate that Padé approximation is a good approximation around but becomes sensitive to noise in the region far from , as expected. In contrast, SpM is robust against noise. However, the noise moves the peak frequencies relative to the exact ones. One can evaluate the reliability of the positions of the peak frequencies by investigating the noise dependency, as explained in another study [12].
5 Summary
In this paper, we introduced the analytic continuation tool SpM. In SpM, the basis that is insensitive to noise is automatically selected using the sparse modeling method. As a result, stable analytic continuation against noise is realized.
The present version of SpM only provides analytic continuation using the sparse modeling method. A comparison of results obtained with other methods, such as Padé approximation and maximum entropy methods, would be useful for evaluating the reliability of the analytic continuation. In the near future, by implementing these functions, SpM will be able to examine results from various viewpoints and be a more helpful tool for understanding dynamical physical properties at finite temperatures in many-body quantum systems.
Acknowledgments
We thank T. Kato for useful comments. This work was supported by JSPS KAKENHI grants No. 16K17735, No. 18H04301 (J-Physics), and No. 18H01158. KY and YM were supported by Building of Consortia for the Development of Human Resources in Science and Technology, MEXT, Japan.
References
- [1]
G. D. Mahan, Many-Particle Physics, Springer US, 2000.
- [2]
J. Gubernatis, N. Kawashima, P. Werner, Quantum Monte Carlo Methods: Algorithms for Lattice Models, Cambridge University Press, 2016.
- [3]
K. S. D. Beach, R. J. Gooding, F. Marsiglio, Reliable padé analytical continuation method based on a high-accuracy symbolic computation algorithm, Phys. Rev. B 61 (2000) 5147–5157.
URL https://link.aps.org/doi/10.1103/PhysRevB.61.5147
- [4]
J. Schött, I. L. M. Locht, E. Lundin, O. Grånäs, O. Eriksson, I. Di Marco, Analytic continuation by averaging padé approximants, Phys. Rev. B 93 (2016) 075104.
doi:10.1103/PhysRevB.93.075104.
URL https://link.aps.org/doi/10.1103/PhysRevB.93.075104
- [5]
R. Bryan, Maximum entropy image reconstruction - general algorithm, Eur Biophys J 18 (1990) 165.
URL https://doi.org/10.1007/BF02427376
- [6]
M. Jarrell, J. Gubernatis, Bayesian inference and the analytic continuation of imaginary-time quantum monte carlo data, Physics Reports 269 (3) (1996) 133 – 195.
doi:https://doi.org/10.1016/0370-1573(95)00074-7.
URL http://www.sciencedirect.com/science/article/pii/0370157395000747
- [7]
O. Gunnarsson, M. W. Haverkort, G. Sangiovanni, Analytical continuation of imaginary axis data using maximum entropy, Phys. Rev. B 81 (2010) 155107.
doi:10.1103/PhysRevB.81.155107.
URL https://link.aps.org/doi/10.1103/PhysRevB.81.155107
- [8]
A. W. Sandvik, Stochastic method for analytic continuation of quantum monte carlo data, Phys. Rev. B 57 (1998) 10287–10290.
doi:10.1103/PhysRevB.57.10287.
URL https://link.aps.org/doi/10.1103/PhysRevB.57.10287
- [9]
S. Fuchs, T. Pruschke, M. Jarrell, Analytic continuation of quantum monte carlo data by stochastic analytical inference, Phys. Rev. E 81 (2010) 056701.
doi:10.1103/PhysRevE.81.056701.
URL https://link.aps.org/doi/10.1103/PhysRevE.81.056701
- [10]
A. W. Sandvik, Constrained sampling method for analytic continuation, Phys. Rev. E 94 (2016) 063308.
doi:10.1103/PhysRevE.94.063308.
URL https://link.aps.org/doi/10.1103/PhysRevE.94.063308
- [11]
H. Yoon, J.-H. Sim, M. J. Han, Analytic continuation via domain knowledge free machine learning, Phys. Rev. B 98 (2018) 245101.
doi:10.1103/PhysRevB.98.245101.
URL https://link.aps.org/doi/10.1103/PhysRevB.98.245101
- [12]
J. Otsuki, M. Ohzeki, H. Shinaoka, K. Yoshimi, Sparse modeling approach to analytical continuation of imaginary-time quantum monte carlo data, Phys. Rev. E 95 (2017) 061302.
doi:10.1103/PhysRevE.95.061302.
URL https://link.aps.org/doi/10.1103/PhysRevE.95.061302
- [13]
URL https://github.com/SpM-lab/SpM.
- [14]
S. Boyd, N. Parikh, E. Chu, B. Peleato, J. Eckstein, Distributed optimization and statistical learning via the alternating direction method of multipliers, Found. Trends Mach. Learn. 3 (1) (2011) 1–122.
URL http://dx.doi.org/10.1561/2200000016
- [15]
R. Tibshirani, Regression shrinkage and selection via the lasso, Journal of the Royal Statistical Society. Series B (Methodological) 58 (1) (1996) 267–288.
URL http://www.jstor.org/stable/2346178
- [16]
A. Reymbaut, D. Bergeron, A.-M. S. Tremblay, Maximum entropy analytic continuation for spectral functions with nonpositive spectral weight, Phys. Rev. B 92 (2015) 060509.
doi:10.1103/PhysRevB.92.060509.
URL https://link.aps.org/doi/10.1103/PhysRevB.92.060509
- [17]
J.-H. Sim, M. J. Han, Maximum quantum entropy method, Phys. Rev. B 98 (2018) 205102.
doi:10.1103/PhysRevB.98.205102.
URL https://link.aps.org/doi/10.1103/PhysRevB.98.205102
- [18]
A. Decelle, F. Ricci-Tersenghi, Pseudolikelihood decimation algorithm improving the inference of the interaction network in a general class of ising models, Phys. Rev. Lett. 112 (2014) 070603.
doi:10.1103/PhysRevLett.112.070603.
URL https://link.aps.org/doi/10.1103/PhysRevLett.112.070603
- [19]
S. Yamanaka, M. Ohzeki, A. Decelle, Detection of cheating by decimation algorithm, Journal of the Physical Society of Japan 84 (2) (2015) 024801.
arXiv:https://doi.org/10.7566/JPSJ.84.024801, doi:10.7566/JPSJ.84.024801.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] G. D. Mahan, Many-Particle Physics, Springer US, 2000.
- 2[2] J. Gubernatis, N. Kawashima, P. Werner, Quantum Monte Carlo Methods: Algorithms for Lattice Models, Cambridge University Press, 2016. doi:10.1017/CBO 9780511902581 . · doi ↗
- 3[3] K. S. D. Beach, R. J. Gooding, F. Marsiglio, Reliable padé analytical continuation method based on a high-accuracy symbolic computation algorithm , Phys. Rev. B 61 (2000) 5147–5157. doi:10.1103/Phys Rev B.61.5147 . URL https://link.aps.org/doi/10.1103/Phys Rev B.61.5147 · doi ↗
- 4[4] J. Schött, I. L. M. Locht, E. Lundin, O. Grånäs, O. Eriksson, I. Di Marco, Analytic continuation by averaging padé approximants , Phys. Rev. B 93 (2016) 075104. doi:10.1103/Phys Rev B.93.075104 . URL https://link.aps.org/doi/10.1103/Phys Rev B.93.075104 · doi ↗
- 5[5] R. Bryan, Maximum entropy image reconstruction - general algorithm , Eur Biophys J 18 (1990) 165. URL https://doi.org/10.1007/BF 02427376 · doi ↗
- 6[6] M. Jarrell, J. Gubernatis, Bayesian inference and the analytic continuation of imaginary-time quantum monte carlo data , Physics Reports 269 (3) (1996) 133 – 195. doi:https://doi.org/10.1016/0370-1573(95)00074-7 . URL http://www.sciencedirect.com/science/article/pii/0370157395000747 · doi ↗
- 7[7] O. Gunnarsson, M. W. Haverkort, G. Sangiovanni, Analytical continuation of imaginary axis data using maximum entropy , Phys. Rev. B 81 (2010) 155107. doi:10.1103/Phys Rev B.81.155107 . URL https://link.aps.org/doi/10.1103/Phys Rev B.81.155107 · doi ↗
- 8[8] A. W. Sandvik, Stochastic method for analytic continuation of quantum monte carlo data , Phys. Rev. B 57 (1998) 10287–10290. doi:10.1103/Phys Rev B.57.10287 . URL https://link.aps.org/doi/10.1103/Phys Rev B.57.10287 · doi ↗
