Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing p for in-place normalize #184

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Changes from all 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
4 changes: 2 additions & 2 deletions src/qobj/arithmetic_and_attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,9 @@
LinearAlgebra.normalize!(
A::QuantumObject{<:AbstractArray{T},ObjType},
p::Real = 2,
) where {T,ObjType<:Union{KetQuantumObject,BraQuantumObject}} = (rmul!(A.data, 1 / norm(A)); A)
) where {T,ObjType<:Union{KetQuantumObject,BraQuantumObject}} = (rmul!(A.data, 1 / norm(A, p)); A)

Check warning on line 328 in src/qobj/arithmetic_and_attributes.jl

View check run for this annotation

Codecov / codecov/patch

src/qobj/arithmetic_and_attributes.jl#L328

Added line #L328 was not covered by tests
LinearAlgebra.normalize!(A::QuantumObject{<:AbstractArray{T},OperatorQuantumObject}, p::Real = 1) where {T} =
(rmul!(A.data, 1 / norm(A)); A)
(rmul!(A.data, 1 / norm(A, p)); A)

Check warning on line 330 in src/qobj/arithmetic_and_attributes.jl

View check run for this annotation

Codecov / codecov/patch

src/qobj/arithmetic_and_attributes.jl#L330

Added line #L330 was not covered by tests
albertomercurio marked this conversation as resolved.
Show resolved Hide resolved

LinearAlgebra.triu!(
A::QuantumObject{<:AbstractArray{T},OpType},
Expand Down