Skip to content

Add n-dimensional grid graph generators#1636

Open
Sriram-098 wants to merge 1 commit into
Qiskit:mainfrom
Sriram-098:feature/1327
Open

Add n-dimensional grid graph generators#1636
Sriram-098 wants to merge 1 commit into
Qiskit:mainfrom
Sriram-098:feature/1327

Conversation

@Sriram-098

Copy link
Copy Markdown

Adds nd_grid_graph() and directed_nd_grid_graph() for creating n-dimensional grids.

Fixes #1327

Changes

  • New functions accept a list of dimensions (e.g. [2,2,2] for 3D cube)
  • periodic option for wrapping boundaries
  • with_positions option to store coordinates as node weights

Example

cube = rx.generators.nd_grid_graph([2, 2, 2])  # 8 nodes, 12 edges
grid = rx.generators.nd_grid_graph([3, 3], with_positions=True)

@CLAassistant

CLAassistant commented Jul 14, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

Expanded grid_graph functionality

2 participants