'Computes the Gray code ranking of the subset.
Examples
>>> from sympy.combinatorics.subsets import Subset
>>> a = Subset([\'c\',\'d\'], [\'a\',\'b\',\'c\',\'d\'])
>>> a.rank_gray
2
>>> a = Subset([2, 4, 5], [1, 2, 3, 4, 5, 6])
>>> a.rank_gray
27
See Also
iterate_graycode, unrank_gray'

@property
def rank_gray(self):

    if (self._rank_graycode is None):
        bits = Subset.bitlist_from_subset(self.subset, self.superset)
        self._rank_graycode = GrayCode(len(bits), start=bits).rank
    return self._rank_graycode
