[v0.8.0] - 2021-03-19
Release Notes
First of all: We have optimized the cython parts such that they can now link directly against MKL and have been optimized for the case of small blocks inside charge-conserved tensors.
During compilation, TeNPy now checks whether MKL is available, and then directly links against it.
This changed the depencies: in particular, when you created a conda environment for TeNPy, it is highly recommended
to start off with a new one based on the environment.yml
file.
If you want to continue using the existing conda environment, you need to conda install mkl-devel
before compilation. Additionally, when you use the conda-forge
channel of conda, you should pin blas to use MKL by conda install libblas=*=*mkl
.
Another great reason to update are simulation classes and a console script tenpy-run to allow running and even resuming a simulation when it aborted! See Simulations for details.
Further, there is a big change in verbosity: we switched to using Python’s default logging
mechanism.
This implies that by default you don’t get any output besides error messages and warning any more, at least not in pre-simulation setups.
See Logging and terminal output on how to get the output back, and what to change in your code.
Finally, note that the default (stable) git branch was renamed from master
to main
.
Changelog
Backwards incompatible changes
Drop official support for Python 3.5.
tenpy.linalg.np_conserved.from_ndarray()
: raise ValueError instead of just a warning in case of the wrong non-zero blocks. This behaviour can be switched back with the new argument raise_wrong_sector.Argument v0 of
tenpy.networks.mps.MPS.TransferMatrix.eigenvectors()
is renamed to v0_npc; v0 now serves for non-np_conserved guess.Default parameters for lattice initialization in the following classes changed. In particular, the bc_MPS parameter now defaults to ‘finite’.
Renamed tenpy.algorithms.tebd.Engine to
tenpy.algorithms.tebd.TEBDEngine
and tenpy.algorithms.tdvp.Engine totenpy.algorithms.tdvp.TDVPEngine
to have unique algorithm class-names.When running, no longer print stuff by default. Instead, we use Python’s logging mechanism. To enable printing again, you need to configure the logging to print on “INFO” level (which is the default when running from command line)
As part of this big change in the way verbosity is handled, there were many minor changes: - rename Config.print_if_verbose to
log()
- deprecate the verbose class argument of theConfig
- deprecate the verbose class attribute of all classes (if they had it). - change argument names ofparams()
.Changed default parameter (actually in [v0.8.4] - 2021-03-29), namely to use the
DMRGEngine.mixer
forSingleSiteDMRG
by default.
Added
Simulation class
Simulation
and subclasses as a new extra layer for handling the general setup.Command line script
tenpy-run
andrun_simulation()
for setting up a simulation.tenpy.linalg.sparse.FlatLinearOperator.eigenvectors()
andeigenvectors()
to unify code fromtenpy.networks.mps.TransferMatrix.eigenvectors()
andtenpy.linalg.lanczos.lanczos_arpack()
.tenpy.tools.fit.entropy_profile_from_CFT()
andtenpy.tools.fit.central_charge_from_S_profile()
tenpy.networks.site.Site.multiply_operators()
as a variant ofmultiply_op_names()
accepting both string and npc arrays.tenpy.tools.events.EventHandler()
to simplify call-backs e.g. for measurement codes during an algorithms.tenpy.tools.misc.find_subclass()
to recursively find subclasses of a given base class by the name. This function is now used e.g. to find lattice classes given the name, hence supporting user-defined lattices defined outside of TeNPy.tenpy.tools.misc.get_recursive()
andset_recursive()
for nested data strucutres, e.g., parameters.tenpy.tools.misc.flatten()
to turn a nested data structure into a flat one.tenpy.networks.mps.InitialStateBuilder
to simplify building various initial states.Common base class
tenpy.algorithms.Algorithm
for all algorithms.Common base class
tenpy.algorithms.TimeEvolutionAlgorithm
for time evolution algorithms.tenpy.models.lattice.Lattice.Lu
as a class attribute.tenpy.models.lattice.Lattice.find_coupling_pairs()
to automatically find coupling pairs of ‘nearest_neighbors’ etc..tenpy.models.lattice.HelicalLattice
allowing to have a much smaller MPS unit cell by shifting the boundary conditions around the cylinder.tenpy.networks.purification_mps.PurificationMPS.from_infiniteT_canonical()
for a canonical ensemble.
Changed
For finite DMRG,
DMRGEngine.N_sweeps_check
now defaults to 1 instead of 10 (which is still the default for infinite MPS).Merge
tenpy.linalg.sparse.FlatLinearOperator.npc_to_flat_all_sectors()
intonpc_to_flat()
, mergetenpy.linalg.sparse.FlatLinearOperator.flat_to_npc_all_sectors()
intoflat_to_npc()
.Change the
chinfo.names
of the specificSite
classes to be more consistent and clear.Add the more powerful
tenpy.networks.site.set_common_charges()
to replacetenpy.networks.site.multi_sites_combine_charges()
.Allow
swap_op='autoInv'
fortenpy.networks.mps.MPS.swap_sites()
and explain the idea of the swap_op.The
tenpy.models.model.CouplingMPOModel.init_lattice()
now respects new class attributesdefault_lattice
andforce_default_lattice
.Support additional priority argument for
get_order_grouped()
, issue #122.Warn if one of the add_* methods of the CouplingMPOModel gets called after initialization.
Fixed
Sign error for the couplings of the
tenpy.models.toric_code.ToricCode
.The form of the eigenvectors returned by
tenpy.networks.mps.TransferMatrix.eigenvectors()
was dependent on the charge_sector given in the initialization; we try to avoid this now (if possible).The charge conserved by
SpinHalfFermionSite(cons_Sz='parity')
was weird.Allow to pass npc Arrays as Arguments to
expectation_value_multi_sites()
and other correlation functions (issue #116).tenpy.tools.hdf5_io
did not work with h5py version >= (3,0) due to a change in string encoding (issue #117).The overall phase for the returned W from
compute_K()
was undefined.tenpy.networks.mpo.MPO.expectation_value()
didn’t work with max_range=0The default trunc_par for
tenpy.networks.mps.MPS.swap_sites()
,permute_sites()
andcompute_K()
was leading to too small chi for intial MPS with small chi.issue #120 Lattice with different sites in the unit cell.
Index offset in
tenpy.networks.mps.MPS.expectation_value_term()
for the sites to be used.issue #121
tenpy.networks.mps.MPS.correlation_length()
worked with charge_sector=0, but included additional divergent value with charge_sector=[0].Some MPS methods (correlation function, expectation value, …) raised an error for negative site indices even for infinite MPS.
Warn if we add terms to a couplingMPOMOdel after initialization