From a7d830073f4ee18c06930a9baec9e84b6b24982c Mon Sep 17 00:00:00 2001 From: Yi-Te Huang Date: Sun, 19 May 2024 03:14:47 +0800 Subject: [PATCH 1/2] fix typo in docstrings --- src/eigsolve.jl | 4 ++-- src/general_functions.jl | 2 +- src/negativity.jl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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..b99c0081 100644 --- a/src/general_functions.jl +++ b/src/general_functions.jl @@ -332,7 +332,7 @@ 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). """ 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)). From 48979fb5c4affe295270c47d62f7ca5d44c52aa1 Mon Sep 17 00:00:00 2001 From: Yi-Te Huang Date: Sun, 19 May 2024 03:18:47 +0800 Subject: [PATCH 2/2] fix typo --- src/general_functions.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/general_functions.jl b/src/general_functions.jl index b99c0081..bc680198 100644 --- a/src/general_functions.jl +++ b/src/general_functions.jl @@ -334,7 +334,7 @@ end 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`` -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