This function implements a measure of diversity for a locus \(j\)
as in Clayton (2002). If \(z_ij\) represents the allele \(j\) of haplotype \(i\), for
\(i=1,...,N\) and assuming that alleles are coded as 0 and 1, the
diversity measure can be written as
$$D_j = 2*N( \sum_{i=1}^N z_{ij}^2 - (\sum_{i=1}^N z_{ij}) ^2 )$$