made purity generator for pm states