[v0.10.0] - 2022-11-08¶
The last release of v0.9.0 is by now over a year old, so there have accumulated quite a few fixes, updates and changes.
Everything should still work on Python 3.6, but we now officially support Python 3.7-3.11.
First of all, note that we did a (backwards-incompatible) rewrite of TDVP, which is now based on the
If you need the old TDVP implementation, it’s for now still available as
Thanks to Wilhelm Kadow for his great work here!
There are 2 other significant changes that might require you to change something in your setup:
If you are using simulations with measurements, the measurement functions for simulations need to be updated to accept a model keyword argument, see issue #182 for more details.
When you initialize Sites (in models) you should explicitly pass an argument sort_charge. Set it to True for new projects, but keep it as False if you neeed backwards compatibility with previously saved data. See the last point in the list of “Backwards incompatible changes” below and issue #175 for more details.
Backwards incompatible changes¶
Measurement functions now have to take another argument model as well, which matches the indexing/sites of psi. This helps to avoid special cases for grouped sites and OrthogonalExciations. Moreover, we renamed all measurement functions to start with
m_to clarify their usage, and renamed the (optional) argument key to results_key.
Add more fine grained sweep convergence checks for the
VariationalCompression(used when applying an MPO to an MPS!). In this context, we renamed the parameter N_sweeps to
VariationalCompression.max_sweeps. Further, we added the parameter
Adjusted default paramters of
tenpy.networks.mps.InitialStateBuilder.randomized()to be as documented with better
No longer return ov from
Unify structure of
tenpy.algorithms.mpo_evolution.ExpMPOEvolution). In particular, the default values for
dt=0.1are now the same for these classes; Previously, TEBD had a default of
N_steps=10, and the ExpMPOEvolution had
Add option sort_charge to the
Site(calling the new
sort_charge()method). Using True sorts the charges of the physical leg and thus helps to reduce overhead when using charge conservation. However, doing this can lead to inconsistencies between saved data and newly generated data (after updating TeNPy). Hence, for now we keep the current default False behaviour, but raise a warning that you should set this option explicitly for cases where it changes things. Set it to False, if you already have data (for your particular model), that you want to be able to load/compare to. If you start a new project and don’t have data yet, set it to True. We will change the default behaviour from False to True in version 1.0. See also issue #175.
Wrappers for the helical and irregular lattice (removing sites) in
Options pos_diag_r, qtotal_Q and qconj_inner for
Allow to pass and merge multiple parameter files to
tenpy-runfrom the command line.
Greatly expanded userguide on Simulations and added more parameter examples.
Option preserve_norm for
Option fix_u for
Random number generator
rngfor models. Any randomness of model (parameters) should use this!
psi_AKLT()for the exact MPS ground state of (spin-1/2) AKLT chain.
orthogonal_columns()constructing orthogonal columns to a given (rectangular) matrix.
enlarge_chi()for artificially enlarging the bond dimension.
tenpy.algorithms.Algorithm.switch_engine()for simplified switching from e.g. the TwoSiteDMRGEngine to the SingleSiteDMRGEngine.
MultiSpeciesLatticeto simplify implementing e.g. spin-full fermions or bosons without using the
GroupedSite. Further helper functions
spin_half_species(), as well as the new
FermiHubbardModel2using it, and an example Multi-Species Models.
Keyword argument permute_dense for
Automatically shift terms in
expectation_value_terms_sum()to start in the MPS unit cell for infinite MPS.
Possible ordering=’folded’ for the
Enhanced documentation of the lattices with more plots.
detect_qtotal()more stable: use the maximal entry instead of the first non-zero one.
issue #148 that generating MPOs with long-range couplings over multiple MPS unit cells and multi-couplings raised errors.
mode='complete'sometimes returned wrong charges. Moreover, it sometimes gave zero columns in Q if the R part was completely zero for that charge block.
(!) Non-trivial start_time parameter caused wrong evolution in
Make sure that
lat2mps_idx()doesn’t modify arguments in place.
tenpy.networks.mpo.MPO.expectation_value()did not work correctly for
H.L != psi.L.
add_local_term()did not work with plus_hc=True.
tenpy.linalg.sparse.FlatLinearOperator.eigenvectors()did not always return orthogonal eigenvectors with well-defined charges.
tenpy.linalg.sparse.FlatLinearOperatorto not use the full flat array, but just the block with nonzero entries (which can be much smaller for a few charges). This is enabled over a new option compact_flat that defaults to True if the vector leg is blocked by charge (and charge_sector is not None).
The first, initial measurements for time-dependent Hamiltonians might have used wrong time for sequential/resume run.
Index error in stopping criteria for Lanczos, issue #169.
Fix for resuming simulations with orthogonal_to: carry on the environments!