Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #445 +/- ##
==========================================
- Coverage 88.76% 88.56% -0.20%
==========================================
Files 44 46 +2
Lines 6308 6516 +208
==========================================
+ Hits 5599 5771 +172
- Misses 709 745 +36 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces functionality to perform the circuit extraction algorithm presented in Ref. [1] which allows to extract a circuit without ancillas from a strongly deterministic pattern.
Context
The main result of the paper is a procedure to perform the transformation
where$U_{\mathcal{P}}$ is the isometry implemented by the pattern $\mathcal{P}$ (a unitary when the pattern has the same number of inputs and outputs), $C$ is a Clifford map, and $V(\mathbf{\theta})$ is an ordered product of Pauli exponentials.
The structure of the extraction process reads as follows:
flowchart LR n0["Pattern"] n1["OpenGraph"] n2("Focused PauliFlow") subgraph s1["ExtractionResult"] s10("PauliExponentialDAG") s11("CliffordMap") end %% Junction node to merge arrows j1(( )) n3("Graphix circuit") n0 --> n1 n1 --> n2 n2 --> s10 n2 --> s11 %% Merging into the junction s10 --> j1 s11 --> j1 j1 --> n3 %% Styling the junction to be small style j1 fill:#000,stroke-width:0px,width:10pxThe transformation$O(N^3)$ Pauli-flow extraction algorithm in Ref. [2] always returns focused Pauli flows, contrary to the $O(N^5)$ version in Ref. [1] which requires an additional post-processing to focus the correction function.
Pattern->OpenGraph->Focused PauliFlowalready exists in the current implementation of Graphix. TheExtractionResultis the output of the algorithm which is denoted "PdDAG" in [1]. In particular:PauliExponentialDAGis a mapping between measured nodes in the open graph and Pauli exponentials, and a partial order between the measured node (the flow's partial order). Pauli exponentials are a pair of anAngle(the node's measurement angle) and aPauliStringacting on the output nodes of the open graph. The corresponding Pauli string is obtained from the focused flow's correction function.Clifford Mapdescribes a linear transformation between the space of input qubits and the space of output qubits. It is encoded as a map from the Pauli-group generators (The$Z$ -map is also obtained from the focused flow's correction function. The $X$ -map is obtained from the focused flow's correction function of the extended open graph (see Def. C.3 in [1]).
Summary of changes
Added the following to
graphix.flow.core.PauliFlow:is_focused: (method) Verifies if a Pauli flow is focused according to definition 4.3 in Ref. [1].extract_circuit: (method) Returns aExtractionResultobject.pauli_strings: (cached_property) Associates a Pauli string to every corrected node in the flow's correction function.Added new module
graphix.circ_ext.extractionFocused PauliFlow->ExtractionResult.ExtractionResultPauliStringPauliExponentialPauliExponentialDAGCliffordMapAdded new module
graphix.circ_ext.compilationExtractionResult->Graphix circuit.PauliExponentialDAG->Graphix circuitis done with the naive "star" construction (see [3]).CliffordMap->Graphix circuitrelies onstimand currently only supports unitaries (i.e., patterns with the same number of inputa and outputs). To avoid introducing a dependency onstim, theStimCliffordPassis implemented in the external plugingraphix-stim-compiler. This compilation pass together with the tooling introduced in this PR allow to do a round-trip conversion circuit -> MBQC pattern -> circuit.We note that all the transformations in the figure work with parametric objects as well.
References
[1] Simmons, 2021, arXiv:2109.05654.
[2] Mitosek and Backens, 2024, arXiv:2410.23439.
[3] https://quantumcomputing.stackexchange.com/questions/5567/circuit-construction-for-hamiltonian-simulation/11373#11373