-
Notifications
You must be signed in to change notification settings - Fork 1
correlated loss support #526
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
base: main
Are you sure you want to change the base?
Changes from all commits
9352266
6a07247
2c90cac
cd69a37
d8c5318
646a478
2bba610
bcb3e76
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,8 +89,8 @@ class NonStimError(ir.Statement): | |
class NonStimCorrelatedError(ir.Statement): | ||
name = "NonStimCorrelatedError" | ||
traits = frozenset({lowering.FromPythonCall()}) | ||
nonce: int = ( | ||
info.attribute() | ||
nonce: int = info.attribute( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the correlated error previously used to exist in the code base. I'm wondering if the previous approach also assigned a random number to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The nonce solution was mine originally. If you can find a stim instruction other than I_ERROR that satisfies the following, then please use it.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that I'm just wondering if a random 32 bit integer for the tag is the best solution or if, e.g., a global counter would be better. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the tag need to be different in this case? how does it work There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kaihsin When you import the stim IR into the stim package ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rafaelha A counter would also work as long as you can ensure no collisions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alternative solution would be to put dummy E.g.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I still prefer the random There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
default_factory=lambda: __import__("random").getrandbits(32) | ||
) # Must be a unique value, otherwise stim might merge two correlated errors with equal probabilities | ||
probs: tuple[ir.SSAValue, ...] = info.argument(types.Float) | ||
targets: tuple[ir.SSAValue, ...] = info.argument(types.Int) | ||
|
@@ -109,3 +109,8 @@ class TrivialError(NonStimError): | |
@statement(dialect=dialect) | ||
class QubitLoss(NonStimError): | ||
name = "loss" | ||
|
||
|
||
@statement(dialect=dialect) | ||
class CorrelatedQubitLoss(NonStimCorrelatedError): | ||
name = "correlated_loss" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The python 3.10 build is producing a lot of warnings (this currently also happens on
main
)These warnings are coming internally from cirq 1.5.0. The solution is to simply upgrade to cirq 1.6 which requires Python 3.11 (which is why only the 3.10 build has these issues).
I've gone ahead and filtered these warnings.