tqecd.match_utils.cover.find_exact_cover_sat#
- find_exact_cover_sat(target: PauliString, sources: list[PauliString]) list[int] | None[source]#
Try to find a set of pauli strings from
sourcesthat generate exactlytarget.The Pauli strings returned (via indices over the provided
sources), once multiplied together, should be exactly equal totarget. In particular, the following post-condition should hold:If multiple valid covers exist, the covers involving the lowest number of
PauliStringinstances fromsourcesare listed, and a random cover is picked from that list.target = None # to replace sources = [None] # to replace cover_indices = find_exact_cover_sat(target, sources) resulting_pauli_string = PauliString({}) for i in cover_indices: resulting_pauli_string = resulting_pauli_string * sources[i] assert resulting_pauli_string == target, "Should hold"
- Parameters:
target – the stabilizers to cover with stabilizers from
sources.sources – stabilizers that can be used to cover
target.
- Returns:
Either a list of indices over
sourcesthat, when combined, cover exactly the providedtarget, orNoneif such a list could not be found.