Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/QuantumStateTransfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ include("types.jl")
include("EpsilonOptimization/EpsilonOptimization.jl")
using .EpsilonOptimization

include("state_transfer.jl")
include("uniform_mixing.jl")
include("fractional_revival.jl")
include("core/state_transfer.jl")
include("core/uniform_mixing.jl")
include("core/fractional_revival.jl")

# TODO: Exports (add more later)
export max_state_transfer, check_state_transfer
Expand Down
File renamed without changes.
14 changes: 6 additions & 8 deletions src/state_transfer.jl → src/core/state_transfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ end
[TODO: Write here]

# Notes
[TODO: Write here. Proof sketch of bounds on Lipschitz and alpha constants, plus further
relevant references?]
[TODO: Refer to [`transfer_fidelity_deriv_bound`](@ref) for proof sketch of bounds]
"""
function max_state_transfer(g::AbstractGraph, args...)
if !is_simple(g)
Expand All @@ -151,7 +150,7 @@ function max_state_transfer(
epsilon::Real,
method::Symbol=:lipschitz_bb,
) where {Tl<:Union{Integer,Tuple{Integer,Integer}}}
if !is_zero_diagonal_symmetric(A)
if !is_zero_diag_symmetric(A)
throw(ArgumentError("Matrix must be symmetric with zero diagonal"))
end

Expand Down Expand Up @@ -194,8 +193,7 @@ end
[TODO: Write here]

# Notes
[TODO: Write here. Proof sketch of bounds on Lipschitz and alpha constants, plus further
relevant references?]
[TODO: Refer to [`transfer_fidelity_deriv_bound`](@ref) for proof sketch of bounds]
"""
function check_state_transfer(g::AbstractGraph, args...)
if !is_simple(g)
Expand All @@ -215,7 +213,7 @@ function check_state_transfer(
epsilon::Real,
method::Symbol=:lipschitz_bb,
) where {Tl<:Union{Integer,Tuple{Integer,Integer}}}
if !is_zero_diagonal_symmetric(A)
if !is_zero_diag_symmetric(A)
throw(ArgumentError("Matrix must be symmetric with zero diagonal"))
end

Expand Down Expand Up @@ -352,12 +350,12 @@ function _optimize_state_transfer_impl(input::_StateTransferProblemInput)
end

if method == :lipschitz_bb
lipschitz_constant = maximum(norm.(eachcol(A)))
lipschitz_constant = transfer_fidelity_deriv_bound(A, 1)
solver = LipschitzBranchAndBound(
epsilon, lipschitz_constant; target=target_infidelity
)
elseif method == :alpha_bb
alpha = maximum(norm.(eachcol(A^2))) / 2
alpha = transfer_fidelity_deriv_bound(A, 2) / 2
solver = AlphaBranchAndBound(epsilon, alpha; target=target_infidelity)
else
throw(
Expand Down
File renamed without changes.
22 changes: 20 additions & 2 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# distributed except according to those terms.

"""
is_zero_diagonal_symmetric(A) -> Bool
is_zero_diag_symmetric(A) -> Bool

Check whether a matrix `A` is symmetric with a zero diagonal.

Expand All @@ -24,7 +24,7 @@ only consider here real-valued adjacency matrices) is required for the walk Hami
# Examples
[TODO: Write here]
"""
function is_zero_diagonal_symmetric(A::AbstractMatrix{<:Real})
function is_zero_diag_symmetric(A::AbstractMatrix{<:Real})
(m, n) = size(A)

return m == n && # Square
Expand Down Expand Up @@ -54,3 +54,21 @@ adjacency matrix of `g`.
function is_simple(g::AbstractGraph)
return !isdirected(g) && !has_self_loops(g)
end

"""
transfer_fidelity_deriv_bound(A, order) -> Float64

[TODO: Write here]

# Arguments
[TODO: Write here]

# Returns
[TODO: Write here]

# Notes
[TODO: Proof sketch of bound, plus further relevant references?]
"""
function transfer_fidelity_deriv_bound(A::Matrix{Float64}, order::Int)
return maximum(norm.eachcol(A^order))
end
Loading