Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tdvp_order throws an error for order 4 #36

Open
sridevi-k-20 opened this issue Nov 7, 2022 · 4 comments
Open

tdvp_order throws an error for order 4 #36

sridevi-k-20 opened this issue Nov 7, 2022 · 4 comments

Comments

@sridevi-k-20
Copy link

TDVP_Order_error

TDVP_order which determines the number of forward and backward sweeps does not work for order=4.
This is because the function in tdvporder.jl

function orderings(::TDVPOrder{4,direction}) where {direction}
  return [direction, Base.ReverseOrdering(direction)]
end

returns an array of length 2. However, the for loop in the file tdvp_step.jl runs over the length of sub_time_steps, which is an array of length 6 according to the definition given in tdvporder.jl.

  for substep in 1:length(sub_time_steps)
    psi, PH, info = tdvp_sweep(
      orderings[substep], solver, PH, sub_time_steps[substep], psi; current_time, kwargs...
    )

This causes an error as attached in the image. One can overcome this error by changing the function as

function orderings(::TDVPOrder{4,direction}) where {direction}
  return [direction, Base.ReverseOrdering(direction),direction, Base.ReverseOrdering(direction),direction, Base.ReverseOrdering(direction)]
end

But not sure if this a correct approach. Please check this.
Thank you

@mtfishman
Copy link
Member

That sounds reasonable, @b-kloss does that make sense to you?

A slightly simpler way to write it would be:

function orderings(::TDVPOrder{4,direction}) where {direction}
  return repeat(orderings(TDVPOrder{2,direction}(), 3)
end

@b-kloss
Copy link

b-kloss commented Dec 8, 2022

Yes, either of these should be correct. I'll try to test it soon.

@jkombe
Copy link

jkombe commented Nov 20, 2023

Hi, I have also come across this issue, and wanted to push the fix for it. Do I need some access rights @mtfishman? Thanks!

@mtfishman
Copy link
Member

You can make a fork and then a PR, no need for access rights.

@mtfishman mtfishman transferred this issue from ITensor/ITensorTDVP.jl Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants