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

Commit

Permalink
Add ==, isapprox methods to Quantum
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Apr 5, 2024
1 parent a7fe63b commit c4bb805
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Quantum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ Tenet.TensorNetwork(q::Quantum) = q.tn

Base.copy(q::Quantum) = Quantum(copy(TensorNetwork(q)), copy(q.sites))

Base.:(==)(a::Quantum, b::Quantum) = a.tn == b.tn && a.sites == b.sites
Base.isapprox(a::Quantum, b::Quantum; kwargs...) = isapprox(a.tn, b.tn; kwargs...) && a.sites == b.sites

function Base.adjoint(qtn::Quantum)
sites = Iterators.map(qtn.sites) do (site, index)
site' => index
Expand Down

0 comments on commit c4bb805

Please sign in to comment.