ITensor / ITensor/ITensorMPS.jl

[BUG] Misleading presence of `normalize` keyword in `orthogonalize!`

Open
#140 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Julia
Stars
85
Forks
27
Avg merge
22m
Merged PRs (30d)
1

Description

Description of bug

Function orthogonalize! still accepts normalize keyword even though the normalization is not performed and no warning is printed. I saw the TODO, but while the maxdim is still used so the truncation is still performed, normalize is not used anymore.

Minimal code demonstrating the bug or unexpected behavior

Minimal runnable code

julia> using ITensors, ITensorMPS

julia> s = siteinds("S=1/2",2)
2-element Vector{Index{Int64}}:
 (dim=2|id=429|"S=1/2,Site,n=1")
 (dim=2|id=23|"S=1/2,Site,n=2")

julia> ψ = MPS(s, ["0", "1"]) + MPS(s, ["1", "0"]);

julia> orthogonalize!(ψ, 1; normalize=true)
MPS
[1] ((dim=2|id=429|"S=1/2,Site,n=1"), (dim=2|id=332|"Link,l=1"))
[2] ((dim=2|id=23|"S=1/2,Site,n=2"), (dim=2|id=332|"Link,l=1"))


julia> norm(ψ) ≈ 1.
false

Expected output or behavior

Either obtaining the state normalized but with a depwarn or an unexpected keyword error.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the orthogonalize! entry point and run the minimal Julia example from the issue to confirm that normalize=true has no effect. Check the surrounding tests or documentation for the keyword's intended behavior; done means the keyword either normalizes with a deprecation warning or is rejected as unexpected.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.