-
Notifications
You must be signed in to change notification settings - Fork 56
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
Feature edesign map-qubit-labels #283
Conversation
Allows for easily remapping (changing) the qubit labels of a given experiment design, so that ExperimentDesign objects can be used as templates and applied to other sets of qubits conveniently.
…abel mapping. Adds _mapped_circuits_and_idealouts_by_depth method to BenchmarkingDesign and updates subclasses to utilize it.
…r msg. Updates this function to avoid a control path that can occur where a variable is left undefined. I ran into this when running germ selection with no (zero) forced germs - at least I think this was the salient aspect that caused the error. I was thinking this update would fix the error but alas no. We'll postpone tracking this down right now as other methods work fine, but we should come back to this later.
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.
Looks mostly good, with one possible point of discussion in mapping circuit rules/aliases in GSTDesigns.
return StandardGSTDesign(pspec, prep_fiducials, meas_fiducials, | ||
germs, self.maxlengths, self.germ_length_limits, fiducial_pairs, | ||
self.fpr_keep_fraction, self.fpr_keep_seed, self.include_lgst, self.nested, | ||
self.circuit_rules, self.aliases, dscheck, action_if_missing, qubit_labels, |
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.
Is it possible state space labels are parts of the Circuits/Labels inside circuit_rules or aliases? For safety, maybe we should add a None check + raise NotImplementedError with a message to figure out if we do need to map it, just like you did in the RB?
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.
Good point. I've added a None check and NotImplementedError in 48e14a4.
@@ -3709,13 +3709,14 @@ def find_germs_breadthfirst_greedy(model_list, germs_list, randomize=True, | |||
nonzero_weight_indices= nonzero_weight_indices[0] | |||
for i, derivDaggerDeriv in enumerate(twirledDerivDaggerDerivList): | |||
#reconstruct the needed J^T J matrices | |||
temp_DDD = None |
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.
Funny, I ran into this (or a similar) bug this week too.
… rules or aliases. Adds logic that raises a NotImplementedError if the `map_qubit_labels` method is invoked on a StandardGST design that contains non-empty (non-None) circuit rules or aliases. (We could add code in the future to properly map the qubit labels in these objects, but since they're not used much if at all, we just punt for now and raise an error.)
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.
Looks good! Will merge assuming tests come back clean with the numpy/scipy fixes from develop.
Adds
map_qubit_labels
methods of experiment design classes.These methods make it easy and convenient to change the qubit labels of an experiment design. This makes it possible to store "template experiment designs" that can be used to produce many replicas of themselves on different sets of qubits. This functionality is implemented for
CombinedExperimentDesign
andSimultaneousExperimentDesign
objects, and so can be applied to entire trees of experiment designs.Basic unit tests were added.