Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can the package be extended to work with subsystem codes? #49

Open
qodesign opened this issue Feb 4, 2025 · 4 comments
Open

can the package be extended to work with subsystem codes? #49

qodesign opened this issue Feb 4, 2025 · 4 comments

Comments

@qodesign
Copy link

qodesign commented Feb 4, 2025

I've been using the package with (subspace) stabilizer codes and its speed and accuracy have so far been impressive.

How difficult would it be to add support for subsystem codes?

For example, the BBS code described here https://arxiv.org/abs/2002.06257 is a $[[21,4,3]]$ code.
Running QDistRnd with the stabilizers alone ($H_X,H_Z$) gives a distance of 2.

@LeonidPryadko
Copy link
Member

LeonidPryadko commented Feb 5, 2025

Glad you like the package. To work with a CSS subsystem code, where gauge generator matrices $G_X$ and $G_Z$ do not have orthogonal rows (and you are trying to find a minimum-weight $Z$-codeword), you need to construct the corresponding stabilizer generator matrix $H_X$, and use the matrices $(H_X,G_Z)$ to construct the $Z$ codewords as you would for a conventional stabilizer CSS code.

To this end, suppose the matrix $R=G_XG_Z^T$ has rank $p>0$. Do usual row transformations on $R$ to construct a row echelon form; denote the corresponding invertible row transformation matrix $U$ (so that $UR$ has row echelon form with first $p$ rows non-zero). Denote $U_p$ the matrix $U$ with the first $p$ rows removed. Then the check matrix is $H_X = U_p G_X$. For verification, $H_X$ should have rows orthogonal to those of $G_Z$, and the rank of $H_X$ should equal $\mathop{\rm rank}G_Z-p$.

Please let me know if this works for you.

@qodesign
Copy link
Author

qodesign commented Feb 5, 2025

I think I'm looking at this from a different angle. I can calculate $H_X,H_Z$ (stabilizers) and $L_X,L_Z$ (logicals I care about..."dressed logicals" to use bad lingo). So the distance would be the minimum weight of an error in $&lt;H_x,H_z,L_x,L_z&gt;$ not in $<H_x,H_z>$; so a possible modification to the package would be to allow optional $L_x,L_z$ inputs.

@LeonidPryadko
Copy link
Member

LeonidPryadko commented Feb 5, 2025

I see. Yes, I agree it would be a useful modification, and not difficult to do.

For now, if you can also calculate the gauge generator matrices $G_X$ and $G_Z$ (e.g., rows of $G_Z$ are orthogonal to combined rows of $H_X$ and $L_X$), you can just specify $H_X$ and $G_Z$ on the input to calculate the distance $d_Z$.

Alternatively, assuming you only need to deal with binary (qubit) CSS codes, you can use my package dist_m4ri. It can read MMX matrices (including logical generator matrices), implements the same random information set algorithm as the QDistRnd package, and also a deterministic distance calculation algorithm suitable for quantum LDPC codes with low weights of stabilizer generator rows -- the complexity scales like $n(w-1)^{d-1}$, where $n$ is the code length, $d$ is the distance in question, and $w$ is the maximum row weight of the check matrix (say, $H_X$ to calculate $d_Z$). If distance is too large, it can also guarantee the absence of codewords up to some weight.

@qodesign
Copy link
Author

qodesign commented Feb 5, 2025

Working with $(H_x,G_z)$ and $(H_z,G_x)$ (so two calls to DistRandCSS) is working fine...thanks for the suggestion.

I'll take a look at the dist_m4ri package a bit later but so far staying within GAP is more convenient since I define most of the codes there and QDistRnd is handling these well...I only checked codes of a few hundred qubits so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants