From fea840d51f0683deda6b84f84e7fe1885fcb3d8c Mon Sep 17 00:00:00 2001 From: Yi-Te Huang Date: Sun, 7 Jul 2024 11:36:13 +0800 Subject: [PATCH] fix missing `p` for in-place `normalize` --- src/qobj/arithmetic_and_attributes.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qobj/arithmetic_and_attributes.jl b/src/qobj/arithmetic_and_attributes.jl index a2c016a7..b44fe760 100644 --- a/src/qobj/arithmetic_and_attributes.jl +++ b/src/qobj/arithmetic_and_attributes.jl @@ -325,9 +325,9 @@ Also, see [`norm`](@ref) about its definition for different types of [`QuantumOb 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) 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) LinearAlgebra.triu!( A::QuantumObject{<:AbstractArray{T},OpType},