[0.6.0] - 2020-05-16

Release Notes

This release contains a major update of the documentation, which is now hosted by “Read the Docs” at https://tenpy.readthedocs.io/. Update your bookmark :-)

Apart from that, this release introduces a format how to save and load data (in particular TeNPy classes) to HDF5 files. See Saving to disk: input/output for more details. To use that feature, you need to install the h5py package (and therefore some version of the HDF5 library). This is easy with anaconda, conda install h5py, but might be cumbersome on your local computing cluster. (However, many university computing clusters have some version of HDF5 installed already. Check with your local sysadmin.)

Moreover, we changed how we read out parameter dictionaries - instead of the get_parameter() function, we have now a Config class which behaves like a dictionary, you can simpy use options.get(key, default) for model parameters - as you would do for a python dictionary.

Changelog

Backwards incompatible changes

  • Created a class Config to replace Python-native parameter dictionaries and add some useful functionality. Old code using tenpy.tools.params.get_parameter() and tenpy.tools.params.unused_parameters() still works as before, but raises a warning, and should be replaced. For example, if you defined your own models, you should replace calls get_parameter(model_params, "key", "default_value", "ModelName") with model_params.get("key", "default_value"), the latter syntax being what you would use for a normal python dictionary as well.

  • Renamed the following class parameter dictionaries to simply options for more consitency. Old code using the class attributes should still work (since we provide property aliases), but raises warnings. Note that this affects also derived classes (for example the TwoSiteDMRGEngine).

    • tenpy.algorithms.dmrg.DMRGEngine.DMRG_params (was already renamed to engine_params in versin 0.5.0)

    • tenpy.algorithms.mps_common.Sweep.engine_params

    • tenpy.algorithms.tebd.Engine.TEBD_params

    • tenpy.algorithms.tdvp.Engine.TDVP_params

    • tenpy.linalg.lanczos.Lanczos

  • Changed the arguments of tenpy.models.model.MultiCouplingModel(): We replaced the three arguments u0, op0 and other_op with other_ops=[(u1, op1, dx1), (op2, u2, dx2), ...] by single, equivalent argment ops which should now read ops=[(op0, dx0, u0), (op1, dx1, u1), (op2, dx2, u2), ...], where dx0 = [0]*lat.dim. Note the changed order inside the tuple! Old code (which specifies opstr and category as keyword argument, if at all) still works as before, but raises a warning, and should be replaced. Since tenpy.lattice.Lattice.possible_multi_couplings() used similar arguments, they were changed as well.

  • Don’t save H_MPO_graph as model attribute anymore - this also wasn’t documented.

  • Renamed the truncation parameter symmetry_tol to degeneracy_tol and make the criterion more reasonable by not checking \(log(S_i/S_j) < log(symmetry_tol)\), but simply \(log(S_i/S_j) < degeneracy_tol`\). The latter makes more sense, as it is equivalent to \((S_i - S_j)/S_j < exp(degeneracy_tol) - 1 = degeneracy_tol + \mathcal{O}(degeneracy_tol^2)\).

  • Deprecated tenpy.networks.mps.MPS.increase_L() in favor of the newly added tenpy.networks.mps.MPS.enlarge_mps_unit_cell() (taking factor instead of new_L=factor*L as argument).

  • tenpy.networks.mps.MPS.correlation_function() now auto-determines whether a Jordan-Wigner string is necessary. If any of the given operators is directly an npc Array, it will now raise an error; set autoJW=False in that case.

  • Instead of “monkey-patching” matvec of the tenpy.algorithms.mps_common.EffectiveH for the case that ortho_to_envs is not empty, we defined a proper class NpcLinearOperatorWrapper, which serves as baseclass for OrthogonalNpcLinearOperator. The argument ortho_to_envs has been removed from EffectiveH.

  • Switch order of the sites in the unit cell for the DualSquare, and redefine what the "default" order means. This is a huge optimization of DMRG, reducing the necessary MPS bond dimension for the ground state to the optimal \(2^{L-1}\) on each bond.

  • Deprecated the Lanczos funciton/class argument orthogonal_to of in LanczosGroundState. Instead, one can use the OrthogonalNpcLinearOperator.

  • Deprecation warning for changing the default argument of shift_ket for non-zero shift_bra of the TransferMatrix.

Added

Changed

  • DEFAULT DMRG paramter 'diag_method' from 'lanczos' to 'default', which is the same for large bond dimensions, but performs a full exact diagonalization if the effective Hamiltonian has small dimensions. The threshold introduced is the new DMRG parameter 'max_N_for_ED'.

  • DEFAULT parameter charge_sector=None instead of charge_sector=0 in tenpy.networks.mps.MPS.overlap() to look for eigenvalues of the transfer matrix in all charge sectors, and not assume that it’s the 0 sector.

  • Derive the following classes (and their subclasses) from the new Hdf5Exportable to support saving to HDF5: - Site - Terms - OnsiteTerms - CouplingTerms - Model, i.e., all model classes.

  • Instead of just defining to_matrix and adjoint for EffectiveH, define the interface directly for NpcLinearOperator.

  • Try to keep the charge block structure as far as possible for add_charge() and drop_charge()

Fixed

  • Adjust the default DMRG parameter min_sweeps if chi_list is set.

  • Avoid some unnecessary transpositions in MPO environments for MPS sweeps (e.g. in DMRG).

  • sort(bunch=True) could return un-bunched Array, but still set the bunched flag.

  • LegPipe did not initialize self.bunched correctly.

  • issue #98: Error of calling psi.canonical_form() directly after disabling the DMRG mixer.

  • svd() with full_matrices=True gave wrong charges.

  • tenpy.linalg.np_conserved.Array.drop_charge() and tenpy.lina.np_conserved.Array.drop_charge() did not copy over labels.

  • wrong pairs for the fifth_nearest_neighbors of the Honeycomb.

  • Continue in tenpy.algorithms.dmrg.full_diag_effH() with a warning instaed of raising an Error, if the effective Hamltonian is zero.

  • correlation_length(): check for hermitian Flag might have raised and Error with new numpy warnings

  • correlation_function() did not respect argument str_on_first=False.

  • tenpy.networks.mps.MPS.get_op() worked unexpected for infinite bc with incomensurate self.L and len(op_list).

  • tenpy.networks.mps.MPS.permute_sites() did modify the given perm.

  • issue #105 Unintended side-effects using lanczos_params.verbose in combination with orthogonal_to

  • issue #108 tenpy.linalg.sparse.FlatLinearOperator._matvec() changes self._charge_sector