Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased](https://github.com/qutip/QuantumToolbox.jl/tree/main)

- Make CUDA conversion more general using Adapt.jl. ([#437])
- Make the generation of `fock` states non-mutating to support Zygote.jl. ([#438])

## [v0.29.1]
Release date: 2025-03-07
Expand Down Expand Up @@ -190,3 +191,4 @@ Release date: 2024-11-13
[#428]: https://github.com/qutip/QuantumToolbox.jl/issues/428
[#430]: https://github.com/qutip/QuantumToolbox.jl/issues/430
[#437]: https://github.com/qutip/QuantumToolbox.jl/issues/437
[#438]: https://github.com/qutip/QuantumToolbox.jl/issues/438
3 changes: 1 addition & 2 deletions src/qobj/states.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ function fock(N::Int, j::Int = 0; dims::Union{Int,AbstractVector{Int},Tuple} = N
if getVal(sparse)
array = sparsevec([j + 1], [1.0 + 0im], N)
else
array = zeros(ComplexF64, N)
array[j+1] = 1
array = [j == i ? 1.0 + 0im : 0.0 + 0im for j in 1:N]
end
return QuantumObject(array; type = Ket, dims = dims)
end
Expand Down
Loading