find_ql function

Convert index into group pair