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

[FTQC] Add Lattice class to ftqc module #6958

Merged
merged 49 commits into from
Feb 28, 2025
Merged

Conversation

multiphaseCFD
Copy link
Member

@multiphaseCFD multiphaseCFD commented Feb 12, 2025

Before submitting

Please complete the following checklist when submitting a PR:

  • All new features must include a unit test.
    If you've fixed a bug or added code that should be tested, add a test to the
    test directory!

  • All new functions and code must be clearly commented and documented.
    If you do make documentation changes, make sure that the docs build and
    render correctly by running make docs.

  • Ensure that the test suite passes, by running make test.

  • Add a new entry to the doc/releases/changelog-dev.md file, summarizing the
    change, and including a link back to the PR.

  • The PennyLane source code conforms to
    PEP8 standards.
    We check all of our code against Pylint.
    To lint modified files, simply pip install pylint, and then
    run pylint pennylane/path/to/file.py.

When all the above are checked, delete everything above the dashed
line and fill in the pull request template.


Context:

[SC-84004]

Fault-Tolerant Quantum Computing (FTQC) and Measurement-Based Quantum Computing (MBQC) require efficient representation and manipulation of qubit lattices. These lattices define the connectivity of qubits, which is crucial for implementing quantum operations and error correction.

Description of the Change:

This PR introduces a Lattice class to represent qubit lattices using NetworkX graph objects. The Lattice class provides functionalities to:

Store and access lattice connectivity information.
Create lattices of various shapes (chain, rectangle, honeycomb, triangle, cubic) using the generate_lattice function.
Set and retrieve attributes on nodes (qubits) and edges (connections) to store additional information (e.g., stabilizers, entanglement).
Relabel nodes for indexing and manipulation.
This change enables the representation and manipulation of lattices, laying the groundwork for implementing Cluster State as well as Graph State within PennyLane.

Benefits:

Possible Drawbacks:

Related GitHub Issues:

@mlxd mlxd self-requested a review February 13, 2025 19:17
@multiphaseCFD multiphaseCFD requested a review from a team February 18, 2025 21:43
@multiphaseCFD multiphaseCFD changed the title [WIP] 1D,2D, 3D cluster state Add Lattice class to ftqc module Feb 18, 2025
@multiphaseCFD multiphaseCFD marked this pull request as ready for review February 18, 2025 22:08
Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

Thanks a bunch @multiphaseCFD

Looking good -- I think we should be able to get this in with another pass. A few thoughts from my side:

Copy link
Contributor

@lillian542 lillian542 left a comment

Choose a reason for hiding this comment

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

Looking good 🚀 I've suggested a few small adjustments, I think this is almost ready to go :)

Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

Thanks a bunch Shuli --- happy to see this go in.
We can always adapt anything we need in follow-up works.

Copy link
Contributor

@lillian542 lillian542 left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks @multiphaseCFD! 🎉

@multiphaseCFD multiphaseCFD merged commit a0f6f71 into master Feb 28, 2025
46 checks passed
@multiphaseCFD multiphaseCFD deleted the ftqc_cluster_state_test branch February 28, 2025 21:24
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.

4 participants