fqe.bitstring.count_bits_below

Return the number of set bits lower than the position

string (int) - bit string

pos (int) - position in the bit string