Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ITensorMPS] Rename most functions exported by ITensorTDVP #1397

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ITensorMPS/contract_mpo_mps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function contractmpo_solver(; kwargs...)
return solver
end

function itensortdvp_contract(
function ITensors.contract(
alg::Algorithm"fit", A::MPO, psi0::MPS; init_mps=psi0, nsweeps=1, kwargs...
)::MPS
n = length(A)
Expand Down
2 changes: 1 addition & 1 deletion src/ITensorMPS/dmrg_x.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function dmrg_x_solver(PH, t, psi0; current_time, outputlevel)
return U_max, nothing
end

function itensortdvp_dmrg_x(PH, psi0::MPS; reverse_step=false, kwargs...)
function dmrg_x(PH, psi0::MPS; reverse_step=false, kwargs...)
psi = alternating_update(dmrg_x_solver, PH, psi0; reverse_step, kwargs...)
return psi
end
4 changes: 2 additions & 2 deletions src/ITensorMPS/linsolve.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using KrylovKit: KrylovKit, linsolve
using KrylovKit: KrylovKit

"""
Compute a solution x to the linear system:
Expand All @@ -22,7 +22,7 @@ Keyword arguments:
```
See `KrylovKit.jl` documentation for more details on available keyword arguments.
"""
function itensortdvp_linsolve(
function KrylovKit.linsolve(
A::MPO,
b::MPS,
x₀::MPS,
Expand Down
25 changes: 13 additions & 12 deletions src/ITensorMPS/tdvp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function tdvp_solver(
return solver
end

function itensortdvp_tdvp(
function tdvp(
H,
t::Number,
psi0::MPS;
Expand All @@ -58,7 +58,7 @@ function itensortdvp_tdvp(
solver_outputlevel=default_solver_outputlevel(solver_function),
kwargs...,
)
return itensortdvp_tdvp(
return tdvp(
tdvp_solver(
solver_function;
ishermitian,
Expand All @@ -75,12 +75,12 @@ function itensortdvp_tdvp(
)
end

function itensortdvp_tdvp(t::Number, H, psi0::MPS; kwargs...)
return itensortdvp_tdvp(H, t, psi0; kwargs...)
function tdvp(t::Number, H, psi0::MPS; kwargs...)
return tdvp(H, t, psi0; kwargs...)
end

function itensortdvp_tdvp(H, psi0::MPS, t::Number; kwargs...)
return itensortdvp_tdvp(H, t, psi0; kwargs...)
function tdvp(H, psi0::MPS, t::Number; kwargs...)
return tdvp(H, t, psi0; kwargs...)
end

"""
Expand All @@ -96,20 +96,21 @@ Returns:
* `psi::MPS` - time-evolved MPS

Optional keyword arguments:
* `nsite::Int = 2` - number of sites to use in the core steps of the algorithm.
* `outputlevel::Int = 1` - larger outputlevel values resulting in printing more information and 0 means no output
* `observer` - object implementing the [Observer](@ref observer) interface which can perform measurements and stop early
* `write_when_maxdim_exceeds::Int` - when the allowed maxdim exceeds this value, begin saving tensors to disk to free memory in large calculations
"""
function itensortdvp_tdvp(solver, H::MPO, t::Number, psi0::MPS; kwargs...)
function tdvp(solver, H::MPO, t::Number, psi0::MPS; kwargs...)
return alternating_update(solver, H, t, psi0; kwargs...)
end

function itensortdvp_tdvp(solver, t::Number, H, psi0::MPS; kwargs...)
return itensortdvp_tdvp(solver, H, t, psi0; kwargs...)
function tdvp(solver, t::Number, H, psi0::MPS; kwargs...)
return tdvp(solver, H, t, psi0; kwargs...)
end

function itensortdvp_tdvp(solver, H, psi0::MPS, t::Number; kwargs...)
return itensortdvp_tdvp(solver, H, t, psi0; kwargs...)
function tdvp(solver, H, psi0::MPS, t::Number; kwargs...)
return tdvp(solver, H, t, psi0; kwargs...)
end

"""
Expand All @@ -131,6 +132,6 @@ each step of the algorithm when optimizing the MPS.
Returns:
* `psi::MPS` - time-evolved MPS
"""
function itensortdvp_tdvp(solver, Hs::Vector{MPO}, t::Number, psi0::MPS; kwargs...)
function tdvp(solver, Hs::Vector{MPO}, t::Number, psi0::MPS; kwargs...)
return alternating_update(solver, Hs, t, psi0; kwargs...)
end
Loading