Skip to content

add interaction matrix to DataGraph - #433

Merged
sgrava merged 4 commits into
mainfrom
sg/432-add-interaction-matrix-method-in-datagraph
Aug 6, 2026
Merged

sgrava merged 4 commits into
mainfrom
sg/432-add-interaction-matrix-method-in-datagraph

Conversation

@sgrava

@sgrava sgrava commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Changes

  • Adds interaction_matrix() to BaseGraph (inherited by DataGraph), returning the dense Rydberg interaction matrix (1/r_ij**6) as a symmetric (N, N) array with a zero diagonal. Node ordering follows self.nodes insertion order, consistent with to_matrix.
  • Raises AttributeError if the graph has no coordinates, same as interactions()/distances().
  • test

Closes #432.

Test plan

  • Added tests for some random coordinates, building the matrix explicitly.

@sgrava sgrava changed the title add interaction matrix add interaction matrix to DataGraph Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-06 11:40 UTC

@sgrava sgrava added this to the v1.3.0 milestone Aug 6, 2026
@sgrava sgrava linked an issue Aug 6, 2026 that may be closed by this pull request
@sgrava
sgrava marked this pull request as ready for review August 6, 2026 10:13
@sgrava sgrava mentioned this pull request Aug 6, 2026
6 tasks
@sgrava
sgrava merged commit e5f838c into main Aug 6, 2026
16 checks passed
@sgrava
sgrava deleted the sg/432-add-interaction-matrix-method-in-datagraph branch August 6, 2026 11:40
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.

Add interaction_matrix method to DataGraph

2 participants