From b620828ff47fc3b587378f4aa58e99defe05eab4 Mon Sep 17 00:00:00 2001 From: lkdvos Date: Thu, 2 Jul 2026 08:38:34 -0400 Subject: [PATCH 1/2] fix `conj` --- src/operators/windowhamiltonian.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/operators/windowhamiltonian.jl b/src/operators/windowhamiltonian.jl index f4ace7c45..a0833aa56 100644 --- a/src/operators/windowhamiltonian.jl +++ b/src/operators/windowhamiltonian.jl @@ -44,6 +44,7 @@ end Base.parent(h::WindowMPOHamiltonian) = h.finite_ham Base.copy(h::WindowMPOHamiltonian) = WindowMPOHamiltonian(copy(h.left_ham), copy(h.finite_ham), copy(h.right_ham)) +Base.conj(h::WindowMPOHamiltonian) = WindowMPOHamiltonian(conj(h.left_ham), conj(h.finite_ham), conj(h.right_ham)) function Base.:+(a::WindowMPOHamiltonian, b::WindowMPOHamiltonian) # the finite window carries full Jordan virtual spaces at its boundaries, so it has to be From c6764bc6ffcd1b4cebeba135112b422db706d3c2 Mon Sep 17 00:00:00 2001 From: lkdvos Date: Thu, 2 Jul 2026 08:38:45 -0400 Subject: [PATCH 2/2] add derivatives --- src/algorithms/derivatives/hamiltonian_derivatives.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/algorithms/derivatives/hamiltonian_derivatives.jl b/src/algorithms/derivatives/hamiltonian_derivatives.jl index 47ee2b25a..438fe87ec 100644 --- a/src/algorithms/derivatives/hamiltonian_derivatives.jl +++ b/src/algorithms/derivatives/hamiltonian_derivatives.jl @@ -199,6 +199,15 @@ function AC2_hamiltonian( return prepare ? prepare_operator!!(H_AC2) : H_AC2 end +for f in (:AC_hamiltonian, :AC2_hamiltonian) + @eval function $f( + site::Int, below::WindowMPS, operator::WindowMPOHamiltonian, above::WindowMPS, + envs; kwargs... + ) + return $f(site, below, operator.finite_ham, above, envs; kwargs...) + end +end + function JordanMPO_AC2_Hamiltonian(GL::MPSTensor, W1::JordanMPOTensor, W2::JordanMPOTensor, GR::MPSTensor) # block accessors recompute a fresh `SparseBlockTensorMap` on every access, so bind # them once and reuse the locals throughout