diff --git a/src/dmrg_x.jl b/src/dmrg_x.jl index 5f4d8ba..26abbb8 100644 --- a/src/dmrg_x.jl +++ b/src/dmrg_x.jl @@ -2,7 +2,7 @@ function dmrg_x_solver(PH, t, psi0; kwargs...) H = contract(PH, ITensor(true)) D, U = eigen(H; ishermitian=true) u = uniqueind(U, H) - max_overlap, max_ind = findmax(abs, array(psi0 * U)) + max_overlap, max_ind = findmax(abs, array(psi0 * dag(U))) U_max = U * dag(onehot(u => max_ind)) return U_max, nothing end diff --git a/test/Project.toml b/test/Project.toml index 20e9e2f..5c01e80 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,5 +1,6 @@ [deps] DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa" +ITensorTDVP = "25707e16-a4db-4a07-99d9-4d67b7af0342" ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5" KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/test/test_dmrg.jl b/test/test_dmrg.jl index 4ce63c5..1eea58a 100644 --- a/test/test_dmrg.jl +++ b/test/test_dmrg.jl @@ -29,7 +29,7 @@ using Test H, psi; nsweeps, maxdim, cutoff, nsite, solver_krylovdim=3, solver_maxiter=1 ) - e2, psi2 = dmrg(H, psi, sweeps; normalize=false, outputlevel=0) + e2, psi2 = dmrg(H, psi, sweeps; outputlevel=0) @test inner(psi', H, psi) ≈ inner(psi2', H, psi2) end diff --git a/test/test_dmrg_x.jl b/test/test_dmrg_x.jl index 21ab760..253ee61 100644 --- a/test/test_dmrg_x.jl +++ b/test/test_dmrg_x.jl @@ -3,7 +3,7 @@ using ITensorTDVP using Random using Test -@testset "DMRG-X" begin +@testset "DMRG-X (conserve_qns=$conserve_qns)" for conserve_qns in [false, true] function heisenberg(n; h=zeros(n)) os = OpSum() for j in 1:(n - 1) @@ -20,7 +20,7 @@ using Test end n = 10 - s = siteinds("S=1/2", n) + s = siteinds("S=1/2", n; conserve_qns) Random.seed!(12)