Skip to content

Commit

Permalink
Fix bug in copy() for state vectors.
Browse files Browse the repository at this point in the history
Missing parameter constraint means it was implemented for all types.
  • Loading branch information
bastikr committed Jun 13, 2017
1 parent c83a9df commit 3cee89b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/states.jl
Expand Up @@ -49,7 +49,7 @@ Ket(b::Basis) = Ket(b, zeros(Complex128, length(b)))

Base.length(a::StateVector) = length(a.basis)::Int
bases.basis(a::StateVector) = a.basis
Base.copy{T}(a::T) = T(a.basis, copy(a.data))
Base.copy{T<:StateVector}(a::T) = T(a.basis, copy(a.data))

# Arithmetic operations
*(a::Bra, b::Ket) = (check_multiplicable(a, b); sum(a.data.*b.data))
Expand Down

0 comments on commit 3cee89b

Please sign in to comment.