diff --git a/src/Quantum.jl b/src/Quantum.jl index b6f86b57..64e629c7 100644 --- a/src/Quantum.jl +++ b/src/Quantum.jl @@ -191,7 +191,7 @@ end Returns the adjoint of a [`Quantum`](@ref) Tensor Network; i.e. the conjugate Tensor Network with the inputs and outputs swapped. """ -Base.adjoint(tn::AbstractQuantum) = adjoint!(copy(tn)) +Base.adjoint(tn::AbstractQuantum) = adjoint!(deepcopy(tn)) function LinearAlgebra.adjoint!(tn::AbstractQuantum) conj!(tn) diff --git a/src/TensorNetwork.jl b/src/TensorNetwork.jl index a683db19..d99057b0 100644 --- a/src/TensorNetwork.jl +++ b/src/TensorNetwork.jl @@ -80,7 +80,7 @@ Base.size(tn::AbstractTensorNetwork, args...) = size(TensorNetwork(tn), args...) Base.eltype(tn::AbstractTensorNetwork) = promote_type(eltype.(tensors(tn))...) -Base.conj(tn::AbstractTensorNetwork) = conj!(copy(tn)) +Base.conj(tn::AbstractTensorNetwork) = conj!(deepcopy(tn)) function Base.conj!(tn::AbstractTensorNetwork) foreach(conj!, tensors(tn)) return tn