<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000">Hi Mark,<br><br>I think so. The complex-valued linear system Ax = b, with A=T+Wi, u=x+yi, b=p+qi (i is the unit complex) can be transformed into a 2x2 real-valued system:<br>[ T  -W ] (x) = (p)<br>[ W   T ] (y)    (q)<br><br>Perhaps a bit more background can clarify things. System A stems from a Poisson equation with complex coefficients. There are ~130 piecewise constant coefficients ranging across 5 orders of magnitude. Most of the KSPs and PCs I managed to test take between 6000-9000 iterations to reach 10^-9. I hope to get some speed up with preconditioners that exploit the structure above.<br><br>Regards,<br> Frederico.<br><br><div id="e1bde0fd-f1a5-4833-935b-0cc70f26a0a4" data-marker=""><div><style>/*<![CDATA[*/p.p1 {
        margin: 0.0px 0.0px 12.0px 0.0px;
        font: 8.5px Helvetica;
}
span.s1 {
}
/*]]>*/</style></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div style="text-align:left"><span style="font-size:x-small"></span><span style="font-size:x-small"><span style="font-size:x-small"></span></span><div style="text-align:left"><span style="font-size:11pt;font-family:'arial' , 'helvetica' , sans-serif;color:rgb( 0 , 0 , 0 );background-color:rgb( 255 , 255 , 255 )">Dr. Frederico Teixeira</span></div><div style="text-align:left"><span style="font-size:11pt;font-family:'arial' , 'helvetica' , sans-serif;background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 )">Computational Modeler and Software Developer, <a href="http://www.itis.swiss" style="background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 )" rel="nofollow%20noopener%20noreferrer%20nofollow%20noopener%20noreferrer%20nofollow%20noopener%20noreferrer%20nofollow%20noopener%20noreferrer nofollow noopener noreferrer nofollow noopener noreferrer" target="_blank">ZMT</a> (member of <a href="https://www.z43.swiss" style="background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 )" rel="nofollow%20noopener%20noreferrer%20nofollow%20noopener%20noreferrer%20nofollow%20noopener%20noreferrer%20nofollow%20noopener%20noreferrer nofollow noopener noreferrer nofollow noopener noreferrer" target="_blank">Zurich43</a>)</span></div><div style="text-align:left"><span style="font-size:11pt;font-family:'arial' , 'helvetica' , sans-serif;background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 )"><br></span></div><div style="text-align:left">







<p class="p1"><span class="s1" style="font-size:11pt;font-family:'arial' , 'helvetica' , sans-serif;background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 )">P +41 44 245 9698<br>
Zeughausstrasse 43, 8004 Zurich, Switzerland</span></p></div></div></div><br><hr id="zwchr" data-marker=""><div data-marker=""><b>From: </b>"Mark Adams" <mfadams@lbl.gov><br><b>To: </b>"Frederico Teixeira" <teixeira@zmt.swiss><br><b>Cc: </b>"petsc-users" <petsc-users@mcs.anl.gov><br><b>Sent: </b>Tuesday, May 11, 2021 5:16:35 PM<br><b>Subject: </b>Re: [petsc-users] Binary format in real vs. complex scalar type configurations<br></div><br><div data-marker=""><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 11, 2021 at 9:30 AM Frederico Teixeira <teixeira@zmt.swiss> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb( 204 , 204 , 204 );padding-left:1ex"><div><div style="font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt;color:rgb( 0 , 0 , 0 )"><div><div><div><div>Dear fellows,<br></div></div></div></div><div><div style="color:rgb( 0 , 0 , 0 );font-family:'arial' , 'helvetica' , sans-serif;font-size:16px;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb( 255 , 255 , 255 )"><br><div>I hope this message finds you safe and well.</div><br><div>I have<span style="color:rgb( 0 , 0 , 0 );font-family:'arial' , 'helvetica' , sans-serif;font-size:16px;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb( 255 , 255 , 255 );float:none;display:inline"> </span><span style="font-size:12pt">a complex-valued matrix and its real/imaginary components <span style="color:rgb( 0 , 0 , 0 );font-family:'arial' , 'helvetica' , sans-serif;font-size:16px;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb( 255 , 255 , 255 );float:none;display:inline">in </span><span style="color:rgb( 0 , 0 , 0 );font-family:'arial' , 'helvetica' , sans-serif;font-size:16px;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb( 255 , 255 , 255 );float:none;display:inline">binary format</span></span><span style="font-size:12pt">. They were extracted from a solver that only works with "scalar-type=complex" configuration.</span></div><div>I am getting weird results when I load them into a small test program that's configured with "scalar-type=real", but I believe this is expected.</div><div>At the end of the day, I would like to have both real and imaginary components as real-valued matrices.</div><div>Is it possible to do it? I want to<span style="color:rgb( 0 , 0 , 0 );font-family:'arial' , 'helvetica' , sans-serif;font-size:16px;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb( 255 , 255 , 255 );float:none;display:inline"> test preconditioners that are tailored for this sort of problem.</span></div></div></div></div></div></blockquote><br><div>Do you mean you want what is called "equivalent real form" where the real and complex parts are stored as type 'double' for example and operations like multiply take two pairs of doubles, do a complex multiply manually, and return a real/complex pair of doubles?</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"><div><div style="font-family:'arial' , 'helvetica' , sans-serif;font-size:12pt;color:rgb( 0 , 0 , 0 )"><div><div style="color:rgb( 0 , 0 , 0 );font-family:'arial' , 'helvetica' , sans-serif;font-size:16px;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb( 255 , 255 , 255 )"><br><div>Regards,</div><div> Frederico.</div></div><span style="color:rgb( 0 , 0 , 0 );font-family:'arial' , 'helvetica' , sans-serif;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:11pt;background-color:rgb( 255 , 255 , 255 )"></span></div></div></div></blockquote></div></div><br></div></div></body></html>