FlamingPy Release 0.7.0a4
Pre-releaseNew features since the last release
- The voxel plotting function has been refactored to allow for easy location in space as well as resizing (the latter being important for stabilizers at boundaries that are represented by incomplete cubes). These changes are reflected in two new functions in the
viz
module: plot_cube and cuboid_data. #20(backward incompatible) Union-Find
--- a fast new decoder based on arXiv:1709.06218 and arXiv:1703.01517 --- has been implemented. Now the user may change between the existing minimum-weight perfect matching decoder ("MWPM" setting) and Union-Find ("UF" setting). We have also temporarily disabled the "both"ec
option inSurfaceCode
while we investigate a bug, and make some further minor changes related to the Union-Find decoder. #37(backward incompatible)
Bug fixes
- Voxel plots of dual stabilizers used to be drawn incorrectly since only integer locations and cube sizes were allowed. Furthermore, no cube could be placed in a coordinate less than zero. These have been fixed. #20
- The occasionally failing
test_hybridize
intest_graphstates.py
has been fixed. #25 - The
lemon
backend used for MWPM decoding was performing worse compared to the other matching backends. The problem was that missing edges in the graph were associated with 0-entries in the adjacency matrix, leading to them always having the minimal weight and making them indistinguishable from edges with an actual weight of 0. The missing edges are now assigned a very large weight. #28
Improvements
-
Tests were added to improve the overall test coverage. These included changes to
.coveragerc
as well as the refactoring of some examples to allow for proper
imports from testing modules. Code coverage is now above 95% and
the overall fail threshold was bumped accordingly. #14 -
The visuals produced by FlamingPy have been improved and made more consistent. #20
- The figure, marker, line, label and title size, font family, and colormaps were modified.
When drawing, FlamingPy no longer changes the global matplotlib'srcParams
,
but usesrc_context
together with the plot parameters defined within theviz
module.
To customize such parameters, simply use the following and every new plot produced by FlamingPy will use them accordingly.
from flamingpy.utils.viz import plot_params as fp_plot_params fp_plot_params["font.size"] = 20
- Most functions in the visualization module now return the figure and axes for further processing.
- The offered method to draw voxels is much clearer and has an easier-to-use API.
- Graphs of decoding objects (stabilizer and matching graphs) are prettier and easier
to parse, thanks partially to a new function,draw_curved_edges
. draw_adj
anddraw_SCZ
wrapper methods were added toEGraph
andCVLayer
, respectively.
- The figure, marker, line, label and title size, font family, and colormaps were modified.
-
Several changes were made to improve the visualization of MWPM decoding for debugging and understanding purposes. #23
- A function (
draw_decoding
) was added to theviz
module and new options were added to thecorrect
function in the decoder module to be able to simply plot all decoding objects (stabilizer graph, matching graph, matching, syndrome plot) in sync with the actual error correction trial. - The appearance and presence of node labels (specifically the virtual nodes of the matching graph) were fixed.
- The
label_cubes
argument was renamed to the more accuratelabel_stabilizers
. - The argument
show_matching
was added to the drawing options to be able to turn the matching plot on or off. - One can now plot a non-NetworkX matching graph (by automatic conversion to a NetworkX graph).
- The above changes allowed for a significant simplification of the decoding example.
- A function (
-
The PR template has been changed to inform the user about the 95%+ codecov requirement. #25
-
CVLayer
has been modified to allow for instantiation with a code object
in addition to anEGraph
. This makes more semantic sense (applying a noise model
to a code), making it conceptually easier for the user and avoiding noise layers having to reference the internal mechanics of codes. #25 -
codecov.yml
was introduced to customize codecov automated tests. For this version, we have added athreshold: 0.5%
to avoid undesired delta failures due to just removing a few lines, etc. #25 -
The Walrus has been re-added as a dependency and its functions are used instead of a verbatim
copy of the code. #27 -
Since
retworkx
andlemon
are the fastest backends andretworkx
follows the same convention
asnetworkx
, the default backend for stabilizer graphs and MWPM has been changed toretworkx
. #28 -
Some more tests were added to
test_matching.py
to compare the output of different matching backends. #28 -
The display_axes option has been changed to show_axes and title to show_title for consistency. The show_title option is now respected. #37
-
Decoders have become more organized and compartmentalized. #37
- They are located in a directory with their name, with separate modules for decoding objects and algorithms. The latter --
algos.py
-- contains
a cumulative decoding function combining all the steps. This function is imported bydecoder.py
, which is now a more general module. - The
draw_decoding
function inviz
can now accommodate plotting generic decoding procedures: a stabilizer graph, a syndrome plot, and the recovery.
- They are located in a directory with their name, with separate modules for decoding objects and algorithms. The latter --
Documentation changes
- The documentation now mentions that
retworkx
is the default backend. #28
Contributors
This release contains contributions from (in alphabetical order):
Sebastián Duque Mesa, Priya Nadkarni, Nariman Saadatmand, Maxime Tremblay, Ilan Tzitrin
See full commit details here.