Add conversion pattern for qecl.qec ops to convert-qecl-to-qecp pass#2754
Draft
joeycarter wants to merge 14 commits intomainfrom
Draft
Add conversion pattern for qecl.qec ops to convert-qecl-to-qecp pass#2754joeycarter wants to merge 14 commits intomainfrom
joeycarter wants to merge 14 commits intomainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2754 +/- ##
==========================================
+ Coverage 96.99% 97.01% +0.02%
==========================================
Files 165 166 +1
Lines 18503 18599 +96
Branches 1783 1788 +5
==========================================
+ Hits 17947 18044 +97
+ Misses 399 397 -2
- Partials 157 158 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
joeycarter
commented
Apr 29, 2026
Comment on lines
+372
to
+374
| x_tanner_row_idx_array, x_tanner_col_ptr_array = dense_tanner_graph_to_csc( | ||
| self.qec_code.x_tanner | ||
| ) |
Contributor
Author
There was a problem hiding this comment.
I think this is wrong, self.qec_code.x_tanner is the parity check matrix, and dense_tanner_graph_to_csc just converts the dense matrix to a CSC matrix. But in fact what we want is the adjacency matrix of the Tanner graph in CSC format. Let me fix this...
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.
Context: The
convert-qecl-to-qecpdialect-conversion pass requires a rewrite pattern forqecl.qecoperations.Description of the Change: This pass adds the
QecCycleOpConversionrewrite pattern to theconvert-qecl-to-qecpdialect-conversion pass. This pattern replacesqecl.qecops with a call to a subroutine that performs a single cycle of quantum error correction. The QEC protocol used here is the "textbook" protocol for a CSS code, which applies separate X and Z stabilizers to obtain the respective error-syndrome measurement (ESM) results in order to apply Z and X corrections, respectively. The decoding of the ESM is abstracted by theqecp.decode_esm_cssop, which will eventually be lowered to a runtime library call to perform the actually decoding (not yet implemented).This PR also adds a handful of utility functions to help with the conversion pattern, such as the function
qecp.tanner_graph_lib.dense_tanner_graph_to_csc(), which converts a dense parity-check matrix to the equivalent matrix in compressed sparse column (CSC) form.Example:
Before:
After (using Steane code):
[sc-115303]