Skip to content

add interaction matrix method to register - #419

Merged
sgrava merged 7 commits into
mainfrom
sg/417-add-interaction_matrix-method-to-register
Aug 4, 2026
Merged

sgrava merged 7 commits into
mainfrom
sg/417-add-interaction_matrix-method-to-register

Conversation

@sgrava

@sgrava sgrava commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Resolves #417

add interaction_matrix method to Register

Description

From a given register, the interaction_matrix method should return a symmetric matrix encoding the Rydberg interactions $J_{ij}=1/r_{ij}^6$, with $r_{ij}=|r_{i}-r_{j}|$

Changes

  • add Register.interaction_matrix method which return the Rydberg interaction matrix. Dispatches to torch or numpy depending on the coordinates type stored in the register
  • test

Bonus

  • adds matplotlib.use("Agg") in conftest.py. Totally unrelated but let the tests to avoid loading matplotlib in interacting mode. Saves 0.5 seconds per test module.

Next

@sgrava sgrava linked an issue Jul 30, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Jul 30, 2026

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

@sgrava sgrava changed the title add interaction matrix add interaction matrix method to register Jul 31, 2026

@v-vitale v-vitale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just a comment.

What is the reason behind using torch tensors for the interaction matrix?

@v-vitale
v-vitale self-requested a review July 31, 2026 13:40
@sgrava

sgrava commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

Just a comment.

What is the reason behind using torch tensors for the interaction matrix?

It would be nice to support torch backed registers as well, but not a priority for now I agree

@sgrava
sgrava marked this pull request as ready for review August 3, 2026 08:26
@sgrava
sgrava requested a review from abussy-pasqal August 3, 2026 08:27
Comment thread qoolqit/register.py Outdated
@sgrava
sgrava requested a review from abussy-pasqal August 3, 2026 09:20
abussy-pasqal
abussy-pasqal previously approved these changes Aug 3, 2026
@sgrava
sgrava requested a review from abussy-pasqal August 3, 2026 16:07
@sgrava
sgrava merged commit 8ac2e42 into main Aug 4, 2026
16 checks passed
@sgrava
sgrava deleted the sg/417-add-interaction_matrix-method-to-register branch August 4, 2026 06:26
@sgrava sgrava mentioned this pull request Aug 4, 2026
6 tasks
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 Register

3 participants