Skip to content

Commit 93e4bec

Browse files
authored
🧹rm upper_bound as the original algorithm is true minimum distance algo and didn't support upper_bound calculation, use dedicated algorithms to calculate upper bound in future (#530)
1 parent 810c505 commit 93e4bec

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

‎ext/QuantumCliffordJuMPExt/min_distance_mixed_integer_programming.jl‎

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -190,20 +190,11 @@ function distance(code::AbstractECC, alg::DistanceMIPAlgorithm)
190190
)
191191
end
192192
# Return appropriate result based on configuration
193-
if alg.upper_bound
194-
if alg.opt_summary
195-
max_entry = argmax(x -> x.weight, values(weights))
196-
return (max_entry.weight, max_entry.summary)
197-
else
198-
return maximum(values(weights))
199-
end
193+
if alg.opt_summary
194+
min_entry = argmin(x -> x.weight, values(weights))
195+
return (min_entry.weight, min_entry.summary)
200196
else
201-
if alg.opt_summary
202-
min_entry = argmin(x -> x.weight, values(weights))
203-
return (min_entry.weight, min_entry.summary)
204-
else
205-
return minimum(values(weights))
206-
end
197+
return minimum(values(weights))
207198
end
208199
end
209200

‎src/ecc/ECC.jl‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ Used with [`distance`](@ref) to select MIP as the method of finding the distance
124124
$FIELDS
125125
"""
126126
@kwdef struct DistanceMIPAlgorithm <: AbstractDistanceAlg
127-
"""if `true` (default=`false`), uses the provided value as an upper bound for the code distance"""
128-
upper_bound::Bool=false
129127
"""index of the logical qubit to compute code distance for (nothing means compute for all logical qubits)"""
130128
logical_qubit::Union{Int, Nothing}=nothing
131129
"""type of logical operator to consider (:X or :Z, defaults to :X) - both types yield identical distance results for CSS stabilizer codes."""
@@ -137,9 +135,9 @@ $FIELDS
137135
"""time limit (in seconds) for the MIP solver's execution (default=60.0)"""
138136
time_limit::Float64=60.0
139137

140-
function DistanceMIPAlgorithm(upper_bound, logical_qubit, logical_operator_type, solver, opt_summary, time_limit)
138+
function DistanceMIPAlgorithm(logical_qubit, logical_operator_type, solver, opt_summary, time_limit)
141139
logical_operator_type ∈ (:X, :Z) || throw(ArgumentError("`logical_operator_type` must be :X or :Z"))
142-
new(upper_bound, logical_qubit, logical_operator_type, solver, opt_summary, time_limit)
140+
new(logical_qubit, logical_operator_type, solver, opt_summary, time_limit)
143141
end
144142
end
145143

0 commit comments

Comments
 (0)