'Ranks the Gray code.
A ranking algorithm determines the position (or rank)
of a combinatorial object among all the objects w.r.t.
a given order. For example, the 4 bit binary reflected
Gray code (BRGC) \'0101\' has a rank of 6 as it appears in
the 6th position in the canonical ordering of the family
of 4 bit Gray codes.
References:
[1] http://statweb.stanford.edu/~susan/courses/s208/node12.html
Examples
>>> from sympy.combinatorics.graycode import GrayCode
>>> a = GrayCode(3)
>>> list(a.generate_gray())
[\'000\', \'001\', \'011\', \'010\', \'110\', \'111\', \'101\', \'100\']
>>> GrayCode(3, start=\'100\').rank
7
>>> GrayCode(3, rank=7).current
\'100\'
See Also
unrank'

@property
def rank(self):

    if (self._rank is None):
        self._rank = int(gray_to_bin(self.current), 2)
    return self._rank
