Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix cloud noise model callable ops #485

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

sserita
Copy link
Contributor

@sserita sserita commented Sep 16, 2024

When completed, this PR will address the following issues:

@sserita sserita self-assigned this Sep 16, 2024
@sserita sserita requested review from a team as code owners September 16, 2024 17:47
@sserita sserita added this to the 0.9.13 milestone Sep 19, 2024
@@ -537,7 +537,7 @@ def apply_errormap_stencil(self, stencil, evotype, state_space, target_labels=No
# `None` in list signals a non-present direction => skip these terms
sslbls_list = list(filter(lambda x: x is not None, sslbls_list))
for sslbls in sslbls_list:
op_to_embed = local_errormap if (sslbls is None or state_space.is_entire_space(sslbls)) \
Copy link
Contributor

Choose a reason for hiding this comment

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

It is not immediately obvious what bug would have been caused by the is_entire_space call. I'm sure it's fine, but could you explain what this fixes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, these two fixes come from Aidan and were edge cases he ran into while doing some CloudNoiseModel simulations. I understand the other fix, but forget what necessitated this fix. @AidanGauthier do you remember why we needed to do this?
@coreyostrove btw, I'll probably move this to a draft while updating the issue description. I want to fix #441 at the same time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I talked to Aidan and here's the edge case this caused: local_errorgen comes from the stencil, so it has generic stencil state space labels. However, the is_entire_space call only checks after the sslbls have been mapped on line 481. In the case the mapped state space fully matches, then the still-stencil errorgen is passed through, causing downstream sslbl mismatch errors.

EmbeddedOps presumably fix this because it is already doing sslbl mapping, but it's not the most efficient thing to do in this case. @coreyostrove, unless you have another suggestion, I'll probably expand this line into an if/elif/else and handle the is_entire_space in its own block where we copy the op with the correct sslbls instead of relying on EmbeddedOp to do so.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds perfect, thanks to you and @AidanGauthier for tracking this down and explaining!

@sserita sserita marked this pull request as draft September 19, 2024 22:22
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.

2 participants