<div dir="ltr"><div dir="ltr">On Thu, Jan 16, 2025 at 6:26 PM Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>> wrote:</div><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
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. <br>
<br>
Possibly start with the name :-) MATSKAIJ :-)<br></blockquote><div><br></div><div>Are you using any preconditioner? If not, you could just use a MATSHELL, and compute the action of your Kronecker matrix.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Barry<br>
<br>
<br>
> On Jan 16, 2025, at 11:00 AM, Donald Planalp <<a href="mailto:donaldrexplanalpjr@outlook.com" target="_blank">donaldrexplanalpjr@outlook.com</a>> wrote:<br>
> <br>
> <br>
> Hello, <br>
> <br>
> I am inquiring to see what the best approach for solving a problem I am encountering in my quantum mechanics research. <br>
> <br>
> 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. <br>
> <br>
> 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). <br>
> <br>
> 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. <br>
> <br>
> 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.<br>
> <br>
> 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. <br>
> <br>
> Thank you for your time. <br>
> <br>
> <br>
<br>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!YFNC8KWLCPgn6pqKdbfqPr-QioeqYFGrRkTUQJh5BIA8qMaVG9chS49OzvBQRTw12XJfzE_FJIa368jEFG80$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>