Skip to content
Open
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
3 changes: 2 additions & 1 deletion CondaPkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ scipy = ""
pymatching = ""
ldpc = ">=2.2.8"
sinter = ">=1.14"
stim = ">=1.14"
stim = ">=1.14"
fusion-blossom = ">=0.2.13"
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,36 @@ julia> syndrome = PyArray(H)*error .% 2

julia> decoding = bpd.decode(np.array(syndrome))
Python: array([0, 1, 0])
```
```

## fusion-blossom

The python fusion-blossom module is immediately available:

```
julia> using PyQDecoders

julia> PyQDecoders.fb
Python: <module 'fusion_blossom' from ...>
```

Running the example from `fusion-blossom`'s original [example qec codes demo](https://tutorial.fusionblossom.com/demo/example-qec-codes.html):

```
julia> using PyQDecoders: fb;

julia> code = fb.CodeCapacityPlanarCode(d=11, p=0.05, max_half_weight=500);

julia> syndrome = code.generate_random_errors(seed=1000);

julia> initializer = code.get_initializer();

julia> solver = fb.SolverSerial(initializer);

julia> solver.solve(syndrome);

julia> subgraph = solver.subgraph();

julia> println("Minimum Weight Parity Subgraph (MWPS): ", subgraph)
Minimum Weight Parity Subgraph (MWPS): [14, 24, 26, 34, 66, 68, 93, 107, 144, 159, 161, 169]
```
2 changes: 2 additions & 0 deletions src/PyQDecoders.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const np = PythonCall.pynew()
const pm = PythonCall.pynew()
const ldpc = PythonCall.pynew()
const ldpccodes = PythonCall.pynew()
const fb = PythonCall.pynew()

function __init__()
PythonCall.pycopy!(sp, PythonCall.pyimport("scipy"))
Expand All @@ -15,6 +16,7 @@ function __init__()
PythonCall.pycopy!(pm, PythonCall.pyimport("pymatching"))
PythonCall.pycopy!(ldpc, PythonCall.pyimport("ldpc"))
PythonCall.pycopy!(ldpccodes, PythonCall.pyimport("ldpc.codes"))
PythonCall.pycopy!(fb, PythonCall.pyimport("fusion_blossom"))
end

end # module
Loading