The ITensorTDVP.jl package will be deprecated in favor of the ITensorMPS.jl package. We plan to move all of the code from ITensorTDVP.jl into ITensorMPS.jl. For now, to help with the transition, ITensorMPS.jl simply re-exports the functionality of ITensorTDVP.jl. To prepare for the change, please install ITensorMPS.jl and change using ITensorTDVP to using ITensorMPS in your code. |
To install this package, you can use the following steps:
$ julia
julia> ]
pkg> add ITensorTDVP
However, as noted above we now recommend installing and loading ITensorMPS instead of ITensorTDVP.
- A new (experimental)
expandfunction has been introduced for performing global Krylov expansion based on arXiv:2005.06104, which can help with the accuracy of TDVP evolution in certain cases. See the docstrings ofexpandfor more details:
julia> using ITensorTDVP
julia> ?
help?> expand
# ...Users are not given many customization options just yet as we gain more experience on the right balance between efficacy of the expansion and performance, and default values and keyword arguments are subject to change as we learn more about how to best use the method.
- When calling
tdvp(operator, t, init; kwargs...),tis now interpreted as the total evolution time, while inITensorTDVP.jlv0.3 and below it was being interpreted as the time step. To upgrade, change code like:
tdvp(operator, -0.1im, init; nsweeps=10, kwargs...)to:
tdvp(operator, -1.0im, init; nsweeps=10, kwargs...)to evolve to total time 1.0 over 10 time steps of size 0.1.
Also note that ITensorTDVP.jl v0.4 introduces nsteps as an alias for nsweeps in the tdvp function. nsteps is now the preferred syntax for specifying the number of time steps, and nsweeps may be deprecated in tdvp in the future. For example the following is equivalent to the examples above:
tdvp(operator, -1.0im, init; nsteps=10, kwargs...). Alternatively, you can specify the time steps instead of the number of steps:
tdvp(operator, -1.0im, init; time_step=-0.1im, kwargs...)Note that the total time divided by the time step must be an integer.
- In
tdvp, a custom local updater/solver must now be passed as a keyword argumentupdater, as opposed to as the first argument which was the syntax inITensorTDVP.jlv0.3 and below. So code like:
tdvp(custom_updater, operator, t, init; kwargs...)must be changed to:
tdvp(operator, t, init; updater=custom_updater, kwargs...)- The keyword argument
psithat was being passed to observers intdvp,linsolve, etc. which stored the current state has been renamed tostate. Change code like:
measure_sz(; psi) = expect(psi, "Sz")
obs = observer("Sz" => measure_sz)
tdvp(operator, t, init; (observer!)=obs, kwargs...)to:
measure_sz(; state) = expect(state, "Sz")
obs = observer("Sz" => measure_sz)
tdvp(operator, t, init; (observer!)=obs, kwargs...)- Only the argument ordering
tdvp(operator, t, init; kwargs...)is now supported.tdvp(t, operator, init; kwargs...)andtdvp(operator, init, t; kwargs...)have been removed. - In
tdvp, the keyword argumentsolver_backendhas been renamed toupdater_backend. Change code like:
tdvp(operator, t, init; solver_backend="applyexp", kwargs...)to:
tdvp(operator, t, init; updater_backend="applyexp", kwargs...)- In
tdvpandITensorTDVP.dmrg, keyword arguments passed to the local solver/updater should now be passed in a NamedTuple in theupdater_kwargskeyword argument, such asupdater_kwargs=(; tol=1e-5, krylovdim=20), instead of as keyword argumentssolver_tol,solver_krylovdim, etc. Change code like:
tdvp(operator, t, init; solver_tol=1e-5, solver_krylovdim=20, kwargs...)
ITensorTDVP.dmrg(operator, init; solver_tol=1e-5, solver_krylovdim=20, kwargs...)to:
tdvp(operator, t, init; updater_kwargs=(; tol=1e-5, krylovdim=20), kwargs...)
ITensorTDVP.dmrg(operator, init; updater_kwargs=(; tol=1e-5, krylovdim=20), kwargs...)- In
linsolve, the keyword argumentsolver_kwargshas been renamed toupdater_kwargs. - In
ITensorTDVP.dmrg,dmrg_x, andlinsolve, the keyword argumentstep_observer!has been renamed tosweep_observer!. Either name is allowed intdvpbutstep_observer!is preferred and the namesweep_observer!may be deprecated intdvpin future versions. - Support for
ITensors.AbstractObserver-based observers has been removed, useObservers.observerinstead. - In
contract(operator::MPO, state::MPS; alg="fit", kwargs...), andapply(operator::MPO, state::MPS; alg="fit", kwargs...), the keyword argument for specifying an initial guess for the result is now calledinitinstead ofinit_mps. Additionally, incontract,initshould have primed site indices, or more generally should have site indices which are those that are not shared by the input operator and state. Inapply,initshould have site indices matching those of the inputstate. - In custom local updaters/solvers, the keyword arguments
time_step,current_time, andoutputlevelare now being passed as a NamedTuple in a new keyword argumentinternal_kwargs. Change local updaters/solvers from:
function custom_updater(operator, init; time_step, current_time, outputlevel, kwargs...)
### Updater implementation.
endto:
function custom_updater(operator, init; internal_kwargs, kwargs...)
# List whichever keyword arguments of `internal_kwargs` are needed
# on the left hand side.
(; time_step) = internal_kwargs
### Updater implementation.
endnstepsis now an alias for thensweepskeyword argument intdvpand is the preferred syntax for setting the number of time steps of TDVP.nsweepsmay be deprecated as a keyword argument oftdvpin the future.TimeDependentSumnow accepts coefficients and terms that are Tuples, along with the previous interface which accepted Vectors.- Custom local updaters/solvers can be passed as a keyword argument
updatertoITensorTDVP.dmrg,dmrg_x, andlinsolve, which is consistent with the new syntax fortdvp.
ITensorTDVP.dmrgandITensorTDVP.dmrg_xnow output a tuple containing the eigenvalue and eigenvector, while before they just output the eigenvector. You should update code like this:
psi = dmrg_x(H, psi0; nsweeps=10, maxdim=100, cutoff=1e-6)
psi = ITensorTDVP.dmrg(H, psi0; nsweeps=10, maxdim=100, cutoff=1e-6)to:
energy, psi = dmrg_x(H, psi0; nsweeps=10, maxdim=100, cutoff=1e-6)
energy, psi = ITensorTDVP.dmrg(H, psi0; nsweeps=10, maxdim=100, cutoff=1e-6)- ITensorTDVP.jl v0.2.0-v0.2.4: The
applyexpKrylov exponentiation solver backend was removed, andsolver_backend="applyexp"option fortdvpnow just callsexponentiatefrom KrylovKit.jl.applyexpis in many ways the same asexponentiatebitexponentiatehas more advanced features like restarts. In these versions,solver_backend="applyexp"prints a warning to that effect. As of ITensorTDVP.jl v0.2.5, we have brought back theapplyexpbackend because we received reports that it performed better in certain cases. We plan to investigate that issue and make sureexponentiateworks as well asapplyexpin those cases so that we can go back to just having a singleexponentiatebackend.
svd_algnow doesn't specify a default value, so the default value is set by thesvdfunction in ITensors/NDTensors. This fixes an issue using ITensorTDVP.jl and GPU backends, where the default value being set in ITensorTDVP.jl wasn't compatible with the options available in some GPU backends like CUDA.- More generally, keyword arguments are handled better throughout the package, so default values are handled more systematically and keyword arguments are listed or forwarded more explicitly, so it should catch more mistakes like passing an incorrect keyword argument name.