Commit graph

192 commits

Author SHA1 Message Date
Fabian Joswig
336117c1cf [Fix] More type hint fixing 2025-01-05 17:12:50 +01:00
Fabian Joswig
1c6053ef61 [Fix] Simplify type hints 2025-01-03 22:43:19 +01:00
Fabian Joswig
1916de15ec [Fix] Start fixing remaining type hints 2025-01-03 19:01:20 +01:00
Fabian Joswig
2d34b355ed [Fix] Fix ruff errors and a few type annotations 2024-12-25 11:44:24 +01:00
Fabian Joswig
3db8eb2989 [Feat] Add type hints to pyerrors modules 2024-12-25 11:09:58 +01:00
Fabian Joswig
3eac9214b4
[Fix] Ruff rules and more precise Excpetion types (#248)
* [Fix] Fix test for membership should be 'not in' (E713)

* [Fix] Fix module imported but unused (F401)

* [Fix] More precise Exception types in dirac, obs and correlator
2024-12-24 15:35:59 +01:00
Justus Kuhlmann
b1448a2703
Fix plateaus in correlator (#247) 2024-12-05 22:08:48 +01:00
JanNeuendorf
e1a4d0c218
Additional GEVP method with errors (#195)
* Added the function error_gevp() to compute the gevp with statistical errors.

* Changed method name from error_gevp to error_GEVP and removed automatic gamma method

* added auto_gamma to error_GEVP

* Specified exceptions in Corr.error_GEVP

* Fixed a wrong path. It should be np.linalg.LinAlgError

* Added a test for error_GEVP

* The tests of error_gevp loads a test matrix

* Incorporated eigenvectors with uncertainties in GEVP routine

* Cleaned up GEVP routines

* Cleaned up breaking change from merge

* Released tolerance in test of GEVP

* Repaired broken GEVP test

---------

Co-authored-by: Simon Kuberski <simon.kuberski@uni-muenster.de>
2023-11-17 18:57:18 +01:00
Fabian Joswig
7f8c2ce33b
feat: added support for addition and multiplication of complex numbers (#209)
to Corr objects.
2023-07-21 14:15:41 +01:00
Fabian Joswig
af28f77ec5
__eq__ method for Corr class (#206)
* feat: implemented __eq__ method for Corr class.

* feat: __eq__ method now respects None entries in correlators.

* feat: Obs can now be compared to None, __ne__ method removed as it is
not required.

* feat: Corr.__eq__ rewritten to give a per element comparison.

* tests: additional test case for correlator comparison added.

* feat: comparison now also works for padding.
2023-07-19 15:06:19 +01:00
Fabian Joswig
66d5f8be24
Corr array initialization generalized (#203)
* feat: corr array initialization generalized.

* feat: additional checks for three-dimensional arrays added.

* docs: Corr docstring improved.

* docs: typos corrected.

* docs: details about None padding added to Corr docstring.
2023-07-18 12:07:46 +01:00
Fabian Joswig
f1150f09c8
Matmul overloaded for correlator class. (#199)
* feat: matmul method added to correlator class.

* feat: corr, corr matmul and correlator matrix trace added.

* tests: tests for matmul and trace added.

* tests: slightly reduced tolerance and good guess bad guess test.

* feat: rmatmul added and __array_priority__ set.

* tests: additional tests for rmatmul added.

* tests: one more tests for rmatmul added.

* docs: docstring added to Corr.trace.

* tests: associative property test added for complex Corr matmul.

* fix: Corr.roll method now also works for correlator matrices by
explicitly specifying the axis.

Co-authored-by: Matteo Di Carlo <matteo.dicarlo93@gmail.com>

* feat: exception type for correlator trace of 1dim correlator changed.

* tests: trace N=1 exception tested.

---------

Co-authored-by: Matteo Di Carlo <matteo.dicarlo93@gmail.com>
2023-07-17 11:48:57 +01:00
Fabian Joswig
8736d1cd3c
feat: CObs format added and complex Corr print improved. (#200) 2023-07-14 13:38:21 +01:00
Justus Kuhlmann
94b0322f0b
new variant of second derivative, bigger stencil (#197)
* new variant of second derivative, bigger stencil

* better docstring dor second_deriv

* forgot to "r" in front of docstring

* flake8 compliance
2023-07-10 15:32:27 +01:00
Fabian Joswig
b75aa741a9
feat: color and zorder for prange indicator in Corr.show added. (#178) 2023-05-18 17:06:15 +01:00
nils-ht
2363b755dd
NHT changes plots combined fit (#166)
* NHT changes plots combined fit

* feat: Exception for illegal combination added and test fixed.

---------

Co-authored-by: Fabian Joswig <fabian.joswig@ed.ac.uk>
2023-03-17 13:52:07 +00:00
Fabian Joswig
dc7033e51f
refactor: _standard_fit method made redundant. (#154)
* refactor: _standard_fit method made redundant.

* fix: xs and yz in Corr.fit promoted to arrays.

* fix: x promoted to array in _combined_fit if input is just a list.

* feat: residual_plot and qqplot now work with combined fits with
dictionary inputs.

* tests: test for combined fit resplot and qqplot added.

* docs: docstring of fits.residual_plot extended.
2023-03-01 10:00:35 +00:00
Fabian Joswig
a33c0a205a
feat: added __slots__ to Corr class. (#155) 2023-02-27 10:23:02 +00:00
Fabian Joswig
88fd37b241
fix: Corr.symmetric can now deal with None entries. (#145) 2023-01-16 16:10:19 +00:00
Fabian Joswig
b9cdebd442
feat: gm alias for gamma_method also added to other classes. 2023-01-13 17:26:52 +00:00
Fabian Joswig
6343968404
fix: complex correlator fix extended to array valued complex
correlators.
2022-12-20 18:13:15 +01:00
Fabian Joswig
f39a70c5a8
fix: Corr.__repr__ also works for complex correlators. 2022-12-20 17:40:41 +01:00
Fabian Joswig
060c23571e
fix: real and imag attributes of complex correlator object fixed. 2022-12-20 17:35:30 +01:00
Fabian Joswig
c01d822ec8
refactor: unnecessary if clause in constructor of Corr class removed. 2022-12-20 17:09:35 +01:00
Fabian Joswig
23708694d6
fix: bug in Corr.spaghetti_plot fixed which appeared in connection with
the replica separator. Test adjusted.
2022-12-07 12:23:49 +00:00
Fabian Joswig
873627fd95
refactor: unnecessary brackets removed. 2022-11-30 16:54:12 +00:00
Fabian Joswig
7eebba8387
feat: construction of G0 in GEVP simplified and explicit check for
positive-semidefiniteness added.
2022-11-30 16:42:30 +00:00
Fabian Joswig
d7649834d5
refactor: GEVP matrix cast also simplified for unsorted case. 2022-11-30 16:39:12 +00:00
Fabian Joswig
42f1e6e7fb
refactor: matrix Obs to double cast simplified. 2022-11-30 16:36:51 +00:00
Simon Kuberski
9813f741f9 feat: added log-derivatives and symmetric effective mass 2022-10-19 16:08:31 +02:00
Fabian Joswig
cc50ab9ecf fix: bug in Corr.show comp option fixed. 2022-08-12 11:03:36 +01:00
Fabian Joswig
f1636310a1 style: New flake8 E275 errors fixed. 2022-08-01 16:53:12 +01:00
Fabian Joswig
1d2c41ae54 feat: further speed up of GEVP by skipping the call to matrix_symmetric
if matrix is already symmetric.
2022-07-19 12:49:32 +01:00
Fabian Joswig
821d36aea9 refactor: refactored check for symmetric correlator matrix into
matrix_symmetric.
2022-07-19 12:34:31 +01:00
Fabian Joswig
42f62380b4 feat: check for symmetric matrix added to GEVP for speed up, None case
treated correctly in is_matrix_symmetric.
2022-07-19 12:22:54 +01:00
Fabian Joswig
7d280b3e26 feat: faster check for object equivalence added to is_matrix_symmetric 2022-07-19 12:18:26 +01:00
Fabian Joswig
b56c4e7694 feat: method is_matrix_symmetric added. 2022-07-19 12:13:16 +01:00
Fabian Joswig
763c759ae0 fix: Corr.m_eff can now returns None entries if the correlator has a
sign flip. Before that the logarithm of a negative number was computed
and a warning was thrown.
2022-06-28 14:40:49 +01:00
Fabian Joswig
b047f12c12 feat: bbox_inches='tight' added to Corr.show savefig 2022-06-20 15:50:56 +01:00
Fabian Joswig
13b688c4b2 feat: title argument added to Corr.show 2022-06-20 14:39:41 +01:00
Fabian Joswig
abdeace107 fix: Modification of parameter with default in Corr.__repr__ fixed. 2022-06-15 14:05:41 +01:00
Fabian Joswig
d79aa2cf74 refactor: range in Corr.print and __repr__ renamed to print_range 2022-06-15 14:01:26 +01:00
Janneuendorf
e671d38a11 fix 2022-06-14 16:06:08 +02:00
Janneuendorf
bd6c0a223b Quick fix to corr.m_eff(). Zero values no longer produce errors but are handled as nones in m_eff(). 2022-06-14 15:49:20 +02:00
Fabian Joswig
d736c001dc fix: further checks for multi-dimensional correaltors and None entries
added to methods of Corr class.
2022-06-13 13:18:37 +01:00
Fabian Joswig
a323d60b79 fix: Exception added when symmetric or anti_symmetric are called on
multi-dimensional correlator.
2022-06-13 13:08:05 +01:00
Fabian Joswig
ed50240d29 fix: check for correlator None entries refactored and added to all
elementary operations. Tests added.
2022-06-13 12:59:54 +01:00
Fabian Joswig
5359a30b97 fix: Bug in Corr.projected fixed which appears in connection with arrays
of None as Corr entry.
2022-06-13 11:59:05 +01:00
Fabian Joswig
78f576a35e fix: Corr.matrix_symmetric now also works if entries of the correlators
are arrays with at least one None entry.
2022-06-09 16:47:13 +01:00
Fabian Joswig
ccb424a251 fix: hide_sigma in Corr.show now ignores the entry at 0 for the
estimation of the plot range.
2022-05-31 13:43:34 +01:00