Converted a code from matlab to petsc4py/slepc4py. Includes a petscKron function.