[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.
Changelog
Backwards incompatible changes
Replace the
TDVPEngine
with a new version. The previous one is for now still available astenpy.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 toVariationalCompression.max_sweeps
. Further, we added the parameterVariationalCompression.min_sweeps
andVariationalCompression.tol_theta_diff
.Adjusted default paramters of
tenpy.networks.mps.InitialStateBuilder.randomized()
to be as documented with betterchi_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
andtenpy.algorithms.mpo_evolution.ExpMPOEvolution
). In particular, the default values forN_steps=1
anddt=0.1
are now the same for these classes; Previously, TEBD had a default ofN_steps=10
, and the ExpMPOEvolution haddt=0.01
.Add option sort_charge to the
Site
(calling the newsort_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.
Added
Wrappers for the helical and irregular lattice (removing sites) in
init_lattice()
.Options pos_diag_r, qtotal_Q and qconj_inner for
qr()
.tenpy.linalg.lanczos.Arnoldi
(and common base classKrylovBased
withLanczosGroundState
).Allow to pass and merge multiple parameter files to
tenpy-run
from the command line.Greatly expanded userguide on Simulations and added more parameter examples.
Option preserve_norm for
ExpMPOEvolution
.Allow non-trivial
position_disorder
for lattices.Option fix_u for
onsite_expectation_value()
.Lattice
cylinder_axis
.Random number generator
rng
for models. Any randomness of model (parameters) should use this!psi_AKLT()
for the exact MPS ground state of (spin-1/2) AKLT chain.init_simulation()
andinit_simulation_from_checkpoint()
for debugging or post-simulation measurement.orthogonal_columns()
constructing orthogonal columns to a given (rectangular) matrix.enlarge_chi()
for artificially enlarging the bond dimension.NLegLadder
, and more pairs ('rung_NN', 'leg_NN', 'diagonal'
) for theLadder
.tenpy.algorithms.Algorithm.switch_engine()
for simplified switching from e.g. the TwoSiteDMRGEngine to the SingleSiteDMRGEngine.MultiSpeciesLattice
to simplify implementing e.g. spin-full fermions or bosons without using theGroupedSite
. Further helper functionsspin_half_species()
, as well as the newFermiHubbardModel2
using it, and an example Multi-Species Models.Keyword argument permute_dense for
tenpy.networks.site.Site.add_op()
.
Changed
Raise a warning about iMPS conventions in MPS
overlap()
,apply_local_op()
, which you can suppress with a newunderstood_infinite=True
argument. See A warning about infinite MPS for details.Renamed
tenpy.networks.mpo.MPOGraph.add_string
toadd_string_left_to_right()
as part of the fix for issue #148. Added similaradd_string_left_to_right()
.Automatically shift terms in
expectation_value_terms_sum()
to start in the MPS unit cell for infinite MPS.Possible ordering=’folded’ for the
Ladder
.Enhanced implementation of
canonical_form_infinite2()
to replacecanonical_form_infinite()
.Split up
tenpy.networks.mpo.MPO.expectation_value()
intoexpectation_value_finite()
andexpectation_value_power()
and addtenpy.networks.mpo.MPO.expectation_value_TM()
Enhanced documentation of the lattices with more plots.
Renamed
prepare_update
function oftenpy.algorithms.mps_common.Sweep
toprepare_update_local()
.
Fixed
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 withmode='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()
andpermute_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 forH.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 theSpinHalfSite
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!