Skip to content
Merged
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 Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ Optimisers = "0.2, 0.3, 0.4"
QuadGK = "2.11"
SpecialFunctions = "2.3.1"
Subscripts = "0.1.3"
TensorTrainNumerics = "1.1.4"
TensorTrainNumerics = "1.1.6"
Zygote = "0.6, 0.7"
julia = "1.10"
2 changes: 1 addition & 1 deletion docs/src/GEM.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ using TwoBody
ℏ²c²m⁻¹ = 41.471

H = Hamiltonian(
Laplacian(coefficient = -ℏ²c²m⁻¹),
TwoBody.Laplacian(coefficient = -ℏ²c²m⁻¹),
Gaussian(coefficient = 200.0, exponent = 1.487),
Gaussian(coefficient = -178.0, exponent = 0.639),
)
Expand Down
38 changes: 19 additions & 19 deletions ext/TwoBodyQTTExt.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module TwoBodyQTTExt

using TwoBody
import Logging
import TensorTrainNumerics
import TwoBody: PotentialTerm, V, matrix

Expand Down Expand Up @@ -52,9 +51,10 @@ function _qttvector(f::Function, method::QuanticsTensorTrainMethod)

algorithm = TensorTrainNumerics.MaxVol(
tol=method.tolerance,
rmax=method.maxbonddim,
maxiter=method.maxiter,
verbose=false,
max_bond=method.maxbonddim,
max_sweeps=method.maxiter,
verbosity=0,
show_progress=false,
)
return TensorTrainNumerics.tt_cross(
evaluate,
Expand All @@ -70,7 +70,7 @@ function _compress_vector(vector::QTTVector, method::QuanticsTensorTrainMethod)
TensorTrainNumerics.tt_compress!(
compressed,
method.maxbonddim;
truncerr=method.tolerance,
trunc_tol=method.tolerance,
)
return compressed
end
Expand All @@ -80,7 +80,7 @@ function _compress_operator(operator::QTTMatrix, method::QuanticsTensorTrainMeth
TensorTrainNumerics.tt_compress!(
fused,
method.maxoperatorbonddim;
truncerr=method.tolerance,
trunc_tol=method.tolerance,
)
return TensorTrainNumerics.ttv_to_tto(fused)
end
Expand Down Expand Up @@ -124,19 +124,19 @@ _ttdot(left::QTTVector, right::QTTVector) = TensorTrainNumerics.dot(left, right)

function _dmrg_groundstate(operator::QTTMatrix, guess::QTTVector, method::QuanticsTensorTrainMethod)
normalized_guess = guess / _ttnorm(guess)
history, state, rank_history = Logging.with_logger(Logging.NullLogger()) do
TensorTrainNumerics.dmrg_eigsolve(
operator,
normalized_guess;
N=2,
tol=method.tolerance,
sweep_schedule=[method.sweeps],
rmax_schedule=[method.maxbonddim],
it_solver=true,
linsolv_maxiter=method.maxiter,
linsolv_tol=max(sqrt(method.tolerance), 1e-8),
)
end
history, state, rank_history = TensorTrainNumerics.dmrg_eigsolve(
operator,
normalized_guess;
nsites=2,
trunc_tol=method.tolerance,
max_sweeps=method.sweeps,
max_bond=method.maxbonddim,
local_solver=:iterative,
local_maxiter=method.maxiter,
local_tol=max(sqrt(method.tolerance), 1e-8),
verbosity=0,
show_progress=false,
)
state = state / _ttnorm(state)
return last(history), state, history, rank_history
end
Expand Down
Loading