Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

Commit

Permalink
Fix warning in LinearAlgebra.norm method
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Jun 2, 2024
1 parent dd2cfd7 commit 2c4518e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Ansatz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ function Base.showerror(io::IO, e::MissingSchmidtCoefficientsException)
print(io, "Can't access the spectrum on bond $(e.bond)")
end

function LinearAlgebra.norm::Ansatz, p::Real = 2; kwargs...)
p != 2 && throw(ArgumentError("p=$p is not implemented yet"))

# TODO: Replace with contract(hcat(ψ, ψ')...) when implemented
return contract(merge(TensorNetwork(ψ), TensorNetwork')); kwargs...) |> only |> sqrt |> abs
function LinearAlgebra.norm2::Ansatz; kwargs...)
return contract(TensorNetwork(merge(Quantum(ψ), Quantum'))); kwargs...) |> only |> sqrt |> abs
end

0 comments on commit 2c4518e

Please sign in to comment.