File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
src/algorithms/derivatives Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -300,22 +300,18 @@ end
300300# Actions
301301# -------
302302function (H:: JordanMPO_AC_Hamiltonian )(x:: MPSTensor )
303- y = zerovector (x)
304-
303+ y = ismissing (H. A) ? zerovector (x) : H. A (x)
305304 ismissing (H. D) || @plansor y[- 1 - 2 ; - 3 ] += x[- 1 1 ; - 3 ] * H. D[- 2 ; 1 ]
306305 ismissing (H. E) || @plansor y[- 1 - 2 ; - 3 ] += H. E[- 1 ; 1 ] * x[1 - 2 ; - 3 ]
307306 ismissing (H. I) || @plansor y[- 1 - 2 ; - 3 ] += x[- 1 - 2 ; 1 ] * H. I[1 ; - 3 ]
308307 ismissing (H. C) || @plansor y[- 1 - 2 ; - 3 ] += x[- 1 2 ; 1 ] * H. C[- 2 - 3 ; 2 1 ]
309308 ismissing (H. B) || @plansor y[- 1 - 2 ; - 3 ] += H. B[- 1 - 2 ; 1 2 ] * x[1 2 ; - 3 ]
310- if ! ismissing (H. A)
311- y += H. A (x)
312- end
313309
314310 return y
315311end
316312
317313function (H:: JordanMPO_AC2_Hamiltonian )(x:: MPOTensor )
318- y = zerovector (x)
314+ y = ismissing (H . AA) ? zerovector (x) : H . AA (x)
319315 ismissing (H. II) || @plansor y[- 1 - 2 ; - 3 - 4 ] += x[- 1 - 2 ; 1 - 4 ] * H. II[- 3 ; 1 ]
320316 ismissing (H. IC) || @plansor y[- 1 - 2 ; - 3 - 4 ] += x[- 1 - 2 ; 1 2 ] * H. IC[- 4 - 3 ; 2 1 ]
321317 ismissing (H. ID) || @plansor y[- 1 - 2 ; - 3 - 4 ] += x[- 1 - 2 ; - 3 1 ] * H. ID[- 4 ; 1 ]
@@ -325,9 +321,6 @@ function (H::JordanMPO_AC2_Hamiltonian)(x::MPOTensor)
325321 ismissing (H. BE) || @plansor y[- 1 - 2 ; - 3 - 4 ] += x[1 2 ; - 3 - 4 ] * H. BE[- 1 - 2 ; 1 2 ]
326322 ismissing (H. DE) || @plansor y[- 1 - 2 ; - 3 - 4 ] += x[- 1 1 ; - 3 - 4 ] * H. DE[- 2 ; 1 ]
327323 ismissing (H. EE) || @plansor y[- 1 - 2 ; - 3 - 4 ] += x[1 - 2 ; - 3 - 4 ] * H. EE[- 1 ; 1 ]
328- if ! ismissing (H. AA)
329- y += H. AA (x)
330- end
331324
332325 return y
333326end
You can’t perform that action at this time.
0 commit comments