[petsc-users] Random initial states of EPSSolve

Jose E. Roman jroman at dsic.upv.es
Tue Mar 17 07:28:13 CDT 2020


You can set a different seed for the random number generator as follows:
- Use EPSGetBV() to extract the BV object
- Use BVGetRandomContext() to extract the PetscRandom object
- Use PetscRandomSetSeed() to set the new seed.

Jose


> El 17 mar 2020, a las 13:23, Yang Bo (Asst Prof) <yang.bo at ntu.edu.sg> escribió:
> 
> Hi everyone,
> 
> I am diagonalising a large symmetric real matrix for its null space (highly degenerate eigenstates with zero eigenvalues). I am using krylovschur which is variational, which is supposed to start with a set of random initial vectors. They will eventually converge to random vectors in the null space.
> 
> The problem is that if I run the EPSSOLVE with the same set of parameters (e.g. -eps_ncv and -eps_mpd), I always get the same eigenstates in the null space. This implies that the solver always start the same set of initial “random” vectors. 
> 
> How does petsc generate the initial random vectors for krylovschur? Is there a way for me to generate different random initial vectors every time I run the diagonalisation (of the same matrix)?
> 
> Thanks, and stay safe and healthy!
> 
> Cheers,
> 
> Yang Bo
> CONFIDENTIALITY: This email is intended solely for the person(s) named and may be confidential and/or privileged. If you are not the intended recipient, please delete it, notify us and do not copy, use, or disclose its contents. 
> Towards a sustainable earth: Print only when necessary. Thank you.
> 



More information about the petsc-users mailing list