diff --git a/src/eigsolve.jl b/src/eigsolve.jl index 015b7b12..5abb132b 100644 --- a/src/eigsolve.jl +++ b/src/eigsolve.jl @@ -282,8 +282,8 @@ end @doc raw""" function eigsolve(A::QuantumObject; v0::Union{Nothing,AbstractVector}=nothing, - sigma::Union{Nothing, Real}=nothing, k::Int = min(4, size(A, 1)), - krylovdim::Int = min(10, size(A, 1)), tol::Real = 1e-8, maxiter::Int = 200, + sigma::Union{Nothing, Real}=nothing, k::Int = 1, + krylovdim::Int = max(20, 2*k+1), tol::Real = 1e-8, maxiter::Int = 200, solver::Union{Nothing, LinearSolve.SciMLLinearSolveAlgorithm} = nothing, kwargs...) Solve for the eigenvalues and eigenvectors of a matrix `A` using the Arnoldi method. diff --git a/src/general_functions.jl b/src/general_functions.jl index c5635ff3..bc680198 100644 --- a/src/general_functions.jl +++ b/src/general_functions.jl @@ -332,9 +332,9 @@ end tracedist(ρ::QuantumObject, σ::QuantumObject) Calculates the [trace distance](https://en.wikipedia.org/wiki/Trace_distance) between two [`QuantumObject`](@ref): -``T(\rho, \sigma) = frac{1}{2} \lVert \rho - \sigma \rVert_1`` +``T(\rho, \sigma) = \frac{1}{2} \lVert \rho - \sigma \rVert_1`` -Note that `A` and `B` must be either [`Ket`](@ref) or [`Operator`](@ref). +Note that `ρ` and `σ` must be either [`Ket`](@ref) or [`Operator`](@ref). """ tracedist(ρ::QuantumObject{<:AbstractArray{T1},ObjType1}, σ::QuantumObject{<:AbstractArray{T2},ObjType2}) where {T1,T2,ObjType1<:Union{KetQuantumObject,OperatorQuantumObject},ObjType2<:Union{KetQuantumObject,OperatorQuantumObject}} = norm(ket2dm(ρ) - ket2dm(σ), 1) / 2 diff --git a/src/negativity.jl b/src/negativity.jl index be687746..f58223b4 100644 --- a/src/negativity.jl +++ b/src/negativity.jl @@ -5,7 +5,7 @@ export negativity, partial_transpose Compute the [negativity](https://en.wikipedia.org/wiki/Negativity_(quantum_mechanics)) ``N(\rho) = \frac{\Vert \rho^{\Gamma}\Vert_1 - 1}{2}`` where ``\rho^{\Gamma}`` is the partial transpose of ``\rho`` with respect to the subsystem, -and ``\Vert X \Vert_1=\Tr\sqrt{X^\dagger X}`` is the trace norm. +and ``\Vert X \Vert_1=\textrm{Tr}\sqrt{X^\dagger X}`` is the trace norm. # Arguments - `ρ::QuantumObject`: The density matrix (`ρ.type` must be [`OperatorQuantumObject`](@ref)).