[v0.8.0] - 2021-03-19¶
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
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
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
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’.
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 the
Config- deprecate the verbose class attribute of all classes (if they had it). - change argument names of
Simulationand subclasses as a new extra layer for handling the general setup.
Command line script
run_simulation()for setting up a simulation.
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.flatten()to turn a nested data structure into a flat one.
tenpy.networks.mps.InitialStateBuilderto simplify building various initial states.
Common base class
tenpy.algorithms.Algorithmfor all algorithms.
Common base class
tenpy.algorithms.TimeEvolutionAlgorithmfor time evolution algorithms.
tenpy.models.lattice.Lattice.Luas a class attribute.
tenpy.models.lattice.Lattice.find_coupling_pairs()to automatically find coupling pairs of ‘nearest_neighbors’ etc..
tenpy.models.lattice.HelicalLatticeallowing 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.
For finite DMRG,
DMRGEngine.N_sweeps_checknow defaults to 1 instead of 10 (which is still the default for infinite MPS).
chinfo.namesof the specific
Siteclasses to be more consistent and clear.
tenpy.networks.mps.MPS.swap_sites()and explain the idea of the swap_op.
tenpy.models.model.CouplingMPOModel.init_lattice()now respects new class attributes
Warn if one of the add_* methods of the CouplingMPOModel gets called after initialization.
Sign error for the couplings of the
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
The overall phase for the returned W from
tenpy.networks.mpo.MPO.expectation_value()didn’t work with max_range=0
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.
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