ITensor / ITensor/ITensorMPS.jl
tdvp_order throws an error for order 4
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 85
- Forks
- 27
- Avg merge
- 22m
- Merged PRs (30d)
- 1
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the orderings definition in tdvporder.jl alongside the sub_time_steps handling in tdvp_step.jl. Trace the order=4 sweep sequence and verify that every substep has a corresponding ordering; done means order=4 completes without an indexing error and preserves the intended forward/backward sweep pattern.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100