<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Hi Mark,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
I use "KSPComputeEigenvalues" and it works with complex numbers. For the moment, this should be enough for me.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Besides, the <span style="color:rgb(51, 51, 51);font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:15px;text-align:left;background-color:rgb(255, 255, 255);display:inline !important">actual
number of eigenvalues computed changes from iteration to iteration. Just for curiosity, how does the code decide how many to output?</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="color:rgb(51, 51, 51);font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:15px;text-align:left;background-color:rgb(255, 255, 255);display:inline !important"><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="color:rgb(51, 51, 51);font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:15px;text-align:left;background-color:rgb(255, 255, 255);display:inline !important">Thanks,</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="color:rgb(51, 51, 51);font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:15px;text-align:left;background-color:rgb(255, 255, 255);display:inline !important">Feng </span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<h1 style="box-sizing:border-box;margin:0px 0px 1.05rem;line-height:1.15;font-size:var(--pst-font-size-h1);font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";color:var(--pst-color-primary);text-align:left;background-color:rgb(255, 255, 255)">
<br>
</h1>
</div>
<div id="signature_bookmark"></div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Mark Adams <mfadams@lbl.gov><br>
<b>Sent:</b> 14 July 2022 15:49<br>
<b>To:</b> feng wang <snailsoar@hotmail.com><br>
<b>Cc:</b> petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov><br>
<b>Subject:</b> Re: [petsc-users] KSPComputeRitz, GMRES, matrix with complex number</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr"><br>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Thu, Jul 14, 2022 at 11:29 AM feng wang <<a href="mailto:snailsoar@hotmail.com" data-auth="NotApplicable">snailsoar@hotmail.com</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Thanks for the clarification. any recommendations to get around this?</div>
</div>
</blockquote>
<div><br>
</div>
<div>I would look at the existing code and see if you can see what is limiting it to real (comments hopefully), if it looks like something you could do, start with a git repo of PETSc, configure with complex scalar values, modify an existing test or make your
own to test it, and make it work.</div>
<div>At that point you can contribute that to PETSc (there is documentation on how to do that including our coding practices that you should be able to infer to a large extent from the code you are modifying).</div>
<div>At that point PETSc will maintain it.</div>
<div><br>
</div>
<div>Mark</div>
<div> </div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I am solving a set of linear systems of A_i x_i = B_i with matrix-based GMRES. The entries of A_i and B_i are complex numbers. It is pre-conditioned with ASM and the preconditioning matrix is A_i itself. I would like to show the Ritz value to understand the
convergence behaviour for each A_i x_i = B_i. <br>
</div>
<div id="x_gmail-m_-1043195788443702311appendonsend"></div>
<hr style="display:inline-block; width:98%">
<div id="x_gmail-m_-1043195788443702311divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Mark Adams <<a href="mailto:mfadams@lbl.gov" data-auth="NotApplicable">mfadams@lbl.gov</a>><br>
<b>Sent:</b> 14 July 2022 14:16<br>
<b>To:</b> feng wang <<a href="mailto:snailsoar@hotmail.com" data-auth="NotApplicable">snailsoar@hotmail.com</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" data-auth="NotApplicable">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" data-auth="NotApplicable">petsc-users@mcs.anl.gov</a>><br>
<b>Subject:</b> Re: [petsc-users] KSPComputeRitz, GMRES, matrix with complex number</font>
<div> </div>
</div>
<div>
<div dir="ltr">No. I missed that note.
<div>Complex has not been implemented.</div>
<div><br>
</div>
</div>
<br>
<div>
<div dir="ltr">On Thu, Jul 14, 2022 at 9:54 AM feng wang <<a href="mailto:snailsoar@hotmail.com" data-auth="NotApplicable">snailsoar@hotmail.com</a>> wrote:<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hi Mark,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Thanks for your reply! <br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Maybe I have a misunderstanding of the documentation of KSPComputeRitz (<a href="https://petsc.org/main/docs/manualpages/KSP/KSPComputeRitz/" data-auth="NotApplicable" id="x_gmail-m_-1043195788443702311x_gmail-m_6877891815980076493LPlnk308872">https://petsc.org/main/docs/manualpages/KSP/KSPComputeRitz/</a>).
It says "-this is currently not implemented when PETSc is built with complex numbers".
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
But if it works, I will give it a try.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Thanks,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Feng<br>
<pre><span><br></span></pre>
<pre><span><a href="https://petsc.org/main/docs/manualpages/KSP/KSPComputeRitz/" data-auth="NotApplicable"></a></span></pre>
<br>
</div>
<div id="x_gmail-m_-1043195788443702311x_gmail-m_6877891815980076493appendonsend">
</div>
<hr style="display:inline-block; width:98%">
<div id="x_gmail-m_-1043195788443702311x_gmail-m_6877891815980076493divRplyFwdMsg" dir="ltr">
<font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Mark Adams <<a href="mailto:mfadams@lbl.gov" data-auth="NotApplicable">mfadams@lbl.gov</a>><br>
<b>Sent:</b> 14 July 2022 12:23<br>
<b>To:</b> feng wang <<a href="mailto:snailsoar@hotmail.com" data-auth="NotApplicable">snailsoar@hotmail.com</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" data-auth="NotApplicable">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" data-auth="NotApplicable">petsc-users@mcs.anl.gov</a>><br>
<b>Subject:</b> Re: [petsc-users] KSPComputeRitz, GMRES, matrix with complex number</font>
<div> </div>
</div>
<div>
<div dir="ltr">Why do you say it only works with Real? You need to configure PETSc to use complex numbers and it should work.
<div>This is an advanced method and it does not have any tests, which basically says it is very experimental.</div>
<div>Don't expect it to be very robust.</div>
<div><br>
<div>Mark</div>
</div>
</div>
<br>
<div>
<div dir="ltr">On Thu, Jul 14, 2022 at 7:19 AM feng wang <<a href="mailto:snailsoar@hotmail.com" data-auth="NotApplicable">snailsoar@hotmail.com</a>> wrote:<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Dear All,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I am using GMRES with complex numbers and would like to compute the Ritz values.<span> I am looking at
<a href="https://petsc.org/main/docs/manualpages/KSP/KSPComputeRitz/" data-auth="NotApplicable">
KSPComputeRitz</a> and it seems to me that it only works with Petsc compiled with real numbers. Is there an easy alternative way to compute Ritz values for matrices with complex numbers?</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Thanks,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Feng<br>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>