Hi, I am new to julia and itensor and got a problem in defining custom operators. I want to define a sequence of custom ITensors.op like
function ITensors.op(::OpName"M1", ::SiteType"Boson", d::Int)
function ITensors.op(::OpName"M2", ::SiteType"Boson", d::Int)
function ITensors.op(::OpName"M3", ::SiteType"Boson", d::Int)
function ITensors.op(::OpName"M4", ::SiteType"Boson", d::Int)
and so on. I tried to do this
for i in 1:4
function ITensors.op(::OpName"M"*string(i), ::SiteType"Boson", d::Int)
end
But then got an error saying:
syntax: “(::ITensors.SiteTypes.OpName{:M} * string(i))” is not a valid function argument name
How could I convert an int to a string and then use the string in the OpName?
I am using julia 1.12 and ITensor 0.9.15. Thanks.