Skip to content

Commit f4cc5fe

Browse files
MesoHOPS 1.6.1
# MesoHOPS 1.6.1 This commit upgrades MesoHOPS, adding a new trajectory checkpointing system, options for increased HopsStorage efficiency, overhauled initialization of Noise 2, quality-of-life improvements, and various fixes. ### Key improvements and features: 1. **Trajectory Checkpointing**: Checkpointing allows the user to save and load a trajectory as a .npz file with options to alter the noise going forward, greatly simplifying advanced sampling techniques. In a similar vein, the HopsSystem object may now be saved and loaded to hasten initialization. 2. **HopsStorage Step**: HopsStorage may now be set to save data from only selected time points, reducing the RAM costs of storing data. This is distinct from the save_slices method of HopsTrajectory, which conveniently saves the data of HopsStorage to disk and has options for slicing and compressing data to reduce hard disk costs. 3. **Noise2 Input Management**: Noise 2 (typically used for thermal noise and the time-dependent portion of the Hamiltonian) is now initialized with its own parameter dictionary and the user may choose whether to make it purely real. <ins>Noise 2 is no longer automatically multiplied by two and converted to its real portion by the equation-of-motion: scripts that used noise 2 in the past must be updated to account for this!</ins> 4. **Efficient Zero Noise**: When noise model “ZERO” is used, HopsNoise RAM usage no longer scales with system size or simulation time. 5. **DyadicSpectra Static Filter Input Structure**: Updated static filter input structure in DyadicSpectra to properly feed into HopsHierarchy. Checks were added in HopsHierarchy to ensure filters are properly defined for all modes. 6. **Pytest.Raises Standardization**: Unit tests checking for correct error messages no longer use try/except clauses and are now tested using pytest.raises 7. **Spectral Density Streamlining**: <ins>bcf_convert_sdl_to_exp has been deprecated</ins>, and bcf_convert_dl_to_exp_with_Matsubara has been renamed to bcf_convert_dl_to_exp. For treatment of underdamped modes, we recommend using bcf_convert_dl_ud_to_exp. 8. **Version Hash Metadata**: Current git commit hash can now be accessed and saved from HopsStorage, allowing users to store the commit hash at runtime. 9. **HopsDyadic Complex Handling**: Fixed an issue where the _M2_dyad_conversion method was restricting the matrix elements to be real in the case where the provided matrix is a dense array. These enhancements collectively improve the computational efficiency, maintainability, and convenience of MesoHOPS for current and future applications.
1 parent 5e44fd9 commit f4cc5fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+3816
-1192
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ dependencies = [
66
"scipy",
77
"numba",
88
"pytest",
9-
"pytest-level"
9+
"pytest-level",
10+
"pytest-cov"
1011
]
1112
requires-python = ">=3.12"
1213
authors = [

pytest.ini

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
[tool:pytest]
1+
[pytest]
22
testpaths = tests
33
python_files = test_*.py
44
python_classes = Test*
55
python_functions = test_*
6+
markers =
7+
order: enforce execution order of tests
68
addopts =
79
--verbose
10+
--level=1
811
--cov=mesohops
912
--cov-report=term-missing
1013
--cov-report=html
1114
--cov-report=xml
1215
--cov-fail-under=70
13-

src/mesohops/basis/hops_aux.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class AuxiliaryVector(Mapping):
3131
'_index', # Current index
3232
'__id_string', # Unique identifier string
3333
'__mode_digits', # Number of digits per mode
34-
'__kmax', # Maximum hierarchy depth
3534

3635
# --- Cached values ---
3736
'_sum', # Cached sum of vector elements

src/mesohops/basis/hops_basis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ def get_Z2_noise_sparse(self, z_step):
935935
if self.off_diagonal_couplings:
936936
# Get the noise associated with system-bath projection operators that
937937
# couple states in the current basis to a different state.
938-
noise_t = (np.conj(z_step[0]) - 2j * np.real(z_step[1]))[
938+
noise_t = (np.conj(z_step[0]) - 1j * z_step[1])[
939939
self.mode.list_rel_ind_off_diag_L2]
940940
# Get the noise memory drift associated with system-bath projection
941941
# operators that couple states in the current basis to a different state.

src/mesohops/basis/hops_fluxfilters.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,9 @@ def construct_filter_markov_up(self):
332332
filtered out) while False indicates otherwise
333333
(positioning is (mode, aux)).
334334
"""
335+
if len(self.mode.list_absindex_mode) == 0:
336+
return True
337+
335338
M2_mark_filtered_modes = np.array(
336339
[
337340
np.array([param[m] for m in self.mode.list_absindex_mode])
@@ -389,6 +392,9 @@ def construct_filter_triangular_up(self):
389392
filtered out) while False indicates otherwise
390393
(positioning is (mode, aux)).
391394
"""
395+
if len(self.mode.list_absindex_mode) == 0:
396+
return True
397+
392398
M2_tri_filtered_modes = np.array(
393399
[
394400
np.array([param[0][m] for m in self.mode.list_absindex_mode])
@@ -442,6 +448,9 @@ def construct_filter_longedge_up(self):
442448
filtered out) while False indicates otherwise
443449
(positioning is (mode, aux)).
444450
"""
451+
if len(self.mode.list_absindex_mode) == 0:
452+
return True
453+
445454
M2_le_filtered_modes = np.array(
446455
[
447456
np.array([param[0][m] for m in self.mode.list_absindex_mode])

src/mesohops/basis/hops_hierarchy.py

Lines changed: 107 additions & 69 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)