Skip to content

Commit a480a1c

Browse files
committed
further reduce type restrictions -- only use positional information
1 parent e809350 commit a480a1c

1 file changed

Lines changed: 5 additions & 15 deletions

File tree

src/algorithms/toolbox.jl

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,30 +55,20 @@ Concretely, this is the overlap of the current state with the single-site deriva
5555
\\epsilon = \\left|VL ⋅ \\left(VL^{\\dagger} ⋅ \\frac{\\partial \\text{above}}{\\partial AC_{\\text{pos}}}\\right)\\right|
5656
```
5757
"""
58-
function calc_galerkin(
59-
pos, below::AbstractMPS, operator, above, envs
60-
)
58+
function calc_galerkin(pos::Int, below, operator, above, envs)
6159
AC´ = AC_projection(pos, below, operator, above, envs)
6260
normalize!(AC´)
6361
out = mul!(AC´, below.AL[pos], below.AL[pos]' * AC´, -1, +1)
6462
return norm(out)
6563
end
66-
function calc_galerkin(
67-
pos::CartesianIndex{2}, below::MultilineMPS, operator::MultilineMPO,
68-
above::MultilineMPS, envs::MultilineEnvironments
69-
)
70-
row, col = pos.I
64+
function calc_galerkin(pos::CartesianIndex{2}, below, operator, above, envs)
65+
row, col = Tuple(pos)
7166
return calc_galerkin(col, below[row + 1], operator[row], above[row], envs[row])
7267
end
73-
function calc_galerkin(
74-
below::AbstractMPS, operator, above, envs
75-
)
68+
function calc_galerkin(below::AbstractMPS, operator, above, envs)
7669
return maximum(pos -> calc_galerkin(pos, below, operator, above, envs), 1:length(above))
7770
end
78-
function calc_galerkin(
79-
below::MultilineMPS, operator::MultilineMPO, above::MultilineMPS,
80-
envs::MultilineEnvironments
81-
)
71+
function calc_galerkin(below::MultilineMPS, operator::MultilineMPO, above::MultilineMPS, envs::MultilineEnvironments)
8272
return maximum(
8373
pos -> calc_galerkin(pos, below, operator, above, envs),
8474
CartesianIndices(size(above))

0 commit comments

Comments
 (0)