From d4b2a65cf3b060308f137577efd0ca6da61a7c65 Mon Sep 17 00:00:00 2001 From: Markus Wallerberger Date: Tue, 18 Jan 2022 11:50:02 +0100 Subject: [PATCH] Rename irbasis3 to sparse-ir We rename this for three reasons: one is consistency with he Julia package SparseIR, two is that irbasis3 is not a very good name if we want to break backwards compatibility once more, three irbasis is a bit redundant :) --- .github/workflows/pytest.yml | 2 +- README.md | 17 +++++++------ doc/conf.py | 6 ++--- doc/hacking.md | 4 +-- doc/kernels.md | 28 ++++++++++----------- doc/porting.md | 14 +++++------ doc/sampling.md | 8 +++--- setup.py | 14 +++++------ src/{irbasis3 => sparse_ir}/__init__.py | 9 ++++--- src/{irbasis3 => sparse_ir}/_roots.py | 0 src/{irbasis3 => sparse_ir}/adapter.py | 2 +- src/{irbasis3 => sparse_ir}/augmentation.py | 0 src/{irbasis3 => sparse_ir}/basis.py | 12 ++++----- src/{irbasis3 => sparse_ir}/composite.py | 0 src/{irbasis3 => sparse_ir}/gauss.py | 0 src/{irbasis3 => sparse_ir}/kernel.py | 0 src/{irbasis3 => sparse_ir}/poly.py | 0 src/{irbasis3 => sparse_ir}/sampling.py | 0 src/{irbasis3 => sparse_ir}/svd.py | 0 src/{irbasis3 => sparse_ir}/sve.py | 0 test/test_augmentation.py | 8 +++--- test/test_compare.py | 2 +- test/test_composite.py | 28 ++++++++++----------- test/test_gauss.py | 2 +- test/test_kernel.py | 4 +-- test/test_matsubara.py | 4 +-- test/test_poly.py | 6 ++--- test/test_sampling.py | 16 ++++++------ test/test_sve.py | 6 ++--- 29 files changed, 97 insertions(+), 95 deletions(-) rename src/{irbasis3 => sparse_ir}/__init__.py (71%) rename src/{irbasis3 => sparse_ir}/_roots.py (100%) rename src/{irbasis3 => sparse_ir}/adapter.py (98%) rename src/{irbasis3 => sparse_ir}/augmentation.py (100%) rename src/{irbasis3 => sparse_ir}/basis.py (97%) rename src/{irbasis3 => sparse_ir}/composite.py (100%) rename src/{irbasis3 => sparse_ir}/gauss.py (100%) rename src/{irbasis3 => sparse_ir}/kernel.py (100%) rename src/{irbasis3 => sparse_ir}/poly.py (100%) rename src/{irbasis3 => sparse_ir}/sampling.py (100%) rename src/{irbasis3 => sparse_ir}/svd.py (100%) rename src/{irbasis3 => sparse_ir}/sve.py (100%) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index bf4447e..23ddc45 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -1,4 +1,4 @@ -name: irbasis3 python package +name: sparse_ir python package on: [push] diff --git a/README.md b/README.md index 3ee262b..028fa85 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -irbasis3 - A library for the intermediate representation of propagators +sparse-ir - A library for the intermediate representation of propagators ======================================================================= This library provides routines for constructing and working with the intermediate representation of correlation functions. It provides: @@ -10,20 +10,21 @@ intermediate representation of correlation functions. It provides: Installation ------------ - pip install irbasis3 xprec + pip install sparse-ir[xprec] Though not strictly required, we strongly recommend installing the `xprec` -package alongside `irbasis3` as it allows to compute the IR basis functions -with greater accuracy. +package alongside `sparse-ir` as it allows to compute the IR basis functions +with greater accuracy. If you do not want to do this, simply remove `[xprec]` +from the above line. Quick start ----------- Here is some python code illustrating the API: # Compute IR basis for fermions and β = 10, W <= 4.2 - import irbasis3, numpy - K = irbasis3.KernelFFlat(lambda_=42) - basis = irbasis3.FiniteTempBasis(K, statistics='F', beta=10) + import sparse_ir, numpy + K = sparse_ir.KernelFFlat(lambda_=42) + basis = sparse_ir.FiniteTempBasis(K, statistics='F', beta=10) # Assume spectrum is a single pole at ω = 2.5, compute G(iw) # on the first few Matsubara frequencies. (Fermionic/bosonic Matsubara @@ -32,7 +33,7 @@ Here is some python code illustrating the API: giw = gl @ basis.uhat([1, 3, 5, 7]) # Reconstruct same coefficients from sparse sampling on the Matsubara axis: - smpl_iw = irbasis3.MatsubaraSampling(basis) + smpl_iw = sparse_ir.MatsubaraSampling(basis) giw = -1/(1j * numpy.pi/basis.beta * smpl_iw.wn - 2.5) gl_rec = smpl_iw.fit(giw) diff --git a/doc/conf.py b/doc/conf.py index 689cbf1..c809979 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -4,7 +4,7 @@ # === Project information -project = 'irbasis3' +project = 'sparse-ir' copyright = '2021, Markus Wallerberger and others' author = ', '.join([ 'Markus Wallerberger', @@ -14,8 +14,8 @@ 'Chikano Naoya', ]) -release = '3.0-alpha1' -version = '3.0-alpha1' +release = '0.2' +version = '0.2' # === General configuration diff --git a/doc/hacking.md b/doc/hacking.md index 2430c3f..bf30c7a 100644 --- a/doc/hacking.md +++ b/doc/hacking.md @@ -3,8 +3,8 @@ Hacking/Development For development, we recommend installing a "editable" version of the repository with unit test dependencies:: - git checkout git@github.com:SpM-lab/irbasis3 - cd irbasis3 + git checkout git@github.com:SpM-lab/sparse_ir + cd sparse_ir pip install -e .[test] Now the installed package automatically updates as you are working on the code. diff --git a/doc/kernels.md b/doc/kernels.md index 53e9311..a0b2c82 100644 --- a/doc/kernels.md +++ b/doc/kernels.md @@ -3,28 +3,28 @@ Kernels Defines integral kernels for the analytic continuation problem. Specifically, it defines two kernels: - - `irbasis3.KernelFFlat`: continuation of *fermionic* spectral functions. - - `irbasis3.KernelFFlat`: continuation of *bosonic* spectral functions. + - `sparse_ir.KernelFFlat`: continuation of *fermionic* spectral functions. + - `sparse_ir.KernelFFlat`: continuation of *bosonic* spectral functions. -These can be fed directly into `irbasis3.IRBasis` or `irbasis3.FiniteTempBasis` +These can be fed directly into `sparse_ir.IRBasis` or `sparse_ir.FiniteTempBasis` to get the intermediate representation. Predefined kernels ------------------ ```{eval-rst} -.. autoclass:: irbasis3.kernel.KernelFFlat +.. autoclass:: sparse_ir.kernel.KernelFFlat :members: :special-members: __call__ -.. autoclass:: irbasis3.kernel.KernelBFlat +.. autoclass:: sparse_ir.kernel.KernelBFlat :members: :special-members: __call__ ``` Custom kernels -------------- -Adding kernels to `irbasis3` is simple - at the very basic levle, the library +Adding kernels to `sparse_ir` is simple - at the very basic levle, the library expects a kernel `K` to be able to provide two things: 1. the values through `K(x, y)` @@ -35,13 +35,13 @@ axis instead of the default (flat) one. We create a new kernel by inheriting from `irbasis.kernel.KernelBase` and then simply wrap around a fermionic kernel, modifying the values as needed: - import irbasis3 - import irbasis3.kernel + import sparse_ir + import sparse_ir.kernel - class KernelFGauss(irbasis3.kernel.KernelBase): + class KernelFGauss(sparse_ir.kernel.KernelBase): def __init__(self, lambda_, std): super().__init__(self) - self._inner = irbasis3.KernelFFlat(lambda_) + self._inner = sparse_ir.KernelFFlat(lambda_) self.lambda_ = lambda_ self.std = std @@ -58,7 +58,7 @@ kernel, modifying the values as needed: You can feed this kernel now directly to `irbasis.IRBasis`: K = GaussFKernel(10., 1.) - basis = irbasis3.IRBasis(K, 'F') + basis = sparse_ir.IRBasis(K, 'F') print(basis.s) This should get you started. For a fully-fledged and robust implementation, @@ -82,14 +82,14 @@ Base classes ------------ ```{eval-rst} -.. autoclass:: irbasis3.kernel.KernelBase +.. autoclass:: sparse_ir.kernel.KernelBase :members: :special-members: __call__ -.. autoclass:: irbasis3.kernel.ReducedKernel +.. autoclass:: sparse_ir.kernel.ReducedKernel :members: :special-members: __call__ -.. autoclass:: irbasis3.kernel.SVEHints +.. autoclass:: sparse_ir.kernel.SVEHints :members: ``` diff --git a/doc/porting.md b/doc/porting.md index b89d917..33299af 100644 --- a/doc/porting.md +++ b/doc/porting.md @@ -1,11 +1,11 @@ Porting ======= -For porting codes from irbasis, version 2, to irbasis3, you have two options: +For porting codes from irbasis, version 2, to sparse_ir, you have two options: - * using the `irbasis3.adapter` module (easier) - * porting to the new `irbasis3` API (cleaner) + * using the `sparse_ir.adapter` module (easier) + * porting to the new `sparse_ir` API (cleaner) -In both cases, please note that `irbasis3` now computes the basis on-the-fly +In both cases, please note that `sparse_ir` now computes the basis on-the-fly rather than loading it from a file. This has some important consequences: * Singular values and basis functions may slightly differ from the old @@ -21,7 +21,7 @@ basis coefficients or store the sampling points together with the data. Adapter module -------------- -For ease of porting, we provide the `irbasis3.adapter` module. This module +For ease of porting, we provide the `sparse_ir.adapter` module. This module is API-compatible with the `irbasis` package, version 2. This means you simply have to replace:: @@ -29,11 +29,11 @@ simply have to replace:: with the following:: - import irbasis3.adapter as irbasis + import sparse_ir.adapter as irbasis and everything should work as expected. ```{eval-rst} -.. autoclass:: irbasis3.adapter.Basis +.. autoclass:: sparse_ir.adapter.Basis :members: ``` diff --git a/doc/sampling.md b/doc/sampling.md index e1b7c59..9c46b74 100644 --- a/doc/sampling.md +++ b/doc/sampling.md @@ -33,10 +33,10 @@ Sparse sampling transformers ---------------------------- ```{eval-rst} -.. autoclass:: irbasis3.sampling.TauSampling +.. autoclass:: sparse_ir.sampling.TauSampling :members: tau, evaluate, fit -.. autoclass:: irbasis3.sampling.MatsubaraSampling +.. autoclass:: sparse_ir.sampling.MatsubaraSampling :members: wn, evaluate, fit ``` @@ -44,9 +44,9 @@ Base classes ------------- ```{eval-rst} -.. autoclass:: irbasis3.sampling.SamplingBase +.. autoclass:: sparse_ir.sampling.SamplingBase :members: -.. autoclass:: irbasis3.sampling.DecomposedMatrix +.. autoclass:: sparse_ir.sampling.DecomposedMatrix :members: ``` diff --git a/setup.py b/setup.py index 3f24848..3234668 100644 --- a/setup.py +++ b/setup.py @@ -12,21 +12,21 @@ def readfile(*parts): return f.read() -def extract_varval(*parts, varname): +def extract_varval(varname): """Extract value of __version__ variable by parsing python script""" - initfile = readfile(*parts) - var_re = re.compile(r"(?m)^__" + varname + r"__\s*=\s*['\"]([^'\"]*)['\"]") + initfile = readfile('src', 'sparse_ir', '__init__.py') + var_re = re.compile(rf"(?m)^{varname}\s*=\s*['\"]([^'\"]*)['\"]") match = var_re.search(initfile) return match.group(1) -VERSION = extract_varval('src', 'irbasis3', '__init__.py', varname='version') -MIN_XPREC_VERSION = extract_varval('src', 'irbasis3', '__init__.py', varname='min_xprec_version') -REPO_URL = "https://github.com/SpM-lab/irbasis3" +REPO_URL = "https://github.com/SpM-lab/sparse-ir" +VERSION = extract_varval('__version__') +MIN_XPREC_VERSION = extract_varval('min_xprec_version') LONG_DESCRIPTION = readfile('README.md') setup( - name='irbasis3', + name='sparse-ir', version=VERSION, description= diff --git a/src/irbasis3/__init__.py b/src/sparse_ir/__init__.py similarity index 71% rename from src/irbasis3/__init__.py rename to src/sparse_ir/__init__.py index c5baa93..e5c27fe 100644 --- a/src/irbasis3/__init__.py +++ b/src/sparse_ir/__init__.py @@ -4,15 +4,16 @@ """ __copyright__ = "Copyright (C) 2020-2021 Markus Wallerberger and others" __license__ = "MIT" -__version__ = "3.0-alpha6" -__min_xprec_version__ = "1.1.1" +__version__ = "0.2" + +min_xprec_version = "1.0" try: import xprec as xprec from pkg_resources import parse_version from warnings import warn - if parse_version(xprec.__version__) < parse_version(__min_xprec_version__): - warn(f"xprec is too old! Please use xprec>={__min_xprec_version__}.") + if parse_version(xprec.__version__) < parse_version(min_xprec_version): + warn(f"xprec is too old! Please use xprec>={min_xprec_version}.") except ImportError: pass diff --git a/src/irbasis3/_roots.py b/src/sparse_ir/_roots.py similarity index 100% rename from src/irbasis3/_roots.py rename to src/sparse_ir/_roots.py diff --git a/src/irbasis3/adapter.py b/src/sparse_ir/adapter.py similarity index 98% rename from src/irbasis3/adapter.py rename to src/sparse_ir/adapter.py index 167768f..9d1f208 100644 --- a/src/irbasis3/adapter.py +++ b/src/sparse_ir/adapter.py @@ -5,7 +5,7 @@ This is designed to be a drop-in replacement for `irbasis`, where the basis can be computed on-the-fly for arbitrary values of Lambda. In other words, -you should be able to replace `irbasis` with `irbasis3.adapter` and +you should be able to replace `irbasis` with `sparse_ir.adapter` and everything should hopefully still work. Note however that on-the-fly computation typically has lower accuracy. Thus, diff --git a/src/irbasis3/augmentation.py b/src/sparse_ir/augmentation.py similarity index 100% rename from src/irbasis3/augmentation.py rename to src/sparse_ir/augmentation.py diff --git a/src/irbasis3/basis.py b/src/sparse_ir/basis.py similarity index 97% rename from src/irbasis3/basis.py rename to src/sparse_ir/basis.py index d16397e..99a43e6 100644 --- a/src/irbasis3/basis.py +++ b/src/sparse_ir/basis.py @@ -33,9 +33,9 @@ class IRBasis: at x = 0.2:: # Compute IR basis suitable for fermions and β*W <= 42 - import irbasis3 - K = irbasis3.KernelFFlat(lambda_=42) - basis = irbasis3.IRBasis(K, statistics='F') + import sparse_ir + K = sparse_ir.KernelFFlat(lambda_=42) + basis = sparse_ir.IRBasis(K, statistics='F') # Assume spectrum is a single pole at x = 0.2, compute G(iw) # on the first few Matsubara frequencies @@ -146,9 +146,9 @@ class FiniteTempBasis: at ω = 2.5:: # Compute IR basis for fermions and β = 10, W <= 4.2 - import irbasis3 - K = irbasis3.KernelFFlat(lambda_=42) - basis = irbasis3.FiniteTempBasis(K, statistics='F', beta=10) + import sparse_ir + K = sparse_ir.KernelFFlat(lambda_=42) + basis = sparse_ir.FiniteTempBasis(K, statistics='F', beta=10) # Assume spectrum is a single pole at ω = 2.5, compute G(iw) # on the first few Matsubara frequencies diff --git a/src/irbasis3/composite.py b/src/sparse_ir/composite.py similarity index 100% rename from src/irbasis3/composite.py rename to src/sparse_ir/composite.py diff --git a/src/irbasis3/gauss.py b/src/sparse_ir/gauss.py similarity index 100% rename from src/irbasis3/gauss.py rename to src/sparse_ir/gauss.py diff --git a/src/irbasis3/kernel.py b/src/sparse_ir/kernel.py similarity index 100% rename from src/irbasis3/kernel.py rename to src/sparse_ir/kernel.py diff --git a/src/irbasis3/poly.py b/src/sparse_ir/poly.py similarity index 100% rename from src/irbasis3/poly.py rename to src/sparse_ir/poly.py diff --git a/src/irbasis3/sampling.py b/src/sparse_ir/sampling.py similarity index 100% rename from src/irbasis3/sampling.py rename to src/sparse_ir/sampling.py diff --git a/src/irbasis3/svd.py b/src/sparse_ir/svd.py similarity index 100% rename from src/irbasis3/svd.py rename to src/sparse_ir/svd.py diff --git a/src/irbasis3/sve.py b/src/sparse_ir/sve.py similarity index 100% rename from src/irbasis3/sve.py rename to src/sparse_ir/sve.py diff --git a/test/test_augmentation.py b/test/test_augmentation.py index 5e89f5d..f823370 100644 --- a/test/test_augmentation.py +++ b/test/test_augmentation.py @@ -1,8 +1,8 @@ # Copyright (C) 2020-2021 Markus Wallerberger and others # SPDX-License-Identifier: MIT import numpy as np -import irbasis3 -from irbasis3 import augmentation +import sparse_ir +from sparse_ir import augmentation from scipy.special import eval_legendre, spherical_jn import pytest @@ -51,11 +51,11 @@ def test_legendre_basis(stat): # G(tau) = -e^{-tau*pole}/(1 + e^{-beta*pole}) [F] # = -e^{-tau*pole}/(1 - e^{-beta*pole}) [B] pole = 1.0 - tau_smpl = irbasis3.TauSampling(basis) + tau_smpl = sparse_ir.TauSampling(basis) gtau = -np.exp(-tau_smpl.sampling_points * pole)/(1 - sign * np.exp(-beta * pole)) gl_from_tau = tau_smpl.fit(gtau) - matsu_smpl = irbasis3.MatsubaraSampling(basis) + matsu_smpl = sparse_ir.MatsubaraSampling(basis) giv = 1/(1J*matsu_smpl.sampling_points*np.pi/beta - pole) gl_from_matsu = matsu_smpl.fit(giv) diff --git a/test/test_compare.py b/test/test_compare.py index beeb012..b979f8b 100644 --- a/test/test_compare.py +++ b/test/test_compare.py @@ -3,7 +3,7 @@ import numpy as np import pytest -from irbasis3 import adapter +from sparse_ir import adapter try: import irbasis diff --git a/test/test_composite.py b/test/test_composite.py index 7dce8d8..698d0a4 100644 --- a/test/test_composite.py +++ b/test/test_composite.py @@ -1,11 +1,11 @@ # Copyright (C) 2020-2021 Markus Wallerberger and others # SPDX-License-Identifier: MIT import numpy as np -import irbasis3 -from irbasis3 import sve -from irbasis3 import kernel -from irbasis3 import composite -from irbasis3 import augmentation +import sparse_ir +from sparse_ir import sve +from sparse_ir import kernel +from sparse_ir import composite +from sparse_ir import augmentation import pytest @@ -38,9 +38,9 @@ def test_composite_basis(): lambda_ = 99 beta = 10 wmax = lambda_/beta - K = irbasis3.KernelFFlat(lambda_) - basis = irbasis3.FiniteTempBasis(K, "F", beta, eps=1e-6) - basis2 = irbasis3.FiniteTempBasis(K, "F", beta, eps=1e-3) + K = sparse_ir.KernelFFlat(lambda_) + basis = sparse_ir.FiniteTempBasis(K, "F", beta, eps=1e-6) + basis2 = sparse_ir.FiniteTempBasis(K, "F", beta, eps=1e-3) basis_comp = composite.CompositeBasis([basis, basis2]) _check_composite_poly(basis_comp.u, [basis.u, basis2.u], np.linspace(0, beta, 10)) _check_composite_poly(basis_comp.uhat, [basis.uhat, basis2.uhat], np.array([1,3])) @@ -51,15 +51,15 @@ def test_augmented_bosonic_basis(): wmax = 2 beta = 1000 lambda_ = beta * wmax - K = irbasis3.KernelBFlat(lambda_) - basis = irbasis3.FiniteTempBasis(K, "B", beta, eps=1e-6) + K = sparse_ir.KernelBFlat(lambda_) + basis = sparse_ir.FiniteTempBasis(K, "B", beta, eps=1e-6) basis_legg = augmentation.LegendreBasis("B", beta, 2) basis_comp = composite.CompositeBasis([basis_legg, basis]) # G(tau) = c - e^{-tau*pole}/(1 - e^{-beta*pole}) pole = 1.0 c = 1e-2 - tau_smpl = irbasis3.TauSampling(basis_comp) + tau_smpl = sparse_ir.TauSampling(basis_comp) gtau = c - np.exp(-tau_smpl.sampling_points * pole)/(1 - np.exp(-beta * pole)) gl_from_tau = tau_smpl.fit(gtau) @@ -73,8 +73,8 @@ def test_vertex_basis(stat): wmax = 2 beta = 1000 lambda_ = beta * wmax - K = irbasis3.KernelBFlat(lambda_) - basis = irbasis3.FiniteTempBasis(K, stat, beta, eps=1e-6) + K = sparse_ir.KernelBFlat(lambda_) + basis = sparse_ir.FiniteTempBasis(K, stat, beta, eps=1e-6) basis_const = augmentation.MatsubaraConstBasis(stat, beta) basis_comp = composite.CompositeBasis([basis_const, basis]) assert basis_comp.uhat is not None @@ -82,7 +82,7 @@ def test_vertex_basis(stat): # G(iv) = c + 1/(iv-pole) pole = 1.0 c = 1.0 - matsu_smpl = irbasis3.MatsubaraSampling(basis_comp) + matsu_smpl = sparse_ir.MatsubaraSampling(basis_comp) giv = c + 1/(1J*matsu_smpl.sampling_points * np.pi/beta - pole) gl = matsu_smpl.fit(giv) diff --git a/test/test_gauss.py b/test/test_gauss.py index 0448a03..cc0d400 100644 --- a/test/test_gauss.py +++ b/test/test_gauss.py @@ -3,7 +3,7 @@ import numpy as np import numpy.polynomial.legendre as np_legendre -from irbasis3 import gauss +from sparse_ir import gauss def test_collocate(): diff --git a/test/test_kernel.py b/test/test_kernel.py index 1983132..8594bbc 100644 --- a/test/test_kernel.py +++ b/test/test_kernel.py @@ -3,8 +3,8 @@ import numpy as np import pytest -from irbasis3 import kernel -from irbasis3 import gauss +from sparse_ir import kernel +from sparse_ir import gauss KERNELS = [ kernel.KernelFFlat(9), diff --git a/test/test_matsubara.py b/test/test_matsubara.py index 8acfa56..ccb49d1 100644 --- a/test/test_matsubara.py +++ b/test/test_matsubara.py @@ -4,8 +4,8 @@ import pytest import importlib -from irbasis3.basis import FiniteTempBasis -from irbasis3.kernel import KernelFFlat, KernelBFlat +from sparse_ir.basis import FiniteTempBasis +from sparse_ir.kernel import KernelFFlat, KernelBFlat eps = None if importlib.util.find_spec("xprec") is not None: diff --git a/test/test_poly.py b/test/test_poly.py index 47b83a5..eeec2e9 100644 --- a/test/test_poly.py +++ b/test/test_poly.py @@ -2,9 +2,9 @@ # SPDX-License-Identifier: MIT from _pytest.mark import param import numpy as np -from irbasis3 import sve -from irbasis3 import kernel -from irbasis3 import poly +from sparse_ir import sve +from sparse_ir import kernel +from sparse_ir import poly import pytest diff --git a/test/test_sampling.py b/test/test_sampling.py index dcc651b..42e7e29 100644 --- a/test/test_sampling.py +++ b/test/test_sampling.py @@ -2,8 +2,8 @@ # SPDX-License-Identifier: MIT import numpy as np -import irbasis3 -from irbasis3 import sampling +import sparse_ir +from sparse_ir import sampling def test_decomp(): @@ -61,9 +61,9 @@ def test_axis0(): def test_tau_noise(): - K = irbasis3.KernelFFlat(100) - basis = irbasis3.IRBasis(K, 'F') - smpl = irbasis3.TauSampling(basis) + K = sparse_ir.KernelFFlat(100) + basis = sparse_ir.IRBasis(K, 'F') + smpl = sparse_ir.TauSampling(basis) rng = np.random.RandomState(4711) rhol = basis.v([-.999, -.01, .5]) @ [0.8, -.2, 0.5] @@ -79,9 +79,9 @@ def test_tau_noise(): def test_wn_noise(): - K = irbasis3.KernelBFlat(99) - basis = irbasis3.IRBasis(K, 'B') - smpl = irbasis3.MatsubaraSampling(basis) + K = sparse_ir.KernelBFlat(99) + basis = sparse_ir.IRBasis(K, 'B') + smpl = sparse_ir.MatsubaraSampling(basis) rng = np.random.RandomState(4711) rhol = basis.v([-.999, -.01, .5]) @ [0.8, -.2, 0.5] diff --git a/test/test_sve.py b/test/test_sve.py index d9d9646..afae305 100644 --- a/test/test_sve.py +++ b/test/test_sve.py @@ -1,7 +1,7 @@ # Copyright (C) 2020-2021 Markus Wallerberger and others # SPDX-License-Identifier: MIT import numpy as np -import irbasis3 +import sparse_ir import pytest @@ -14,8 +14,8 @@ @pytest.fixture(scope="module") def bases(): def _make_basis(stat, lambda_): - K = {'F': irbasis3.KernelFFlat, 'B': irbasis3.KernelBFlat}[stat](lambda_) - return irbasis3.IRBasis(K, stat) + K = {'F': sparse_ir.KernelFFlat, 'B': sparse_ir.KernelBFlat}[stat](lambda_) + return sparse_ir.IRBasis(K, stat) return {p: _make_basis(*p) for p in BASES}