pygsti.construction.make_lsgst_lists¶
-
pygsti.construction.
make_lsgst_lists
(gateLabels, prepStrs, effectStrs, germList, maxLengthList, fidPairs=None, truncScheme='whole germ powers', nest=True)¶ Create a set of gate string lists for LSGST based on germs and max-lengths.
Constructs a series (a list) of gate string lists used by long-sequence GST (LSGST) algorithms. If maxLengthList[0] == 0 then the starting list is the list of LGST strings, otherwise the starting list is empty. For each nonzero element of maxLengthList, call it L, a list of gate strings is created with the form:
- Case: truncScheme == ‘whole germ powers’:
- prepStr + pygsti.construction.repeat_with_max_length(germ,L) + effectStr
- Case: truncScheme == ‘truncated germ powers’:
- prepStr + pygsti.construction.repeat_and_truncate(germ,L) + effectStr
- Case: truncScheme == ‘length as exponent’:
- prepStr + germ^L + effectStr
If nest == True, the above list is iteratively added (w/duplicates removed) to the current list of gate strings to form a final list for the given L. This results in successively larger lists, each of which contains all the elements of previous-L lists. If nest == False then the above list is the final list for the given L.
Parameters: - gateLabels (list or tuple) – List of gate labels to determine needed LGST strings. Only relevant when maxLengthList[0] == 0.
- prepStrs (list of GateStrings) – List of the preparation fiducial gate strings, which follow state preparation.
- effectStrs (list of GateStrings) – List of the measurement fiducial gate strings, which precede measurement.
- germList (list of GateStrings) – List of the germ gate strings.
- maxLengthList (list of ints) – List of maximum lengths. If maxLengthList[0] == 0 this results in special behavior where LGST strings are included as the first returned list.
- fidPairs (list of 2-tuples, optional) – Specifies a subset of all fiducial string pairs (prepStr, effectStr) to be used in the gate string lists. Each element of fidPairs is a (iPrepStr, iEffectStr) 2-tuple of integers, each indexing a string within prepStrs and effectStrs, respectively, so that prepStr = prepStrs[iPrepStr] and effectStr = effectStrs[iEffectStr].
- truncScheme (str, optional) –
Truncation scheme used to interpret what the list of maximum lengths means. If unsure, leave as default. Allowed values are:
- ‘whole germ powers’ – germs are repeated an integer number of times such that the length is less than or equal to the max.
- ‘truncated germ powers’ – repeated germ string is truncated to be exactly equal to the max (partial germ at end is ok).
- ‘length as exponent’ – max. length is instead interpreted as the germ exponent (the number of germ repetitions).
- nest (boolean, optional) – If Frue, the returned gate string lists are “nested”, meaning that each successive list of gate strings contains all the gate strings found in previous lists (and usually some additional new ones). If False, then the returned string list for maximum length == L contains only those gate strings specified in the description above, and not those for previous values of L.
Returns: The i-th list corresponds to a gate string list containing repeated germs limited to length maxLengthList[i]. If nest == True, then repeated germs limited to previous max-lengths are also included. Note that a “0” maximum-length corresponds to the LGST strings.
Return type: list of (lists of GateStrings)