Skip to content

[Demo] qLDPC codes#1714

Open
obliviateandsurrender wants to merge 39 commits intodevfrom
qldpc-codes
Open

[Demo] qLDPC codes#1714
obliviateandsurrender wants to merge 39 commits intodevfrom
qldpc-codes

Conversation

@obliviateandsurrender
Copy link
Contributor

Title: Quantum low-density parity-check (qLDPC) codes for quantum error correction

Summary: Explain the motivation, construction and decoding of various types of qLDPC codes.

Relevant references: [Will add]

Possible Drawbacks: N/A

Related GitHub Issues:


If you are writing a demonstration, please answer these questions to facilitate the marketing process.

  • GOALS — Why are we working on this now?
    Eg. Promote a new PL feature or show a PL implementation of a recent paper.

    • To have resources regarding quantum error correction.
  • AUDIENCE — Who is this for?
    Eg. Chemistry researchers, PL educators, and beginners in quantum computing.

    • Error correction researchers and enthusiasts.
  • KEYWORDS — What words should be included in the marketing post?

    • qLDPC codes, quantum error correction
  • Which of the following types of documentation is most similar to your file?
    (more details here)

  • Tutorial
  • Demo
  • How-to

@obliviateandsurrender obliviateandsurrender requested review from a team as code owners March 3, 2026 12:48
@github-actions
Copy link

github-actions bot commented Mar 3, 2026

👋 Hey, looks like you've updated some demos!

🐘 Don't forget to update the dateOfLastModification in the associated metadata files so your changes are reflected in Glass Onion (search and recommendations).

Please hide this comment once the field(s) are updated. Thanks!

@obliviateandsurrender obliviateandsurrender removed request for a team March 3, 2026 12:49
@obliviateandsurrender obliviateandsurrender changed the base branch from master to dev March 3, 2026 13:04
@github-actions
Copy link

github-actions bot commented Mar 3, 2026

Your preview is ready 🎉!

You can view your changes here

Deployed at: 2026-03-19 23:40:26 UTC

Copy link
Collaborator

@Qottmann Qottmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice demo and overview of the qLDPC landscape, @obliviateandsurrender !

My main concerns are about being able to understanding the topics in a self-consistent way. Because the demo is covering a wide range of topics, it naturally cannot go into full details. I think sometimes some examples could do wonders though, so suggested to add some here and there.

Copy link
Collaborator

@Qottmann Qottmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a big fan of this demo, thanks so much @obliviateandsurrender !

Went over the demo again and left some comments and remaining questions.

I'm a bit confused about the part where you first introduce the CSS code, which kinda looks like a hypergraph product code (but I guess its not?)
would be good to clarify if and how they are related and make clear the distinctions

Once addressed, I think this is good for publication

# inherently fault-tolerant. For example a transversal :math:`T^\dagger` gate in the
# :math:`[[15, 1, 3]]` quantum `Reed-Muller code <https://errorcorrectionzoo.org/c/stab_15_1_3>`_
# corresponds to applying the :class:`~.pennylane.T` gate on all physical qubits, i.e.,
# :math:`T^\dagger_L = T^{\otimes 15}`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the dagger only on the left hand side?

Copy link
Contributor Author

@obliviateandsurrender obliviateandsurrender Mar 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

@Qottmann
Copy link
Collaborator

I think one crucial point to show / highlight is how the QLDPC codes we construct assume a non-local connectivity. Somehow visualizing this with a graph would be a super nice addition imo (could be done just with an image, or with code)

Copy link
Contributor

@daniela-angulo daniela-angulo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great demo!
The structure flows really well.
I left comments.

Copy link
Collaborator

@Qottmann Qottmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great demo @obliviateandsurrender !

just some small things left to polish, otherwise seems good to go as my major concerns are all lifted :)

Comment on lines +26 to +29
moving beyond strict nearest-neighbor constraints becomes crucial. Quantum low-density parity-check
(qLDPC) codes are particularly well-suited for this, as they can leverage high-connectivity between
qubits to drastically reduce qubit overheads, making them preferred codes of choice for the
photonic and neutral-atom platforms that offer such qubit connectivity. In this demo, we will cover
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this still sounds like it is not feasible for superconducting platforms, but thats not the case, they just have to do some extra work

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing it to hardware platforms to keep it neutral then.

Copy link
Contributor

@daniela-angulo daniela-angulo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments to polish minor things.
This is great work! very informative demo.

to have the following desirable properties:

1. A high encoding rate :math:`R = k / n`.
2. Local and low-weight parity checks (= measurements for error detection).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this equal sign a typo?

# For a CSS code on :math:`n` qubits with :math:`m_1` X-checks and :math:`m_2` Z-checks, each
# set is naturally represented as a classical parity-check matrix, :math:`H_X` and :math:`H_Z`
# respectively. Each defines a bipartite Tanner graph where check nodes connect to the qubit
# nodes they act on. Since both graphs share the same :math:`n` qubit nodes, they combine into
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# nodes they act on. Since both graphs share the same :math:`n` qubit nodes, they combine into
# nodes they act on. Since both graphs share the same :math:`n` qubit nodes, they are combined into

# logical qubits with distance :math:`d=\min(d_1,d_2,d_1^T,d_2^T)`. This means that
# the HGP codes achieve a constant encoding rate :math:`R=\Theta(1)`, but their distance
# grows only as :math:`d=\mathcal{O}(\sqrt{n})`, matching the surface code scaling. Note
# that, the distance computed here is the classical distance, which is not the same as
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# that, the distance computed here is the classical distance, which is not the same as
# that the distance computed here is the classical distance, which is not the same as

#
# To build truly scalable quantum computation devices, we need to at least achieve a linear
# distance scaling, i.e., :math:`d=\Theta(n)`. In recent years, there has been some progress
# in towards this goal, primarily through a series of breakthroughs, some of which are:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# in towards this goal, primarily through a series of breakthroughs, some of which are:
# towards this goal, primarily through a series of breakthroughs, some of which are:

# like detectives passing *messages* back and forth. A variable node sends a confidence level
# message, *"I am 84% sure that I have an error"*. The check node looks at the notes from all
# connected qubits, applies the parity rule, and replies *"Based on the group's evidence, adjust
# your confidence to 96%"*. Mathematically, these notes are Log-Likelihood Ratios (LLRs),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# your confidence to 96%"*. Mathematically, these notes are Log-Likelihood Ratios (LLRs),
# your confidence to 96%"*. Mathematically, these messages are Log-Likelihood Ratios (LLRs),

######################################################################
# In particular, even though the decoder did not perfectly undo the error,
# the logical state of the qubit is perfectly preserved because any residual
# that is a stabilizer acts as identity on the codespace.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# that is a stabilizer acts as identity on the codespace.
# that is a stabilizer acts as the identity on the codespace.

# for a given code by testing if (i) it preserves its *codespace*, i.e., the subspace
# stabilized by all stabilizer generators, and (ii) maps logical operators to valid
# logical operators. For example, we can check whether the :class:`~.pennylane.SWAP` gate is
# transversal for the previously constructed Toric code by first verifying the condition (i).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# transversal for the previously constructed Toric code by first verifying the condition (i).
# transversal for the previously constructed Toric code by first verifying condition (i).

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

Successfully merging this pull request may close these issues.

3 participants