tqecd.cover.find_exact_cover#
- find_exact_cover(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:target = None # to replace sources = [None] # to replace cover_indices = find_exact_cover(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.