Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Lander Burgelman <[email protected]>
  • Loading branch information
lkdvos and leburgel committed Jan 16, 2025
1 parent 5d4883d commit 446dc8e
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ bib = CitationBibliography(bibpath; style=:authoryear)

# interlinks
links = InterLinks("TensorKit" => "https://jutho.github.io/TensorKit.jl/stable/",
"TensorOperations" => "https://jutho.github.io/TensorOperations.jl/stable/")
"TensorOperations" => "https://jutho.github.io/TensorOperations.jl/stable/",
"KrylovKit" => "https://jutho.github.io/KrylovKit.jl/stable/")

# include MPSKit in all doctests
DocMeta.setdocmeta!(MPSKit, :DocTestSetup, :(using MPSKit, TensorKit); recursive=true)
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/changebonds/svdcut.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ An algorithm that uses truncated SVD to change the bond dimension of a ψ.
$(TYPEDFIELDS)
"""
@kwdef struct SvdCut <: Algorithm
"algorithm used for truncation of the gauge tensors"
"algorithm used for [truncation][@extref TensorKit.tsvd] of the gauge tensors"
trscheme::TruncationScheme = notrunc()
end

Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/changebonds/vumpssvd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $(TYPEDFIELDS)
tol_gauge = Defaults.tolgauge
"tolerance for the eigenvalue solver"
tol_eigenval = Defaults.tol
"algorithm used for truncation of the two-site update"
"algorithm used for [truncation][@extref TensorKit.tsvd] of the two-site update"
trscheme::TruncationScheme = notrunc()
end

Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/excitation/chepigaansatz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $(TYPEDFIELDS)
ChepigaAnsatz(alg)
Create a `ChepigaAnsatz` algorithm with the given eigensolver, or by passing the
keyword arguments to `Arnoldi`.
keyword arguments to [`Arnoldi`][@extref KrylovKit.Arnoldi].
## References
Expand Down
6 changes: 5 additions & 1 deletion src/algorithms/excitation/dmrgexcitation.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
"""
$(TYPEDEF)
Variational optimization algorithm for excitations of finite Matrix Product States by minimizing the energy of ``H - λᵢ |ψᵢ><ψᵢ|``.
Variational optimization algorithm for excitations of finite MPS by minimizing the energy of
```math
H - λᵢ |ψᵢ⟩⟨ψᵢ|
```
## Fields
Expand Down
4 changes: 2 additions & 2 deletions src/algorithms/groundstate/dmrg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct DMRG{A,F} <: Algorithm
tol::Float64
"maximal amount of iterations"
maxiter::Int
"callback function applied after each iteration, of signature `finalize(iter, ψ, H, envs) -> ψ, envs"
"callback function applied after each iteration, of signature `finalize(iter, ψ, H, envs) -> ψ, envs`"
finalize::F
"setting for how much information is displayed"
verbosity::Int
Expand Down Expand Up @@ -82,7 +82,7 @@ struct DMRG2{A,F} <: Algorithm

"algorithm used for the eigenvalue solvers"
eigalg::A
"algorithm used for truncation of the two-site update"
"algorithm used for [truncation](@extref TensorKit.tsvd) of the two-site update"
trscheme::TruncationScheme
end
# TODO: find better default truncation
Expand Down
9 changes: 2 additions & 7 deletions src/algorithms/groundstate/idmrg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,7 @@ Two-site infinite DMRG algorithm for finding the dominant eigenvector.
## Fields
$(TYPEDFIELDS)
- `tol::Float64`: tolerance for convergence criterium
- `tol_gauge::Float64`: tolerance for gauging algorithm
- `eigalg::A`: eigensolver algorithm
- `maxiter::Int`: maximum number of outer iterations
- `verbosity::Int`: display progress information
- `trscheme::TruncationScheme`: truncation algorithm for [`tsvd`][TensorKit.tsvd](@extref)
- `trscheme::TruncationScheme`: truncation algorithm for [`tsvd`](@extref TensorKit.tsvd)
"""
struct IDMRG2{A} <: Algorithm
"tolerance for convergence criterium"
Expand All @@ -101,7 +96,7 @@ struct IDMRG2{A} <: Algorithm
maxiter::Int
"setting for how much information is displayed"
verbosity::Int
"algorithm used for truncation of the two-site update"
"algorithm used for [truncation](@extref TensorKit.tsvd) of the two-site update"
trscheme::TruncationScheme
end
function IDMRG2(; tol=Defaults.tol, tol_gauge=Defaults.tolgauge, eigalg=(;),
Expand Down
4 changes: 2 additions & 2 deletions src/algorithms/timestep/tdvp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $(TYPEDFIELDS)
"maximal amount of iterations for gauging algorithm"
gaugemaxiter::Int = Defaults.maxiter

"callback function applied after each iteration, of signature `finalize(iter, ψ, H, envs) -> ψ, envs"
"callback function applied after each iteration, of signature `finalize(iter, ψ, H, envs) -> ψ, envs`"
finalize::F = Defaults._finalize
end

Expand Down Expand Up @@ -126,7 +126,7 @@ $(TYPEDFIELDS)
"algorithm used for truncation of the two-site update"
trscheme::TruncationScheme = truncerr(1e-3)

"callback function applied after each iteration, of signature `finalize(iter, ψ, H, envs) -> ψ, envs"
"callback function applied after each iteration, of signature `finalize(iter, ψ, H, envs) -> ψ, envs`"
finalize::F = Defaults._finalize
end

Expand Down
3 changes: 2 additions & 1 deletion src/states/abstractmps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Tensor types
"""
MPOTensor{S}
Tensor type for representing local MPO tensors, with the index convention `W ⊗ S ← N ⊗ E`.
Tensor type for representing local MPO tensors, with the index convention `W ⊗ S ← N ⊗ E`,
where `N`, `E`, `S` and `W` denote the north, east, south and west virtual spaces respectively.
"""
const MPOTensor{S} = AbstractTensorMap{T,S,2,2} where {T}
const MPSBondTensor{S} = AbstractTensorMap{T,S,1,1} where {T}
Expand Down

0 comments on commit 446dc8e

Please sign in to comment.