We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd81229 commit e6e12cbCopy full SHA for e6e12cb
src/qobj/states.jl
@@ -37,7 +37,7 @@ function fock(N::Int, j::Int = 0; dims::Union{Int,AbstractVector{Int},Tuple} = N
37
if getVal(sparse)
38
array = sparsevec([j + 1], [1.0 + 0im], N)
39
else
40
- array = [i == j ? 1.0 + 0im : 0.0 + 0im for i in 1:N]
+ array = [i == (j+1) ? 1.0 + 0im : 0.0 + 0im for i in 1:N]
41
end
42
return QuantumObject(array; type = Ket, dims = dims)
43
0 commit comments