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

Feature edesign map-qubit-labels #283

Merged
merged 8 commits into from
Jan 5, 2023
Merged

Conversation

enielse
Copy link
Collaborator

@enielse enielse commented Dec 20, 2022

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 and SimultaneousExperimentDesign objects, and so can be applied to entire trees of experiment designs.

Basic unit tests were added.

enielse and others added 6 commits December 8, 2022 17:05
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.
Copy link
Contributor

@sserita sserita left a 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,
Copy link
Contributor

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?

Copy link
Collaborator Author

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
Copy link
Contributor

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.

enielse and others added 2 commits January 4, 2023 10:49
… 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.)
Copy link
Contributor

@sserita sserita left a 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.

@sserita sserita merged commit 19bc512 into develop Jan 5, 2023
@sserita sserita deleted the feature-edesign-mapqubitlabels branch January 5, 2023 05:37
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