Application of distance and similarity measures. The comparison of molecular electronic structures in arbitrary electronic states