Skip to content

Commit bfc23ee

Browse files
committed
restrict GradientGrassmann linesearch maxiter
1 parent 1f27ecb commit bfc23ee

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/algorithms/groundstate/gradient_grassmann.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,17 @@ struct GradientGrassmann{O<:OptimKit.OptimizationAlgorithm,F} <: Algorithm
2828
finalize!::F
2929

3030
function GradientGrassmann(; method=ConjugateGradient, (finalize!)=OptimKit._finalize!,
31-
tol=Defaults.tol, maxiter=Defaults.maxiter, verbosity=2)
31+
tol=Defaults.tol, maxiter=Defaults.maxiter,
32+
verbosity=Defaults.verbosity - 1)
3233
if isa(method, OptimKit.OptimizationAlgorithm)
3334
# We were given an optimisation method, just use it.
3435
m = method
3536
elseif method <: OptimKit.OptimizationAlgorithm
3637
# We were given an optimisation method type, construct an instance of it.
37-
m = method(; maxiter=maxiter, verbosity=verbosity, gradtol=tol)
38+
# restrict linesearch maxiter
39+
linesearch = OptimKit.HagerZhangLineSearch(; verbosity=verbosity - 2,
40+
maxiter=10)
41+
m = method(; maxiter, verbosity, gradtol=tol, linesearch)
3842
else
3943
msg = "method should be either an instance or a subtype of `OptimKit.OptimizationAlgorithm`."
4044
throw(ArgumentError(msg))

0 commit comments

Comments
 (0)