Skip to content

Conversation

@jan-an
Copy link
Collaborator

@jan-an jan-an commented Jan 8, 2026

Summary

@jan-an jan-an requested a review from diego-plan9 January 8, 2026 13:47
@diego-plan9 diego-plan9 requested a review from yaelbh January 9, 2026 10:34
@jan-an jan-an changed the title Jan 2524 rx check cache Correct fractional gates configuration check for cached usage of backend object Jan 9, 2026
Copy link
Collaborator

@yaelbh yaelbh left a comment

Choose a reason for hiding this comment

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

Thanks @jan-an, it's very good and my comments are small.

@@ -0,0 +1,3 @@
`.QiskitRuntimeService` will now check for both ``rzz`` and ``rx`` gates in the
backend's basis gates to decide whether to refresh the configuration or fetch
from cache
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add a sentence that explains what's the change here, i.e., describe how it was before.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added sentence (commit) 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @yaelbh, thank you for your comments and suggestions! I've made the changes, can you kindly take a look?

real_device_name = "ibm_miami"
backend_fg = self.service.backend(real_device_name, use_fractional_gates=True)
backend_fg2 = self.service.backend(real_device_name, use_fractional_gates=True)
backend_no_fg = self.service.backend(real_device_name, use_fractional_gates=False)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider adding:

backend_no_fg2 = self.service.backend(real_device_name, use_fractional_gates=False)
backend_fg_3 = self.service.backend(real_device_name, use_fractional_gates=True)

and the corresponding assertions below. This way all four cases of (previous fg, current fg) will be covered.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added additional backend objects and assert statements as suggested (commit)

Copy link
Collaborator

Choose a reason for hiding this comment

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

The error messages were changed in this last commit, and I think the previous version was the correct one, please check.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi, I was writing some comments to follow what each assert was doing but forgot to negate them when I copied them for raising the error message, that's why this happened. Sorry about that, I've corrected the tests and the error messages again, they should be okay now.

@yaelbh yaelbh added the Changelog: Bugfix Include in the Fixed section of the changelog label Jan 12, 2026
jan-an and others added 4 commits January 13, 2026 02:05
Added fullstop

Co-authored-by: Yael Ben-Haim <[email protected]>
Included the issue pertaining to the bug in addition to information about the fix in release notes
Added a few more assertions to round off issues we saw in the bug report
Comment on lines 299 to 301
self.assertIsNot(
backend_no_fg2, backend_fg3, "Configuration refreshes when use_fractional_gates changes"
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This assertion can be deleted, it's a direct consequence of the next assertion.

real_device_name = "ibm_miami"
backend_fg = self.service.backend(real_device_name, use_fractional_gates=True)
backend_fg2 = self.service.backend(real_device_name, use_fractional_gates=True)
backend_no_fg = self.service.backend(real_device_name, use_fractional_gates=False)
Copy link
Collaborator

Choose a reason for hiding this comment

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

The error messages were changed in this last commit, and I think the previous version was the correct one, please check.

@@ -0,0 +1,5 @@
While creating backend objects from cache when ``use_fractional_gates`` flag is used,
Copy link
Collaborator

Choose a reason for hiding this comment

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

When we start to create we still don't know if it's from cache. Also, the fix applies to both when the flag is used and when it's not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Made changes for to the release note 👍

@@ -0,0 +1,5 @@
While creating backend objects from cache when ``use_fractional_gates`` flag is used,
`.QiskitRuntimeService` used to check for only ``rzz`` gates in the backend's basis.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Check for what? (check for whether to take from cache).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: Bugfix Include in the Fixed section of the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configuration caching is wrong if a backend contains rx but not rzz

2 participants