sparse-ir 1.1.2__tar.gz → 1.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. {sparse-ir-1.1.2/src/sparse_ir.egg-info → sparse-ir-1.1.3}/PKG-INFO +1 -5
  2. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir/__init__.py +2 -2
  3. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir/basis.py +10 -0
  4. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir/basis_set.py +12 -0
  5. {sparse-ir-1.1.2 → sparse-ir-1.1.3/src/sparse_ir.egg-info}/PKG-INFO +1 -5
  6. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/test/test_sve.py +8 -4
  7. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/LICENSE.txt +0 -0
  8. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/README.rst +0 -0
  9. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/setup.cfg +0 -0
  10. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/setup.py +0 -0
  11. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir/_gauss.py +0 -0
  12. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir/_roots.py +0 -0
  13. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir/_util.py +0 -0
  14. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir/abstract.py +0 -0
  15. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir/adapter.py +0 -0
  16. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir/augment.py +0 -0
  17. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir/dlr.py +0 -0
  18. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir/kernel.py +0 -0
  19. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir/poly.py +0 -0
  20. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir/sampling.py +0 -0
  21. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir/svd.py +0 -0
  22. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir/sve.py +0 -0
  23. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir.egg-info/SOURCES.txt +0 -0
  24. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir.egg-info/dependency_links.txt +0 -0
  25. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir.egg-info/requires.txt +0 -0
  26. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/src/sparse_ir.egg-info/top_level.txt +0 -0
  27. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/test/test_augment.py +0 -0
  28. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/test/test_basis_set.py +0 -0
  29. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/test/test_compare.py +0 -0
  30. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/test/test_dlr.py +0 -0
  31. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/test/test_gauss.py +0 -0
  32. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/test/test_kernel.py +0 -0
  33. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/test/test_poly.py +0 -0
  34. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/test/test_sampling.py +0 -0
  35. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/test/test_scipost_sample_code.py +0 -0
  36. {sparse-ir-1.1.2 → sparse-ir-1.1.3}/test/test_whitespace.py +0 -0
@@ -1,13 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sparse-ir
3
- Version: 1.1.2
3
+ Version: 1.1.3
4
4
  Summary: intermediate representation (IR) basis for electronic propagator
5
5
  Home-page: https://github.com/SpM-lab/sparse-ir
6
6
  Author: ['Markus Wallerberger', 'Hiroshi Shinaoka', 'Kazuyoshi Yoshimi', 'Junya Otsuki', 'Chikano Naoya']
7
7
  Author-email: markus.wallerberger@tuwien.ac.at
8
- License: UNKNOWN
9
8
  Keywords: irbasis many-body propagator svd
10
- Platform: UNKNOWN
11
9
  Classifier: Development Status :: 5 - Production/Stable
12
10
  Classifier: Intended Audience :: Developers
13
11
  Classifier: Intended Audience :: Science/Research
@@ -146,5 +144,3 @@ MINIMAX isometry method (Merzuk Kaltak and Georg Kresse,
146
144
  .. _Phys. Rev. B 101, 035144: https://doi.org/10.1103/PhysRevB.101.035144
147
145
  .. _SoftwareX 21, 101266: https://doi.org/10.1016/j.softx.2022.101266
148
146
  .. _Phys. Rev. B 101, 205145: https://doi.org/10.1103/PhysRevB.101.205145
149
-
150
-
@@ -10,9 +10,9 @@ intermediate representation of correlation functions. It provides:
10
10
  - basis functions and singular values are accurate to full precision
11
11
  - routines for sparse sampling
12
12
  """
13
- __copyright__ = "2020-2024 Markus Wallerberger, Hiroshi Shinaoka, and others"
13
+ __copyright__ = "2020-2025 Markus Wallerberger, Hiroshi Shinaoka, and others"
14
14
  __license__ = "MIT"
15
- __version__ = "1.1.2"
15
+ __version__ = "1.1.3"
16
16
 
17
17
  from .kernel import RegularizedBoseKernel, LogisticKernel
18
18
  from .sve import compute as compute_sve, SVEResult
@@ -56,6 +56,16 @@ class FiniteTempBasis(abstract.AbstractBasis):
56
56
  self._kernel = _get_kernel(statistics, beta * wmax, kernel)
57
57
  if sve_result is None:
58
58
  sve_result = sve.compute(self._kernel, eps)
59
+ else:
60
+ # Sanity check of provided sve_result
61
+ # TODO: check for the kernel type/name or eps?
62
+ new_kernel_lambda = self._kernel.lambda_
63
+ sve_kernel_lambda = sve_result.K.lambda_
64
+ if not np.allclose(new_kernel_lambda, sve_kernel_lambda,
65
+ atol=1e-12, rtol=4e-16):
66
+ raise ValueError("Kernel mismatch:\n"
67
+ "provided SVE result is incompatible with "
68
+ "kernel parameters (lambda_ == beta*wmax)")
59
69
 
60
70
  self._sve_result = sve_result
61
71
  self._statistics = statistics
@@ -87,3 +87,15 @@ class FiniteTempBasisSet:
87
87
  def wn_b(self):
88
88
  """Sampling bosonic frequencies"""
89
89
  return self.smpl_wn_b.sampling_points
90
+
91
+ def rescale(self, new_beta):
92
+ """Return a basis set for a different temperature.
93
+
94
+ Uses the same kernel with the same ``eps``, but a different
95
+ temperature. Note that this implies a different UV cutoff ``wmax``,
96
+ since ``lambda_ == beta * wmax`` stays constant.
97
+ """
98
+ new_wmax = self.basis_f.lambda_ / new_beta
99
+ return FiniteTempBasisSet(new_beta, new_wmax,
100
+ eps=self.basis_f.sve_result.eps,
101
+ sve_result=self.basis_f.sve_result)
@@ -1,13 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sparse-ir
3
- Version: 1.1.2
3
+ Version: 1.1.3
4
4
  Summary: intermediate representation (IR) basis for electronic propagator
5
5
  Home-page: https://github.com/SpM-lab/sparse-ir
6
6
  Author: ['Markus Wallerberger', 'Hiroshi Shinaoka', 'Kazuyoshi Yoshimi', 'Junya Otsuki', 'Chikano Naoya']
7
7
  Author-email: markus.wallerberger@tuwien.ac.at
8
- License: UNKNOWN
9
8
  Keywords: irbasis many-body propagator svd
10
- Platform: UNKNOWN
11
9
  Classifier: Development Status :: 5 - Production/Stable
12
10
  Classifier: Intended Audience :: Developers
13
11
  Classifier: Intended Audience :: Science/Research
@@ -146,5 +144,3 @@ MINIMAX isometry method (Merzuk Kaltak and Georg Kresse,
146
144
  .. _Phys. Rev. B 101, 035144: https://doi.org/10.1103/PhysRevB.101.035144
147
145
  .. _SoftwareX 21, 101266: https://doi.org/10.1016/j.softx.2022.101266
148
146
  .. _Phys. Rev. B 101, 205145: https://doi.org/10.1103/PhysRevB.101.205145
149
-
150
-
@@ -25,7 +25,8 @@ def _check_smooth(u, s, uscale, fudge_factor):
25
25
 
26
26
  @pytest.mark.parametrize("lambda_", [10, 42, 10_000])
27
27
  def test_smooth(sve_logistic, lambda_):
28
- basis = sparse_ir.FiniteTempBasis('F', 1, lambda_,
28
+ beta = 1
29
+ basis = sparse_ir.FiniteTempBasis('F', beta, lambda_/beta,
29
30
  sve_result=sve_logistic[lambda_])
30
31
  _check_smooth(basis.u, basis.s, 2*basis.u(1).max(), 24)
31
32
  _check_smooth(basis.v, basis.s, 50, 20)
@@ -33,7 +34,8 @@ def test_smooth(sve_logistic, lambda_):
33
34
 
34
35
  @pytest.mark.parametrize("lambda_", [10, 42, 10_000])
35
36
  def test_num_roots_u(sve_logistic, lambda_):
36
- basis = sparse_ir.FiniteTempBasis('F', 1, lambda_,
37
+ beta = 1
38
+ basis = sparse_ir.FiniteTempBasis('F', beta, lambda_/beta,
37
39
  sve_result=sve_logistic[lambda_])
38
40
  for i in range(basis.u.size):
39
41
  ui_roots = basis.u[i].roots()
@@ -43,7 +45,8 @@ def test_num_roots_u(sve_logistic, lambda_):
43
45
  @pytest.mark.parametrize("stat", ['F', 'B'])
44
46
  @pytest.mark.parametrize("lambda_", [10, 42, 10_000])
45
47
  def test_num_roots_uhat(sve_logistic, stat, lambda_):
46
- basis = sparse_ir.FiniteTempBasis(stat, 1, lambda_,
48
+ beta = 1
49
+ basis = sparse_ir.FiniteTempBasis(stat, beta, lambda_/beta,
47
50
  sve_result=sve_logistic[lambda_])
48
51
  for i in [0, 1, 7, 10]:
49
52
  x0 = basis.uhat[i].extrema()
@@ -53,7 +56,8 @@ def test_num_roots_uhat(sve_logistic, stat, lambda_):
53
56
  @pytest.mark.parametrize("stat", ['F', 'B'])
54
57
  @pytest.mark.parametrize("lambda_", [10, 42, 10_000])
55
58
  def test_accuracy(sve_logistic, stat, lambda_):
56
- basis = sparse_ir.FiniteTempBasis(stat, 4, lambda_,
59
+ beta = 4
60
+ basis = sparse_ir.FiniteTempBasis(stat, beta, lambda_/beta,
57
61
  sve_result=sve_logistic[lambda_])
58
62
 
59
63
  assert 0 < basis.accuracy <= basis.significance[-1]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes