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

[ITensors] [BUG] randomMPS doesn't return MPS with minimal bond dimension on the boundaries #869

Open
markusschmitt opened this issue Mar 17, 2022 · 2 comments · May be fixed by #870
Open
Labels
bug Something isn't working ITensorMPS Issues related to the ITensorMPS submodule mps Issues related to MPS/MPO functionality

Comments

@markusschmitt
Copy link

Description of bug
Rather likely "unintended behavior" than "bug": The randomCircuitMPS function returns MPS, where the bond dimension grows starting from the end of the chain and is maximal at the first site. Usually, one would like to have the bond dimension at both the first and the last site equal to the local Hilbert space dimension and maximal at the center.

How to reproduce

using ITensors
L=8
chi=128
mps=ITensors.randomCircuitMPS(ComplexF64,sites,chi)

println(inds(mps[1]))
println(inds(mps[2]))
println(inds(mps[3]))
println()
println(inds(mps[L]))

Expected behavior
Usually, one would like to have the bond dimension at both the first and the last site equal to the local Hilbert space dimension and maximal at the center. This means the expected behavior would be

((dim=2|id=204|"S=1/2,Site,n=1"), (dim=2|id=995|"Link,l=1"))
((dim=2|id=995|"Link,l=1"), (dim=2|id=514|"S=1/2,Site,n=2"), (dim=4|id=840|"Link,l=2"))
((dim=4|id=840|"Link,l=2"), (dim=2|id=378|"S=1/2,Site,n=3"), (dim=8|id=471|"Link,l=3"))

((dim=2|id=800|"Link,l=7"), (dim=2|id=610|"S=1/2,Site,n=8"))

Actual behavior
The actual behavior is as described above:

((dim=2|id=715|"S=1/2,Site,n=1"), (dim=128|id=614|"Link,l=1"))
((dim=128|id=614|"Link,l=1"), (dim=2|id=616|"S=1/2,Site,n=2"), (dim=64|id=572|"Link,l=2"))
((dim=64|id=572|"Link,l=2"), (dim=2|id=446|"S=1/2,Site,n=3"), (dim=32|id=124|"Link,l=3"))

((dim=2|id=667|"Link,l=7"), (dim=2|id=541|"S=1/2,Site,n=8"))

Code demonstrating bug
See above.

Version information
ITensors v0.2.16

@markusschmitt markusschmitt added bug Something isn't working ITensors Issues or pull requests related to the `ITensors` package. labels Mar 17, 2022
@mtfishman
Copy link
Member

The reason for this is because essentially this is implemented using a staircase circuit structure, which causes the asymmetry in the bond dimension.

You should be able to use the truncate!(::MPS) function if you want the minimal bond dimension at each site.

In principle we could have two staircase circuits that start from the left and right edges and meet in the middle. In that way the "center" where it meets could be a keyword argument the user could choose.

@markusschmitt markusschmitt linked a pull request Mar 17, 2022 that will close this issue
7 tasks
@mtfishman
Copy link
Member

Great, looks like you found a simple fix using the current code in #870.

@mtfishman mtfishman changed the title [ITensors] [BUG] [ITensors] [BUG] randomMPS doesn't return MPS with minimal bond dimension on the boundaries Mar 17, 2022
@mtfishman mtfishman added mps Issues related to MPS/MPO functionality ITensorMPS Issues related to the ITensorMPS submodule and removed ITensors Issues or pull requests related to the `ITensors` package. labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ITensorMPS Issues related to the ITensorMPS submodule mps Issues related to MPS/MPO functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants