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 germsel enhancements #270

Merged
merged 36 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
898f200
Implement Rudimentary Caching for Performance
May 30, 2022
2c3799a
Add caching for circuit PTMs and deduping and identity removal for th…
May 30, 2022
694e07a
Updated the scoring routine
Jun 1, 2022
d519312
Additional Caching Improvements
Jun 1, 2022
ef36728
Switch the way nonzero eigenvalues are counted
Jun 1, 2022
1bf66e6
Even more changes to the caching and deduping routines
Jun 2, 2022
671d5f2
Add basic deduping support
Jun 2, 2022
9a868fb
Add support for user specfied numpy data types for memory savings/per…
Jun 30, 2022
b5e1abe
Implement Low-Rank Update Based Optimization Loop
Aug 4, 2022
83ccf0d
Adds additional progress logging
Aug 4, 2022
1044eaa
Print out the number of gauge and non-gauge parameters
Aug 4, 2022
9b22760
One more minor printing change
Aug 5, 2022
33199c7
Update specification of non-gauge and gauge parameter counts
Aug 5, 2022
3608e17
Updates internal format of the compact EVD cache
Aug 5, 2022
d44ea5c
Add rudimentary support for saving and loading compact EVD caches to …
Aug 5, 2022
2e064dd
Minor logging update
Aug 5, 2022
ce24505
Add fall back behavior for failed SVDs
Aug 7, 2022
4b544ee
Add option to return the deduped candidate list from fid selection an…
Aug 8, 2022
f48c2a4
Penalty term based on number of instances of specified gates
Aug 8, 2022
243f0d7
Fallback behavior for psuedoinverse calculation
Aug 9, 2022
de96935
Minor typo fix
Aug 9, 2022
76ee741
Updates the construction of the super-duper operator for projecting J…
Aug 10, 2022
40b2503
Print some diagnostic info to track down a wonky cholesky decomposition
Aug 10, 2022
39194e1
Minor typo fix
Aug 11, 2022
04a568e
Add fallback behavior for failed Cholesky decompositions
Aug 11, 2022
acb3c41
Add more handles onto the eigenvalue tolerance thresholds
Aug 12, 2022
5704e3b
Implement memory efficient version of final germ set score verification
Aug 19, 2022
d27d2f4
Merge remote-tracking branch 'origin/bugfix-fpr-pgl-params' into feat…
Aug 25, 2022
6d02f10
Fix parameter counting for minimum number of fiducial pairs needed.
Aug 29, 2022
2e60cf0
Add unit tests for low-rank update code
Nov 8, 2022
3fcd107
Merge branch 'develop' into feature-germsel-enhancements
Nov 8, 2022
1b71ef6
Fix linting issue
Nov 8, 2022
fd87b96
Add additional unit test for low-rank update germ sel
Nov 8, 2022
f529c57
Fix linting error
Nov 8, 2022
bac74ac
Another minor linting fix
Nov 8, 2022
5e48194
Remove extraneous function argument
Nov 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions pygsti/algorithms/fiducialpairreduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ def _get_per_germ_power_fidpairs(prep_fiducials, meas_fiducials, pre_povm_tuples

#debugging
#print('pre-povm-tuples: ', pre_povm_tuples)

# nRhoStrs, nEStrs = len(prep_fiducials), len(meas_fiducials)
nEStrs = len(meas_fiducials)
nPossiblePairs = len(prep_fiducials) * len(meas_fiducials)
Expand All @@ -971,14 +971,12 @@ def _get_per_germ_power_fidpairs(prep_fiducials, meas_fiducials, pre_povm_tuples
#debugging
printer.log('Number of possible pairs: %d'%(nPossiblePairs), 4)


#Determine which fiducial-pair indices to iterate over
goodPairList = None; bestFirstEval = []; bestPairs = {}
#loops over a number of pairs between min_pairs_needed and up to and not including the number of possible pairs

min_pairs_needed= ceil((gsGerm.num_params/(nPossiblePairs*dof_per_povm))*nPossiblePairs)
printer.log('Minimum Number of Pairs Needed for this Germ: %d'%(min_pairs_needed), 2)


lst = _gsc.create_circuits(
"pp[0]+f0+germ*power+f1+pp[1]", f0=prep_fiducials, f1=meas_fiducials,
Expand All @@ -1002,13 +1000,14 @@ def _get_per_germ_power_fidpairs(prep_fiducials, meas_fiducials, pre_povm_tuples
elIndicesForPair[k].extend(_slct.to_array(layout.indices_for_index(o)))

printer.log('Constructing Jacobian for Full Fiducial Set' , 3)

local_dPall = layout.allocate_local_array('ep', 'd')
gsGerm.sim.bulk_fill_dprobs(local_dPall, layout, None) # num_els x num_params
dPall = local_dPall.copy() # local == global (no layout.gather required) b/c we used comm=None above
layout.free_local_array(local_dPall) # not needed - local_dPall isn't shared (comm=None)

printer.log('Calculating Spectrum of Full Fiducial Set', 3)

# Construct sum of projectors onto the directions (1D spaces)
# corresponding to varying each parameter (~eigenvalue) of the
# germ. If the set of fiducials is sufficient, then the rank of
Expand All @@ -1027,7 +1026,7 @@ def _get_per_germ_power_fidpairs(prep_fiducials, meas_fiducials, pre_povm_tuples
if rank < gsGerm.num_params: # full fiducial set should work!
#print(rank)
raise ValueError("Incomplete fiducial-pair set!")

spectrum_full_fid_set= list(sorted(_np.abs(_np.linalg.eigvals(_np.dot(dPall, dPall.T)))))

imin_full_fid_set = len(spectrum_full_fid_set) - gsGerm.num_params
Expand Down Expand Up @@ -1070,7 +1069,6 @@ def _get_per_germ_power_fidpairs(prep_fiducials, meas_fiducials, pre_povm_tuples
#debugging
printer.log('Searching for a good set with this many pairs: %d' % (nNeededPairs), 4)


#We'll ignore the search mode argument and just focus on sampling random subsets of the candidate seed set.
nTotalPairCombos = _nCr(size_candidate_set, nNeededPairs)

Expand Down
Loading