Hello ITensor team,
When constructing an MPO with OpSum, shown in the example below, I get the following error, which I do not know how to debug. I am building an pretty unusual MPO, but in the minimal example, you can see the problem appearing in a minimal MPO. Could you give me a hint what the solution might be? Thank you very much in advance.
ERROR: MethodError: no method matching size(::StaticArraysCore.SVector{16, UInt16})
Minimal working example
using ITensors
function construct_id_operator_matrix(dim_charge_basis::Int=7, dim_harmonic_basis::Int=4)
id_harmonic = I(dim_harmonic_basis)
id_charge = I(dim_charge_basis)
return kron(id_harmonic, id_charge)
end
dim_harmonic_basis = 4
dim_charge_basis = 7
num_sites = 2
ITensors.op(::OpName"ID", ::SiteType"Boson", dim_charge_basis::Int, dim_harmonic_basis::Int) = construct_id_operator_matrix(dim_charge_basis, dim_harmonic_basis)
sites = siteinds("Boson", num_sites, dim=dim_harmonic_basis*dim_charge_basis)
os = OpSum()
os += 0.5, "ID", 1
H = MPO(os, sites)
My Environment
julia> versioninfo()
Julia Version 1.10.2
Commit bd47eca2c8a (2024-03-01 10:14 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: macOS (arm64-apple-darwin22.4.0)
CPU: 8 × Apple M1
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)
(@v1.10) pkg> status
Status `~/.julia/environments/v1.10/Project.toml`
[6e4b80f9] BenchmarkTools v1.5.0
[336ed68f] CSV v0.10.14
[a93c6f00] DataFrames v1.6.1
[7073ff75] IJulia v1.24.2
[0d1a4710] ITensorMPS v0.2.4
[9136182c] ITensors v0.6.14
[b964fa9f] LaTeXStrings v1.3.1
[91a5bcdd] Plots v1.40.4
[c3e4b0f8] Pluto v0.19.42
[92933f4c] ProgressMeter v1.10.0
[9ff05d80] TickTock v1.3.0