mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 11:33:42 +02:00
feat: Deprecation warning for Corr.GEVP kwarg state removed,
documentation extended.
This commit is contained in:
parent
98ce553521
commit
088a7da7e6
2 changed files with 10 additions and 5 deletions
|
@ -245,7 +245,11 @@ class Corr:
|
||||||
r'''Solve the generalized eigenvalue problem on the correlator matrix and returns the corresponding eigenvectors.
|
r'''Solve the generalized eigenvalue problem on the correlator matrix and returns the corresponding eigenvectors.
|
||||||
|
|
||||||
The eigenvectors are sorted according to the descending eigenvalues, the zeroth eigenvector(s) correspond to the
|
The eigenvectors are sorted according to the descending eigenvalues, the zeroth eigenvector(s) correspond to the
|
||||||
largest eigenvalue(s).
|
largest eigenvalue(s). The eigenvector(s) for the individual states can be accessed via slicing
|
||||||
|
```python
|
||||||
|
C.GEVP(t0=2)[0] # Ground state vector(s)
|
||||||
|
C.GEVP(t0=2)[:3] # Vectors for the lowest three states
|
||||||
|
```
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
|
@ -259,6 +263,11 @@ class Corr:
|
||||||
- "Eigenvalue": The eigenvector is chosen according to which eigenvalue it belongs individually on every timeslice.
|
- "Eigenvalue": The eigenvector is chosen according to which eigenvalue it belongs individually on every timeslice.
|
||||||
- "Eigenvector": Use the method described in arXiv:2004.10472 to find the set of v(t) belonging to the state.
|
- "Eigenvector": Use the method described in arXiv:2004.10472 to find the set of v(t) belonging to the state.
|
||||||
The reference state is identified by its eigenvalue at $t=t_s$.
|
The reference state is identified by its eigenvalue at $t=t_s$.
|
||||||
|
|
||||||
|
Other Parameters
|
||||||
|
----------------
|
||||||
|
state : int
|
||||||
|
Returns only the vector(s) for a specified state. The lowest state is zero.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
if self.N == 1:
|
if self.N == 1:
|
||||||
|
@ -310,7 +319,6 @@ class Corr:
|
||||||
raise Exception("Unkown value for 'sort'.")
|
raise Exception("Unkown value for 'sort'.")
|
||||||
|
|
||||||
if "state" in kwargs:
|
if "state" in kwargs:
|
||||||
warnings.warn("Argument 'state' is deprecated, use slicing instead.", DeprecationWarning)
|
|
||||||
return reordered_vecs[kwargs.get("state")]
|
return reordered_vecs[kwargs.get("state")]
|
||||||
else:
|
else:
|
||||||
return reordered_vecs
|
return reordered_vecs
|
||||||
|
|
|
@ -256,9 +256,6 @@ def test_GEVP_warnings():
|
||||||
with pytest.warns(DeprecationWarning):
|
with pytest.warns(DeprecationWarning):
|
||||||
corr_mat.GEVP(0, sorted_list="Eigenvalue")
|
corr_mat.GEVP(0, sorted_list="Eigenvalue")
|
||||||
|
|
||||||
with pytest.warns(DeprecationWarning):
|
|
||||||
corr_mat.GEVP(0, state=0)
|
|
||||||
|
|
||||||
def test_GEVP_exceptions():
|
def test_GEVP_exceptions():
|
||||||
corr_aa = _gen_corr(1)
|
corr_aa = _gen_corr(1)
|
||||||
corr_ab = 0.5 * corr_aa
|
corr_ab = 0.5 * corr_aa
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue