7 unstable releases (3 breaking)
0.4.0-rc.2 | Sep 10, 2024 |
---|---|
0.3.1 | Sep 9, 2024 |
0.2.0 | Sep 3, 2024 |
0.1.1 | Aug 27, 2024 |
#1668 in Data structures
292 downloads per month
125KB
3K
SLoC
PortDiff
Data structure for fast local graph rewriting. Efficiently store and traverse hierarchies of deltas (diffs) of portgraphs.
Abstract
Graph rewriting is a powerful and general technique for optimisation problems on graphs. In the quantum computing domain, complete equational theories for quantum circuits provide strong theoretical foundations for rewriting. Unfortunately, rewriting-based circuit optimisation using a naive backtracking search is slow in practice, due to its poor scaling both in the number of rewrite rules and in the input circuit size, as well as being hard to parallelise.
We propose concurrent graph rewriting to address these issues, inspired from equality saturation for term rewriting. Rewrites can be applied in parallel on a persistent data structure. The data structure stores rewrites that can be applied either on the input circuit directly or following a sequence of previous rewrites. After an initial exploration phase, in which all possible rewrites are identified and added to the data structure, an extraction phase determines the set of rewrites that should be applied to optimise the circuit cost function. The exploration phase is designed to scale to large distributed systems, whilst the optimisation problem in the extraction phase can be solved using an off-the-shelf SMT solver.
Example
TODO
Dependencies
~3–4MB
~73K SLoC