-
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 fidsel performance #280
Conversation
This commit introduced a new greedy search algorithm leveraging the same low-rank update tricks that we use in other parts of the experiment design codebase. This also introduces a new deduping routine specialized to the case where our gate set only generates the clifford group in which we leverage the fact that the PTMs of clifford operations are signed permutation matrices. This coupled with hash table magic (using python dictionaries which use them internally) gives an amortized O(N) deduping routine in this case.
Add additional flexibility to the candidate set specification by essentially adopting a slightly modified version of the code used for germ selection. This now allows for specifying a random set of circuits at a particular length instead of always including all up that length (which grows quickly combinatorically).
minor typo fix
restore backwards compatibility by allowing max_fid_length as an argument still, but mapping it's behavior to the equivalent one using candidate_fid_counts and raise a warning so the user knows what is going on.
Updates the docstring for germ selection to include explanations of some new options relevant to low-rank update based greedy search.
Removes a bunch of print statements that were included for debugging and also moves some of this information into appropriate logging functions/exception handling.
Fixes linting error from undefined variable.
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.
Haven't checked the math for the new greedy code path closely, given it's the same process as the recent FPR and germ sel low rank updates.
I think there is one place where code can be consolidated, i.e. we can dedup the dedup code.
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.
Great stuff! I added a few suggestions that you can take or leave.
if final_test_fiducial_list: | ||
printer.log('Final test of the candidate prep fiducial lists passed.', 1) | ||
else: | ||
printer.log('Final test of the candidate prep fiducial lists failed.', 1) |
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 above block is repeated 8 (I think) times within this function, which makes me think it'd be worth consolidating it to a nested function.
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.
I refactored this as suggested.
Refactors the deduping code to combine the two separate functions for deduping the candidate fiducial list into a single one that branches on the case where we are assuming a Clifford gate set. Also refactors a printing subroutine to reduce amount of repeating. Finally adds some docstring and debug clean-ups.
Thanks for the comments and feedback, @sserita and @enielse . I have refactored and updated the code in accordance with your suggestions. I'll plan on merging this in once I get a clean set of unit tests back on the latest commit (@sserita, I think you'll also need to approve the PR before merging is unblocked). |
This branch implements a new greedy search algorithm that leverages the same low-rank update tools now available for germ selection and FPR. This is specifically useful for accelerating fiducial selection for many-qubit systems in the 4+ qubit range (for 3 or less the existing algorithms seem to run quick enough for most applications). This new greedy search algorithm only works with an objective function based on the psuedoinverse-trace. Other notable changes in this branch: