View source on GitHub |
Generates simultaneous pairings between four-element combinations
openfermion.measurements.pair_within_simultaneously(
labels: list
) -> tuple
A pairing of a list is a set of pairs of list elements. E.g. a pairing of
labels = [1, 2, 3, 4, 5, 6, 7, 8]
could be
[(1, 2), (3, 4), (5, 6), (7, 8)]
(Note that we insist each element only appears in a pairing once; the following is not a pairing:
[(1, 1), (2, 2), (3, 4), (5, 6), (7, 8)]
This function generates a set of pairings such that for every four elements (i,j,k,l) in 'labels', there exists one pairing containing both (i,j) and (k,l)
Args | |
---|---|
labels
|
list
list of elements to be paired |
Yields | |
---|---|
pairings
|
tuple of pairs
the desired pairings |