Skip to content

Commit 924bdf3

Browse files
authored
Merge pull request #55 from esabo/ben/bug-fixes
HM fix, update GH actions
2 parents 82d8d09 + d4b95ec commit 924bdf3

File tree

3 files changed

+9
-17
lines changed

3 files changed

+9
-17
lines changed

.github/workflows/Tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
push:
99
branches:
1010
- master
11-
# tags: '*'
12-
# pull_request:
11+
tags: '*'
12+
pull_request:
1313

1414
concurrency:
1515
# Skip intermediate builds: always.
@@ -25,7 +25,7 @@ jobs:
2525
fail-fast: false
2626
matrix:
2727
version:
28-
- '1.9'
28+
- '1.11'
2929
os:
3030
- ubuntu-latest
3131
arch:

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
packages: xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev xsettingsd x11-xserver-utils
2626
- uses: julia-actions/setup-julia@latest
2727
with:
28-
version: '1.9'
28+
version: '1.11'
2929
- uses: julia-actions/cache@v1
3030
with:
3131
# cache-name: master-docs

src/Quantum/homological_measurements.jl

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,17 @@ All paramaters are aligned with their respective papers.
105105
- `r` - used for `:Cohen`
106106
- `improve_cycles` - used for `IBM`
107107
- `remove_and_improve_cycles` - used for `IBM`, supersedes previous parameter
108+
- `log_checking` - set to false to intentionally use an `L` that isn't a logical
108109
"""
109110
function homological_measurement(S::AbstractStabilizerCodeCSS, L::CTMatrixTypes; style::Symbol =
110111
:Xanadu, r::Int = 1, max_iters::Int = 50000, cellulate::Bool = false, improve_cycles::Bool =
111-
true, remove_and_improve_cycles::Bool = false)
112+
true, remove_and_improve_cycles::Bool = false, log_checking::Bool = true)
112113

113114
is_positive(r) || throw(DomainError(r, "Must be a positive integer."))
114115
is_positive(max_iters) || throw(DomainError(max_iters, "Must be a positive integer."))
115116
L_red = _remove_empty(L, :rows)
116117
nrows(L_red) == 1 || throw(ArgumentError("Requires a single logical of the code."))
117-
is_logical(S, L_red) || throw(ArgumentError("The input matrix is not a logical of the code."))
118+
is_logical(S, L_red) || !log_checking || throw(ArgumentError("The input matrix is not a logical of the code."))
118119
F = field(S)
119120
Int(order(F)) == 2 || throw(ArgumentError("Only defined for binary codes."))
120121
n = length(S)
@@ -164,19 +165,10 @@ function homological_measurement(S::AbstractStabilizerCodeCSS, L::CTMatrixTypes;
164165
end
165166

166167
r = ceil(Int, 1 / Cheeger_constant(_Flint_matrix_to_Julia_int_matrix(HX)))
167-
168-
if type == :X
169-
return _thickened_cone(S, HX, HZ, f1, f0, type, r)
170-
else
171-
return _thickened_cone(S, HZ, HX, f1, f0, type, r)
172-
end
168+
return _thickened_cone(S, HX, HZ, f1, f0, type, r)
173169
elseif style == :Cohen
174170
HZ = zero_matrix(F, 0, size(HX, 2))
175-
if type == :X
176-
return _thickened_cone(S, HX, HZ, f1, f0, type, r)
177-
else
178-
return _thickened_cone(S, HZ, HX, f1, f0, type, r)
179-
end
171+
return _thickened_cone(S, HX, HZ, f1, f0, type, r)
180172
else
181173
throw(ArgumentError("Unknown `style` parameter $style"))
182174
end

0 commit comments

Comments
 (0)