Skip to content

Conversation

isPANN
Copy link

@isPANN isPANN commented Sep 9, 2025

This pull request introduces support for mapping graphs onto triangular lattices in addition to the existing square lattice approach, enabling more flexible and realistic modeling for quantum hardware with different connectivity constraints. The changes include new grid types, a new mapping mode (TriangularWeighted), and significant refactoring to generalize grid spacing and physical positioning logic. An example and documentation updates are also provided to demonstrate and explain the new functionality.

Triangular lattice support and grid generalization:

  • Added new grid types SquareGrid and TriangularGrid (with customizable column offset) as subtypes of a new AbstractGridType, and updated GridGraph to be parameterized by grid type. The physical position calculation and neighbor logic are now grid-type aware, supporting both square and triangular lattices.
  • Introduced a new mapping mode TriangularWeighted and exported it, along with the new grid types, for external use. [1] [2]
  • Refactored mapping logic to use a new GridSpacing structure, allowing flexible row and column spacing for different grid types. All mapping and gadget-placement functions now use this abstraction, and spacing is stored with the mapping grid and results. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

Triangular mapping implementation:

  • Added TriangularWeighted mapping logic, including grid construction, overhead calculation, and integration with simplification and gadget routines. The mapping functions now select grid type and spacing based on the chosen mode. [1] [2] [3] [4] [5]

Documentation and examples:

  • Added a new example file examples/weighted_lattice_comparison.jl demonstrating and comparing weighted graph mapping on square and triangular lattices, including visualization and solution verification.
  • Updated documentation build configuration and included the new example in the docs navigation.

Code organization:

  • Included the new triangular.jl file in the main module for triangular lattice support.
  • Moved the utils.jl include to immediately after Core.jl for improved organization.

@GiggleLiu
Copy link
Contributor

GiggleLiu commented Sep 10, 2025

I have tested this PR locally, and verified the correctness. The documentation can be built successfully locally. The code quality is also good.

@Wang-Shengtao Could you please help approve the CI runs, merge this PR and tag a new patch version (since no incompitible changes) by commenting here: #41

Copy link
Contributor

@GiggleLiu GiggleLiu left a comment

Choose a reason for hiding this comment

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

LGTM. please bump the version to 0.5.2.

@Wang-Shengtao
Copy link
Member

@weinbe58 Please see above - please review, merge and tag a new version.

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