def nativeCliqueEmbed(self, width):
        """Compute a maximum-sized native clique embedding in an induced
        subgraph of chimera with all chainlengths ``width+1``.

        INPUTS:
            width: width of the squares to search, also `chainlength`-1

        OUTPUT:
            score: the score for the returned clique (just ``len(clique)``
            in the class :class:`eden_processor`; may differ in subclasses)

            clique: a list containing lists of qubits, each associated
            to a chain.  These lists of qubits are carefully
            arranged so that

            >>> [zip(chain,chain[1:]) for chain in clique]

            is a list of valid couplers.

        """
        maxCWR = {}

        M, N = self.M, self.N
        maxscore = None
        count = 0
        key = None
        for w in range(width + 2):
            h = width - w - 2
            for ymin in range(N - h):
                ymax = ymin + h
                for xmin in range(M - w):
                    xmax = xmin + w
                    R = (xmin, xmax, ymin, ymax)
                    score, best = self.maxCliqueWithRectangle(R, maxCWR)
                    maxCWR[R] = best
                    if maxscore is None or (score is not None and maxscore < score):
                        maxscore = score
                        key = None  # this gets overwritten immediately
                        count = 0  # this gets overwritten immediately
                    if maxscore == score:
                        count, key = _accumulate_random(count, best[3], key, R)

        clique = []
        while key in maxCWR:
            score, ell, key, num = maxCWR[key]
            if ell is not None:
                meb = self.maximum_ell_bundle(ell)
                clique.extend(meb)
        return maxscore, clique
def nativeCliqueEmbed ( self , width ) : maxCWR = { } M , N = self . M , self . N maxscore = None count = 0 key = None for w in range ( width + 2 ) : h = width - w - 2 for ymin in range ( N - h ) : ymax = ymin + h for xmin in range ( M - w ) : xmax = xmin + w R = ( xmin , xmax , ymin , ymax ) score , best = self . maxCliqueWithRectangle ( R , maxCWR ) maxCWR [ R ] = best if maxscore is None or ( score is not None and maxscore < score ) : maxscore = score key = None count = 0 if maxscore == score : count , key = _accumulate_random ( count , best [ 3 ] , key , R ) clique = [ ] while key in maxCWR : score , ell , key , num = maxCWR [ key ] if ell is not None : meb = self . maximum_ell_bundle ( ell ) clique . extend ( meb ) return maxscore , clique
Compute a maximum-sized native clique embedding in an induced
        subgraph of chimera with all chainlengths ``width+1``.

        INPUTS:
            width: width of the squares to search, also `chainlength`-1

        OUTPUT:
            score: the score for the returned clique (just ``len(clique)``
            in the class :class:`eden_processor`; may differ in subclasses)

            clique: a list containing lists of qubits, each associated
            to a chain.  These lists of qubits are carefully
            arranged so that

            >>> [zip(chain,chain[1:]) for chain in clique]

            is a list of valid couplers.