Recent Releases of graphix
graphix - Release 0.3.2
[0.3.2] - 2025-08-12
Added
320: Method for
Pattern:compose310: Method for
OpenGraph:compose277: Methods for pretty-printing
Pattern:to_ascii,to_unicode,to_latex.300: Branch selection in simulation: in addition to
RandomBranchSelectorwhich corresponds to the strategy that was already implemented, the user can useFixedBranchSelector,ConstBranchSelector, or define a custom branch selection by deriving the abstract classBranchSelector.312: The separation between
TensorNetworkBackendand backendsthat operate on a full-state representation, such as
StatevecBackendandDensityMatrixBackend, is now clearer with the introduction of the abstract classesDenseStateBackendandDenseState, which derive fromBackendandBackendState, respectively.StatevecBackendandDensityMatrixBackendinherit fromDenseStateBackend, whileStatevecandDensityMatrixinherit fromDenseState. Note that the class hierarchy ofBackendStatemirrors that ofBackend.322: Added a new
optimizationmodule containing:- a functional version of
standardizethat returns a standardized pattern as a new object; - a function
incorporate_pauli_resultsthat returns an equivalent pattern in which theresultsare incorporated into measurement and correction domains.
The resulting pattern is suitable for flow analysis. In particular, if a pattern has a flow, it is preserved byperform_pauli_measurementsafter applyingstandardizeandincorporate_pauli_results.
- a functional version of
Fixed
314, #322: The method
Pattern.standardize()now correctly returnsan equivalent pattern even in the presence of C commands, or raises an error if no standardized form exists.
277: The result of
repr()forPattern,Circuit,Command,Instruction,Plane,AxisandSignis now a valid Python expression and is more readable.235, #252, #273: The open graph representation is now compatible
with pyzx 0.9, and conventions have been fixed to ensure that the semantics is preserved between circuits, ZX graphs, open graphs and patterns.
302, #308, #312:
Pattern,Circuit,PatternSimulator, andbackends are now type-checked.
Changed
277: The method
Pattern.print_patternis now deprecated.300:
pr_calcparameter is removed in back-end initializers.The user can specify
pr_calcin the constructor ofRandomBranchSelectorinstead.300:
rngis no longer stored in the backends; it is now passed asan optional argument to each simulation method.
261: Moved all device interface functionalities to an external
library and removed their implementation from this library.
314, #322: The method
Pattern.standardize()now places C commandsafter X and Z commands, making the resulting patterns suitable for flow analysis.
Theflow_from_patternfunctions now fail if the input pattern is not strictly standardized (as checked byPattern.is_standard(strict=True), which requires C commands to be last).
Note: the methodperform_pauli_measurementsstill places C commands before X and Z commands.312: Backend's
Statehas been renamed toBackendStateto avoida name conflict with the
Stateclass defined ingraphix.states, which represents the state of a single qubit.312:
Backend[StateT_co]andDenseStateBackend[DenseStateT_co]are now parameterized by covariant type variables, allowing subclasses to narrow the type of the state field to match their specific state representation. Covariance is sound in this context because the classes are frozen, and it ensures that
Backend[BackendState]is a supertype of all backend classes.
- Python
Published by shinich1 6 months ago
graphix - Release 0.3.1
[0.3.1] - 2025-04-21
Added
- Parameterized circuits and patterns: angles in instructions and measures can be expressions with parameters created with
parameter.Placeholderclass. Parameterized circuits can be transpiled and parameterized patterns can be optimized (standardization, minimization, signal shifting and Pauli preprocessing) before being instantiated with the methodsubs. - An additional package, graphix-symbolic, provides parameters that suppor symbolic simulation, and the resulting (symbolic) state vector or density matrix can be instantiated with the method
subs(probabilities cannot be computed symbolically, sopr_calc=Falseshould be passed to simulators for symbolic computation, and an arbitrary path will be computed).
Fixed
- #254: Fix examples in
opengraphandpyzxmodules - #264: Fixed type warnings
Changed
- #262: Simplify
graphsimand deprecatedrustworkxsupport for simplicity.
- Python
Published by shinich1 10 months ago
graphix - Release 0.3.0
[0.3.0] - 2025-02-04
- Deprecate support for python 3.8
- Improved Ruff setting for better and consistent code quality
Changed
- Now variables, functions, and classes are named based on PEP8.
KrausChannelclass now usesKrausDataclass (originallydict) to store Kraus operators.- Deprecated support for Python 3.8.
- Major refactoring of the codebase, especially in the
patternandtranspilermodules.- Removed
optoption forCircuit.transpilemethod. - Removed
pattern.LocalPatternclass and associtedlocaloptions inPattern.standardizeandPattern.shift_signalsmethods.
- Removed
- Python
Published by shinich1 about 1 year ago
graphix - Release 0.2.16
[0.2.16] - 2024-08-26
This version introduces several important interface changes, aimed at secure data manipulation and improved code maintainability.
More changes are expected in version 0.3.0, to reach a milestone of stable and reliable MBQC pattern expression, manipulation and simulation library around which other packages can be built.
Added
- Added classes for a standardized definition of pattern commands and circuit instructions (
graphix.commands,graphix.instructions). This is for data validation, readability and maintainability purposes. Preiously, the commands and instructions were represented as raw data inside lists, which are prone to errors and not readable. by @thierry-martinez - The following changes were made (#155):
- Added
class Commandand all its child classes that represent all the pattern commands. - Added
class Instructionfor the gate network expression in quantum circuit model. Every instruction can be instanciated using this class by passing its name as defined in the EnumInstructionName.
- Added
class graphix.OpenGraphto transpile between graphix patterns and pyzx graphs.class graphix.pauli.PauliMeasurementas a new Pauli measurement checks (used inpattern.perform_pauli_measurements).
Fixed
- Typos and bugs in docs fixed.
Changed
- Entire package was updated to follow the new data classes, e.g.
pattern.add(["M", 0, "XY", 0, [], []])->pattern.add(M(node=0)). - Measure commands do no longer carry vertex operators (
vop): Clifford gates can still be applied to measures with the methodM.clifford, which returns a new measure commands where plane, angle and domains has been updated. - X- and Z-domains for measures and domain for correction commands are now set of nodes (instead of lists).
- Migrated style checks to
ruff, and corresponding CI is set up. - Codecov is now set up for coverage report on each PR and CI is set up.
Contributors
@thierry-martinez @EarlMilktea @wlcsm @vincentmr
- Python
Published by shinich1 over 1 year ago
graphix - Release 0.2.15
Added
- python 3.12 support
- Arbitrary states now allowed for initializing input nodes in state vector
and density matrix backends. use
input_stateoptional argument inStatevectorandDensityMatrixbackends. - Simple planar state class
graphix.states.PlanarStatefor states on one of the three planes (XY, XZ, YZ).
Fixed
Changed
- Basic states such as |0>, |+> states are now defined in
states.BasicStatesand no longer inops.States.
- Python
Published by shinich1 over 1 year ago
graphix - Release 0.2.13
Fixed
- Build configuration for PyPI (https://github.com/TeamGraphix/graphix/commit/54eb821e4b77f03df10ebba9d443e227921d4cda)
- Python
Published by shinich1 almost 2 years ago
graphix - Release 0.2.12
[0.2.12] - 2024-05-11
Added
- Transpiled circuits can now have "measure" gates, introduced with
the
circ.m(qubit, plane, angle)method. The measured qubit cannot be used in any subsequent gate. - Added
gflow.find_pauliflow,gflow.verify_pauliflowandpauliflow_from_patternmethods (#117) - Pauli-flow finding algorithm (#117)
- workflow for isort, codecov (#148, #147)
Fixed
- Fix output node order sorting bug in Pauli preprocessing
measure_pauli(#145)
Changed
- The transpiler now returns a
TranspileResultdataclass: the pattern is available in thepatternfield, and the fieldclassical_outputscontains the index where the classical measures can be found in theresultsarray of the simulator. - The circuit simulator now returns a
SimulateResultdataclass: the state vector is available in thestatevecfield, and the fieldclassical_measurescontains the results of the measure gates. - Patterns are now allowed to measure all their nodes, and have an empty output set.
- Completely migrated to pytest, no
unittestusage remains (#134)
Contributors
@thierry-martinez @d1ssk @mgarnier59 @EarlMilktea @nabe98
- Python
Published by shinich1 almost 2 years ago
graphix - Release 0.2.11
[0.2.11] - 2024-03-16
Added
- Added flow and gflow verifiers (#99).
- Added
gflow.flow_from_patternmethod.
Fixed
- Fixed bug in index permutation within
linalg.MatGF2andgflow.find_gflow. - Fixed
gflow.gflow_from_patternmethod.
Changed
- Renamed
flow-related methodsgflow.flowandgflow.gfloware nowgflow.find_flowandgflow.find_gflow, respectively.
Patternclass stability upgrade:Pattern.seqis renamed into a private fieldPattern.__seqandPattern.Nnodeis now a read-only property.Patternconstructor now only takes an optional list ofinput_nodes, and can only be updated viaaddandextend.Patternare now iterable andlenis now defined for patterns: we should writefor command in pattern:instead offor command in pattern.seq:andlen(pattern)instead oflen(pattern.seq).Ncommands are no longer added byPatternconstructor and should be added explicitly after the instantiation.
GraphVisualizerupgrade to offer more options for inspecting correction sets.- Changed the behavior of visualization in the
GraphVisualizerclass. Prepared avisualizemethod that visualizes based on the graph only, and avisualize_from_patternthat visualizes based on the pattern. Both search for gflow or flow, and if found, plot them. If not found, in the case of from the graph, only the graph is drawn, and in the case of from the pattern, both the graph and all correction sets are drawn.
- Changed the behavior of visualization in the
Contributors
@thierry-martinez @d1ssk @mgarnier59 @masa10-f @king-p3nguin
- Python
Published by shinich1 almost 2 years ago
graphix - Release 0.2.10
Added
- Added
rustworkxas a backend for the graph state simulator- Only
networkxbackend was available for pattern optimization. By setting theuse_rustworkxoption to True while usingPattern.perform_pauli_measurements(), graphix will run pattern optimization usingrustworkx(#98)
- Only
- Added
.ccxand.swapmethods tographix.Circuit.
Fixed
- Fixed gflow-based graph visualization (#107)
- Python
Published by shinich1 about 2 years ago
graphix - Release 0.2.9
Added
- internal updates of gflow and linear algebra functionalities:
- A new option
modeingflow.gflow, specifying whether to obtain all possible maximally delayed gflow or not (#80) - New
MatGF2class that computes elementary operations and Gauss-Jordan elimination on GF2 field, for faster gflow-finding (#80)
- A new option
- Added benchmarking page on docs (#89).
- Added graphix-perceval to
[extra]option of thepipinstallation.
Changed
- Removed
z3-solverand addedgaloisandsympyinrequirements.txt(#80)
Removed
- Removed
timeoutoptional arguments fromgflow.flowandgflow.gflow.
Fixed
- Bugfix conditional branch in
gflow.gflowaux(#80)
- Python
Published by shinich1 about 2 years ago
graphix - Release 0.2.8
Added
- Add support for python 3.11
- Python
Published by shinich1 over 2 years ago
graphix - Release 0.2.7
[0.2.7] - 2023-10-06
Added
- Visualization tool of resource state for a pattern, with flow or gflow structures (#78)
- Visualize the resource state by calling
Pattern.draw_graph() - Tool to extract fusion network from the resource state of a pattern (#87).
- Python
Published by shinich1 over 2 years ago
graphix - Release 0.2.6
[0.2.6] - 2023-09-29
Added
input_nodesattribute added to the pattern class (#88)leave_inputoptional argument toPattern.perform_pauli_measurements()which leaves the input qubits unmeasured during the optimization.
Changed
- bump networkx version to 3.* (#82)
(to be added to changelog.md in the next version.)
- Python
Published by shinich1 over 2 years ago
graphix - Release 0.2.5
[0.2.5] - 2023-08-17
Added
- Fast alternative to partial trace (
Statevec.remove_qubit) for a separable (post-measurement) qubit (#73) by @nabe98
Changed
StatevectorBackendnow usesStatevec.remove_qubitafter each measurement, instead of performingptraceafter multiple measurements, for better performance. This keeps the result exactly the same (#73)- bump dependency versions for docs build (#77)
- Python
Published by shinich1 over 2 years ago
graphix - Release 0.2.4
Added
- Interface to run patterns on the IBMQ devices. (see PR) (#44) by @d1ssk
- Python
Published by shinich1 over 2 years ago
graphix - Release 0.2.3
Added
- Quantum classifier demo (#57) by @Gopal-Dahale
Changed
- fixed a bug in a code snippet isn docs (#59), as pointed out by @zilkf92
- fixed issue building docs on readthedocs (#61)
- fixed bug in pauli preprocessing routine and graph state simulator (#63)
- Second output of
pattern.pauli_nodes(non_pauli_nodelist) is now list of nodes, not list of lists (commands).
- Python
Published by shinich1 over 2 years ago
graphix - Release 0.2.2
Added
- Fast pattern standardization and signal shfiting with
pattern.LocalPatternclass (#42), performance report at #43 - Defaulted local pattern method for
graphix.Pattern.standardize()andgraphix.Pattern.shift_signals(). Note the resulting pattern is equivalent to the output of original method. - Automatic selection of appropriate tensor network graph state preparation strategy
graph_prep="auto"argument for instantiation ofTensorNetworkBackend(#50)
Changed
- option
graph_prep="opt"forgraph_prepkwarg ofTensorNetworkBackend(#50) will be deprecated, and will be replaced bygraph_prep="parallel", as we identified thatparallelpreparation is not always optimal.
Contributors
@masa10-f @d1ssk @shinich1
- Python
Published by shinich1 over 2 years ago
graphix - Release 0.2.1
Changed
- Move import path of
generate_from_patternfromgraphix.gflowtograhpix.generator(#40) - Rename
Pattern.get_measurement_ordertoPattern.get_measurement_commands(#40) - Modify
Pattern.get_meas_planemethod to work for Clifford-decorated nodes (#40)
Fixed
- Fix QFT circuits in examples (#38)
- Fix the stability issue of
Pattern.minimize_spacemethod which sometimes failed to give theoretical minimum space for patterns with flow (#40)
- Python
Published by shinich1 almost 3 years ago
graphix - Release 0.2.0
Changes
- Restructured tensor-network simulator backend for more optimized contraction (#32)
- Additional required modules:
quimbandautorayfor more performant TN backend (#32) - Fast circuit translation for selected types gates and circuits (#16)
Bug fixes
- Treatment of isolated node in
perform_pauli_measurements()method (#36)
- Python
Published by shinich1 almost 3 years ago
graphix - Release 0.1.2
Bug fixes
- Fix manual input pattern (#11)
Others
- added QAOA demo to documentation and improved readme
- Now ready for arXiv posting
- Python
Published by shinich1 about 3 years ago
graphix - Release 0.1.1
Bug fixes
- nested array error in numpy 1.24 (deprecated from 1.23.*) fixed and numpy version changed in requirements.txt (#7)
- circuit.standardizeandtranspile() error fixed (#9)
- Python
Published by shinich1 about 3 years ago