Matrix ionization included in python