[v0.10.0] - 2022-11-08

Release Notes

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 Sweep class. If you need the old TDVP implementation, it’s for now still available as tenpy.algorithms.tdvp.OldTDVPEngine. 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

  • Replace the TDVPEngine with a new version. The previous one is for now still available as tenpy.algorithms.tdvp.OldTDVPEngine.

  • 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 VariationalCompression.min_sweeps and VariationalCompression.tol_theta_diff.

  • Adjusted default paramters of tenpy.networks.mps.InitialStateBuilder.randomized() to be as documented with better chi_max.

  • No longer return ov from tenpy.linalg.lanczos.gram_schmidt().

  • Unify structure of tenpy.algorithms.algorithm.TimeEvolutionAlgorithm subclasses (e.g. tenpy.algorihtms.tebd.TEBDEngine, tenpy.algorithms.tdvp.TDVPEngine and tenpy.algorithms.mpo_evolution.ExpMPOEvolution). In particular, the default values for N_steps=1 and dt=0.1 are now the same for these classes; Previously, TEBD had a default of N_steps=10, and the ExpMPOEvolution had dt=0.01.

  • 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.




  • issue #145 that make_W_II() failed for MPOs with trivial virtual bonds.

  • Make 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.

  • The qr() decomposition with 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.

  • Adjust default trunc_params of compute_K() and permute_sites() to avoid too severe truncation.

  • (!) Non-trivial start_time parameter caused wrong evolution in TimeDependentExpMPOEvolution.

  • Make sure that lat2mps_idx() doesn’t modify arguments in place.

  • The power-method 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.

  • Fix tenpy.linalg.sparse.FlatLinearOperator to 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).

  • Make cons_Sz='parity' for the SpinHalfSite non-trivial.

  • 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!

  • Fix gauge_total_charge() in issue #179. Many thanks to Johannes Mögerle!