openfermion.measurements.pair_within_simultaneously

Generates simultaneous pairings between four-element combinations

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)

labels list

list of elements to be paired

pairings tuple of pairs

the desired pairings