On Thu, Jan 16, 2025 at 6:26 PM Barry Smith <bsm...@petsc.dev> wrote:
> > I don't think we have good code for this case. But it is a good case > and we should definitely provide support so it would be great to talk > about. > > Possibly start with the name :-) MATSKAIJ :-) > Are you using any preconditioner? If not, you could just use a MATSHELL, and compute the action of your Kronecker matrix. Thanks, Matt > Barry > > > > On Jan 16, 2025, at 11:00 AM, Donald Planalp < > donaldrexplanal...@outlook.com> wrote: > > > > > > Hello, > > > > I am inquiring to see what the best approach for solving a problem I am > encountering in my quantum mechanics research. > > > > For some context, the structure of my problem is solving a linear system > Ax=b where b=By in parallel. In this case A and B can be written as the sum > of 4-5 kronecker products. Specifically, A and B are formed by the same > terms but with a few flipped signs in the sum, and some of the scalings are > time dependent so currently the sum is performed at each step. > > > > The issue I'm having is balancing GMRES solving speed versus memory > usage. The sparse structure of my matrices is such that A and B (after > summing) is equivalent in structure to a kronecker product between a matrix > of size 1000x1000 with 5 nonzeros per row (concentrated along diagonal), > and a matrix of 2000x2000 with 13 nonzeros per row (banded along diagonal). > > > > In this case, the memory usage for explicitly storing the kronecker > product can be quite large. This seems inefficient since the kronecker > product contains a lot of repeated information. Further, adding the > matrices together at each step due to the scaling of time dependence as > well as dimensionality makes the solver quickly become much slower. > > > > I've looked into various matrix types. MATMPIKAIJ seems close, but I > would require more terms, and all of my matrices are sparse not some of > them. I've also looked into MATCOMPOSITE to avoid explicit sums at least, > however the solver time actually becomes slower. > > > > I was just curious if there is a better way of handling this using petsc > that can achieve the best of both worlds, low memory usage and avoiding > explicit kronecker product evaluation while keeping similar speeds of > matrix vector products for GMRES. > > > > Thank you for your time. > > > > > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener https://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!YFNC8KWLCPgn6pqKdbfqPr-QioeqYFGrRkTUQJh5BIA8qMaVG9chS49OzvBQRTw12XJfzE_FJIa365FfOxig$ <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!YFNC8KWLCPgn6pqKdbfqPr-QioeqYFGrRkTUQJh5BIA8qMaVG9chS49OzvBQRTw12XJfzE_FJIa368jEFG80$ >