Int64类型怎么定义?

1: [1, 1, 0, 0]
2: [1, 0, 1, 0]
3: [1, 0, 0, 1]
4: [0, 1, 1, 0]
5: [0, 1, 0, 1]
6: [0, 0, 1, 1]
Nparticles = 2
b_mb = ManyBodyBasis(b_sub, bosonstates(b_sub, Nparticles))
Hkin_mb = manybodyoperator(b_mb, Hkin_sub)
V_mb = manybodyoperator(b_mb, V_sub)
H_mb = manybodyoperator(b_mb, H_sub)
n1_sub = basisstate(b_sub, 1) ⊗ dagger(basisstate(b_sub, 1))
n1_mb = manybodyoperator(b_mb, sparse(n1_sub))
n1_mb = number(b_mb, 1)
n2_mb = number(b_mb, 2)
n3_mb = number(b_mb, 3)
n4_mb = number(b_mb, 4)
psi0_mb = basisstate(b_mb, [2, 0, 0, 0])
tout, psi_t_mb = timeevolution.schroedinger(T, psi0_mb, H_mb)
function nx(b::PositionBasis, i)
op = SparseOperator(b)
op.data[i, i] = 1.
op
end
运行上面程序,开头的数组会出现错误:LoadError: MethodError: no method matching (::Colon)**(Int64, ::Array{Int64,1})
Julia小白求解决

不懂你这个是什么写法

1: [1, 1, 0, 0]

报错说的就是 1: [1, 1, 0, 0] 这种写法不合语法

谢谢啦,问题已经解决了

备案号:京ICP备17009874号-2