MesoHOPS 1.8.0
This commit introduces tensor-network HOPS, a Matrix Product State representation of the hierarchy wavefunction, and adds rectangular hierarchy truncation, nondyadic spectroscopy, and per-step timing instrumentation.
Key improvements and features:
-
Tensor-network HOPS: The new
mesohops.tensorsubpackage represents the hierarchy wavefunction as a Matrix Product State rather than a flat auxiliary-enumerated vector.HopsTensorWavefunctionhandles MPS storage, normalization, operator application, and bond-dimension control;HopsTensorEOMevaluates the equation of motion directly on the MPS; andmpo_constructors.pybuilds the Hamiltonian, dipole, and state-number MPOs. Hierarchy depth is encoded in the MPS core dimensions (k_max + 1per mode) rather than through explicit auxiliary-vector enumeration, son_hier,n_hmodes, andADAPTIVE_Hdo not apply on this path. Two representations are available viamethod:'number', in which the ground state is implicit as the all-zero MPS configuration, and'fullstate'. Tensor adaptivity is not supported in this release — see the note below. -
Rectangular hierarchy truncation:
HopsHierarchygains aTRUNCATION_METHODparameter ('triangular', the default and prior behavior, or'rectangular').define_rectangular_hierarchy()admits every per-mode depth combination in[0, MAXHIER]^n_hmodes, matching the MPS core structure used by tensor HOPS. Rectangular truncation is unsupported for adaptive calculations and raisesNotImplementedError, because the vector adaptive flux filters enforce theMAXHIERboundary through total auxiliary depth, which is inherently triangular. Relatedly,add_connectionsno longer short-circuits the k+1 loop on total depth, which rectangular hierarchies require since their per-mode depths may sum aboveMAXHIER. -
Nondyadic spectroscopy:
util/nondyadic_spectroscopy.pydispatches on trajectory type, tensor method, and Hilbert-space convention:embedded, where the ground state occupies an explicit basis slot;vacuum, where it is the implicit all-zero MPS configuration; andexcited_only. -
Nearest-neighbor Hamiltonian detection:
HopsSystemexposesflag_nearest_neighbor_ham, computed at construction, indicating whether all non-zero Hamiltonian elements satisfy|row - col| <= 1. Explicit stored zeros are eliminated first so that a user-supplied sparse matrix with padded off-diagonals is not misclassified. -
Per-step timing and storage additions: A new
STORE_STEP_TIMINGintegration parameter (defaultFalse) records wall-clock time for each integration step. When enabled,storage.metadata["LIST_PROPAGATION_TIME"]holds(t, elapsed)tuples per step rather than a single total-elapsed float perpropagate()call; the default is unchanged. Apsi_g_trajstorage option captures<0,...,0|psi>per step, which the vacuum-convention spectroscopy path requires becauseextract_psisees only the excited-state slots. -
Integrator rename and hierarchy error handling:
mesohops.integrator.integrator_rkis renamed tomesohops.integrator.integrator, so code importingrunge_kutta_steporrunge_kutta_variablesmust update the import path. Integrator setup moved into an overridableHopsTrajectory._setup_integrator()hook so subclasses can register additional integrators.
Warning
NOTE — this release breaks existing scripts that import the Runge-Kutta integrator. mesohops.integrator.integrator_rk is renamed to mesohops.integrator.integrator, with no backwards-compatible alias, so any script importing from the old path fails immediately with ModuleNotFoundError:
# before (1.7.0)
from mesohops.integrator.integrator_rk import runge_kutta_step, runge_kutta_variables
# after (1.8.0)
from mesohops.integrator.integrator import runge_kutta_step, runge_kutta_variablesWarning
NOTE — adaptivity is not supported for tensor HOPS in this release. The adaptive code paths (HopsTensorBasis.update_basis, tensor_functions_adaptive.py, and HopsTensorTrajectory.make_adaptive) are present in the source but are not finished. Calling make_adaptive() on a HopsTensorTrajectory is not blocked at runtime, so do not use tensor adaptivity for production results. Non-adaptive tensor HOPS is unaffected.
These enhancements extend MesoHOPS beyond vector HOPS into tensor-network territory, broadening the range of system sizes and bath structures the library can reach.