UndefVarError after Updating to the Latest Version

Hi, I just updated the ITensors package to the latest version. When I re-run the code which worked well with an older version, it returns an error

ERROR: UndefVarError: `MPS` not defined

where I define the type of a variable is MPS.
I also tried an example code, but it returns a similar error

julia> s = siteinds("S=1/2", 5)
ERROR: UndefVarError: `siteinds` not defined

How may I solve this problem? And I also want to read the .jld2 files that contain MPS and was given by older versions. Will updating the package fail to read the files?

Thanks!

MPS and siteinds have moved to ITensorMPS, have you loaded that package?

julia> using ITensors

julia> s = siteinds("S=1/2", 5)
ERROR: UndefVarError: `siteinds` not defined in `Main`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
 [1] top-level scope
   @ REPL[3]:1

julia> using ITensorMPS

julia> s = siteinds("S=1/2", 5)
5-element Vector{Index{Int64}}:
 (dim=2|id=702|"S=1/2,Site,n=1")
 (dim=2|id=170|"S=1/2,Site,n=2")
 (dim=2|id=214|"S=1/2,Site,n=3")
 (dim=2|id=637|"S=1/2,Site,n=4")
 (dim=2|id=72|"S=1/2,Site,n=5")

Check out the news to see some breaking changes in each version if there’s something more thats missed

1 Like

Oh I didn’t add the package ITensorMPS. After using it, the code works now! Thank you!

Will check the news more frequently… Also thanks for reminding me this!

1 Like

It was announced here: [ANN] ITensors.jl v0.7 breaking release (MPS/MPO code moved to ITensorMPS.jl) and also here: Introduction · ITensors.jl.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.