Releases: XanaduAI/flamingpy
FlamingPy Release 0.10.1b1
New features since the last release
- Add
is_lc_equivalent
method to the EGraph class to check if two EGraphs are equivalent under local complementation, as well as related linear algebra helper functions insideutils\linalg.py
. #89, #117 (backward compatible) - Add functions
add_qubit
andremove_qubit
to theEGraph
class, which allow adding and removing nodes of the EGraph while updating internal attributes of the class. #100 (backward compatible) - Added Plotly backend for visualizing graph states. #103
- The I/O of frontend
simulations.py
has been improved. The input has been simplified to an intuitive set ofcode
,code_args
,noise
, andnoise_args
. As long as those combinations are valid, FlamingPy will run simulations and automatically set up the output file based on the input. #111 (backward incompatible)- An example run will be
which generates
python flamingpy/simulations.py -code "SurfaceCode" -code_args "{'distance':3, 'ec':'primal', 'boundaries':'open'}" -noise "CVLayer" -noise_args "{'delta':0.09, 'p_swap':0.25}" -decoder "MWPM" -decoder_args "{'weight_opts':{'method':'blueprint', 'integer':False, 'multiplier':1, 'delta':0.09}}" -trials 100
code,distance,ec,boundaries,noise,delta,p_swap,decoder,weight_opts,errors,trials,current_time,simulation_time,mpi_size SurfaceCode,3,primal,open,CVLayer,0.09,0.25,MWPM,{'method': 'blueprint', 'integer': False, 'multiplier': 1, 'delta': 0.09},10,100,00:15:50,0.370795,1
- An example run will be
- Users can now install FlamingPy from
git
withpip
. This also means installing throughpython setup.py egg_info
is now valid. #118 (backward compatible)
Bug fixes
dev_requirements
was updated with the latest version ofdocformatter
to prevent failing unit tests. #116
Improvements
- Cython example code,
cpp_mc_loop.pyx
, and its installation instructions were removed from everywhere as it was unused. New developers can refer to historic commits to help add new Cython files. #119
Documentation changes
give_for_devs.rst
was updated to match the latestdev_requirements
file and deletion of the Cython example. #116, #119
Contributors
This release contains contributions from (in alphabetical order):
Joost Bus, Luis Mantilla, Avhijit Nair, Nariman Saadatmand, smtsjhr, Ilan Tzitrin
See full commit details here.
FlamingPy Release 0.9.1b0
Bug fixes since the last release
rng
arguments are added, which were missing inCVMacroLayer
. #104- Fix incompatibility between CodeFactor and pylint CI check. #107
Improvements
- The FlamingPy logo has been updated. #109
Documentation changes
- Getting started page is now automatically run, preventing future out-of-date issues. #105
Contributors
This release contains contributions from (in alphabetical order):
Joost Bus, Josh Izaac, Luis Mantilla, Ilan Tzitrin
See full commit details here.
FlamingPy Release 0.9.0b0
New features since the last release
- A new noise model class,
CVMacroLayer
, is introduced as a replacement toreduce_macro_and_simulate
inmacro_reduce.py
. #57 (backward incompatible)- The process for running macronode-related simulations is considerably improved: the user needs only instantiate
CVMacroLayer
with the noise parameters ofCVLayer
. - The state labeling functions have been rewritten to be faster and more compact.
- The process for running macronode-related simulations is considerably improved: the user needs only instantiate
- Added option for rectangular cuboid surface codes, i.e. lattices with different aspect ratios. #61 (backward compatible)
- A new boundary option has been introduced for the
SurfaceCode
: the choice"periodic"
refers to a code with boundaries periodic in all (x, y, and z) directions, whereas codes with"toric"
have periodic boundaries in the x and y axis but not the z axis. #62 (backward compatible) - Add functions to create different graph states (star and complete graphs, ring graphs, linear clusters, and Bell pairs) in the new module
utils.graph_states
. #68 (backward compatible)
Bug fixes
- Tutorial files are appropriately ignored in the pylint configuration file. #65
- Small fix in
viz.draw_EGraph
that raised an error whenever a graph state with non-integer coordinates was plotted. #68 - Remove
p_err
as an argument of thesimulations.py
script as none of the existing objects/classes currently use the phase error probability. #99
Improvements
CVLayer
has been rewritten and refactored. #57- Lengthy functions have been broken up into more specialized methods.
- The class is initialized with all the noise model parameters, simplifying the signatures of the methods.
- An
apply_noise
method has been added to combine the procedures for noise sampling. - Docstrings were modified, and the public/private status of certain attributes was changed.
- The
final
sampling order has been removed, as it is equivalent toinitial
but slower.
- The
simulations.py
module has been made simpler and more general. #57- Functions within this module accept
code, noise, decoder
objects, as well as arguments (code_args, noise_args, decoder_args
) separately.
- Functions within this module accept
- Examples, benchmarks, and tests have been modified to take advantage of the simpler approach to noise application and the new
CVMacroLayer
. #57 - Added
fig, ax
returns for the draw methods inutils/viz.py
and some additional tests. #55 - Added tests for
EGraph
plots. #60 - Tests that required cpp libraries are skipped if they are not installed, hence avoiding failing tests from unmet dependencies. #65
- Unit tests have been re-grouped in individual sub-dirs inside
tests/
based on error correction and software layers. This helps manage and target each test unit. #65, #70 build_tests.yaml
workflow now supports executing unit tests in parallel usingpytest-xdist
package. GitHub runners have at least 2 processors, which helps speed up the pytest blocks by ~1.5 times in practice. #70- Pylint is pinned to stable version
pylint==2.14.0
and added todev_requirements.txt
. #76- pylint
no-self-use
tags are removed as this check has been removed from pylint (see here).
- pylint
- Added
.gitattributes
to the repository, so git automatically handles consistenteol
's for all commits and contributors across different operating systems. #78 - Increased the scope of
docformatter
to all.py
files in the repository. Also, increased the scope ofblack
formatter to include documentation files. #79 - Added automatically generated
.svg
files to gitignore. #84 - In
simulations.py
: #93- Directory argument
-d
was removed as it was unused. A working version can be added in the future. - We have removed reporting "decoding_total_time" as a more sophisticated time profiler, featuring systematic timing of all the script subroutines, is in work and will be added soon (follow its progress here).
- Directory argument
- Added the
error_probability
argument to thesimulations.py
script in order to be able to execute the simulations withiid
noise. An error is raised when iid noise is selected but err_prob is not passed as an argument. #99
Documentation changes
- A couple of .rst files have been changed in light of removing
macro_reduce.py
, shiftingCVLayer
to cv.ops, and addingCVMacroLayer
. #57 - Mention the new graph state functions from
flamingpy.utils.graph_states
in therun_graph_states.py
tutorial. #68 - A typo fix and minor changes for the README file. #80
- Non-Xanadu links now open in a new tab, while HTML references are listed scientific-style at the end of a file. #82
- Changed the math rendering Sphinx to MathJax (before equations were rendered as .png). #84
- A typo in the installation section has been fixed. #94
- Added our new forum links to
README.md
and documentation site. #96
Contributors
This release contains contributions from (in alphabetical order):
Joost Bus, Sebastián Duque Mesa, Luis Mantilla, Nariman Saadatmand, Ilan Tzitrin, WingCode
See full commit details here.
FlamingPy Release 0.8.2a5
New features since the last release
- Node and edge coloring can now be done based on any attribute and personalized colors can be defined via a dictionary: #32 (backward incompatible)
- The
EGraph
plot legend is not limited to the "state" attribute of the node but to any attribute. #32 (backward incompatible) - The
dims
attribute ofEGraph
has been removed. Its function is replaced by thedimensions
parameter that is passed to thedraw_EGraph
method. This method does not require theEGraph
to have adims
attribute defined anymore. #42 (backward incompatible) - Our frontend simulator script,
simulations.py
, now supports simple and highly-scalable MPI jobs throughmpi4py
libraries in a non-intrusive manner. The users who do not have or want MPI, can runsimulations.py
single-threaded as per usual without facing any errors. MPI users can speed up Monte Carlo samplings in EC steps virtually up to as many processors they can throw at it. The script support jobs both on local machines and large-scale clusters. #47 (backward compatible)- MPI users on their local machines can simply run the following for a 4-processor job:
mpirun -np 4 python flamingpy/simulations.py
- MPI users on their local machines can simply run the following for a 4-processor job:
Bug fixes
- Fixed the class inheretance diagram displayed in
fp.codes
. #41
Improvements
- The
draw_EGraph
function is refactored. #32- This reduces the function complexity; ensures nodes, edges, and general plot attributes are handled in different places; and allows for better code maintenance and readability.
display_axes
is changed toshow_axes
for consistency.
xlim
inviz.plot_Z_err_cond
is adjusted to the relevant domain when plotting the central peak. #33- Added
fig, ax
returns for the draw methods inutils/viz.py
. #33 - Both upper and lower axes limits can now be specified for
EGraph
plots. #42 - Improvements to the decoding example. #44
- Rename function and add dosctring.
- Decrease the size of markers for plotting stabilizer nodes.
- Improve the way to scatter stabilizers via specifying indices.
- Improved codefactor score for several key files. #51
- Pandas is removed from the package requirements. #63
mpi4py
is not a development requirement for Linux users. #64- CI test check that code executes properly with and without MPI. #64
Documentation changes
- A pipeline for adding tutorials to the docs was introduced. #24
- To add a tutorial, use the
gallery-item
directive from thexanadu-sphinx-theme
. For the new document to be compiled its filename should start withrun_
. Thumbnails will be created out of the first figure generated and stored intutorials/_out/images/thumb/
with the same name of the tutorial prepended withsphx_glr_
.
- To add a tutorial, use the
- Brief tutorials about graph states and error correction were added. #24
- An introduction to quantum error correction was added. #24
- Added UML class and package diagrams for
fp
page. #41 - Improved class inheritance diagram for
fp.codes
,fp.cv
, andfp.decoders
. #41 - Added
libopenmpi-dev
package to the apt list of.readthedoc.yml
to allow documentation successful builds after adding recentmpi4py
requirements. #59 - Adds a section to
guide_for_devs.rst
explaining how to install and use MPI along with FlamingPy. #64
Contributors
This release contains contributions from (in alphabetical order):
Joost Bus, Sebastián Duque Mesa, Luis Mantilla, Nariman Saadatmand, Ilan Tzitrin, Trevor Vincent
See full commit details here.
FlamingPy Release 0.7.0a4
New 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.
FlamingPy Release 0.6.1a3
New features since the last release
- Pauli noise: have added a new noise model sampling i.i.d Z error for each qubit. #8(backward incompatible)
- Fixed drawing of stabilizer graph for zero syndrome: #9(backward incompatible)
- Previously, the drawing function for a stabilizer graph relied on a non-documented feature. That is, it was assumed that when building the matching graph, all edges of a Networkx-based stabilizer graph were assigned a weight. This, however, was not a fair assumption for many reasons.
- As a solution, we have added a new method to the
SurfaceCode
class to draw the primal or dual stabilizer graph, which makes sure that each edge has a weight. Now, using that method, the user does not have to rely on unfair assumptions. - Furthermore, we added a quick check to not add any edges to the matching graph when the syndrome is trivial. In this case, the cost of decoding should be almost zero.
Improvements
-
A large number of linting corrections were made to improve the overall pylint report. These were mostly minor but essential modifications including restructuring, re-coding, optimization, updating
.pylintrc
, adding.coveragerc
. The code quality score is improved toA
for the released version. Check "Files changed" for details. #11 -
TODO
comments have been removed exclusively from files with low code quality grades. The Dev team has created tickets to be actioned for all removed TODO comments on separate (private) FlamingPy boards. #11 -
CONTRIBUTING.md
,code_of_conduct.md
, andCHANGLELOG.md
were imported and modified from the Strawberry Fields project. Dev team plans to extend these with customized details in future PRs. #11
Documentation changes
- Updated old FT-Stack links in docs header to correct FlamingPy pages. #7
- The new Xanadu Sphinx theme has been applied. Currently, most Xanadu OSS projects include their own version of the Xanadu Sphinx theme; however, the Xanadu Sphinx Theme repository is now publicly available and is the preferred way to access the Xanadu CSS theme and Sphinx directives. #17
- Deleted the
doc/xanadu_theme
directory - Updated
doc/requirements.txt
anddoc/conf.py
to reference and use the (centralized) Xanadu Sphinx Theme. - Replaced the Quantum Error Correction, Install, and FAQ static HTML files with reST ones.
- Deleted the
Contributors
This release contains contributions from (in alphabetical order):
Mikhail Andrenkov, Sebastián Duque Mesa, Nariman Saadatmand, Maxime Tremblay, Ilan Tzitrin
See full commit details here.
FlamingPy Release 0.4.9a1
Improvements since the last release
-
Relative paths cannot be used in README.md logos and were replaced with GitHub-hosted links. #5
-
C++ imports are now placed within
try
blocks to avoid interrupting non-compiled installations, such as the ones currently used by readthedocs. #5 -
Code coverage (quality) score was improved to a more acceptable
B-
level. #5
Bug fixes
-
Fixed a bug in
pull_request_template.md
. The template was not loading properly due to a whitespace problem. #2 -
Fixed a bug in
simulations.py
and related examples. See here for commit details. #6
Documentation changes
- Making Documentation more usable and consistent with other Xanadu projects #5:
- API details and inheritance diagrams should be now correctly displayed.
- "Edit on Github" links were fixed
- The general style and section structures made more consistent with the company requirements and other packages such as StrawberryFields.
- Fixed the documentation links in
README.md
- Minor updates to
doc/conf.py
,doc/dev_requirements.txt
, anddoc/Makefile
.
Contributors
This release contains contributions from (in alphabetical order):
Nariman Saadatmand, Ilan Tzitrin
See full commit details here.
FlamingPy Release 0.4.6a1
New features since the last private release
- This is the initial public release started from the private template and our sister project FT-Stack.
- The first Cython function for Monte Carlo sampling, mostly to provide cythonization samples and testbeds, has been added. See
cpp_mc_loop.pyx
andsimulations.py
for details. (backward incompatible)
Improvements
- More options for Installation from Source:
setup.py
was updated to provide a no-compilation option for only installing (purely) Python libraries and separate options to compilecmake
andcython
-based codes. See the new README.md for details.
Contributors
This release contains contributions from (in alphabetical order):
Nariman Saadatmand, Ilan Tzitrin