<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Lucas,
<div class=""><br class="">
</div>
<div class="">In theory, you can attempt to solve complex-valued problems by concatenating the real and imaginary parts into a single real-valued solution vector and solving it as if it’s a real-valued problem.</div>
<div class=""><br class="">
</div>
<div class="">There’s a more practical issue of the PETSc build excluding the TAO source code entirely for complex builds. I think this is done because we cannot guarantee that TAO code has been completely rigorous in its distinction of PetscReal from PetscScalar.
 There may be places where we used Scalar and assumed it’s Real. The methods developed in the last few years have paid more attention to this but there’s a lot of older code floating around that might break even if you hacked the build into compiling TAO for
 complex configurations.</div>
<div class=""><br class="">
</div>
<div class="">I’m not entirely sure what’s necessary to enable TAO builds for complex PETSc. Perhaps Todd, Satish or Barry will have a better idea. If you want to give it a try though I’d be happy to help you resolve the errors as they come up so that it can
 be compiled for complex builds. Can’t provide convergence guarantees but it would at least let you attempt a solution.</div>
<div class=""><br class="">
</div>
<div class="">Alp</div>
<div class="">
<div class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Jun 24, 2021, at 2:44 PM, Lucas Banting <<a href="mailto:bantingl@myumanitoba.ca" class="">bantingl@myumanitoba.ca</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
Hi,</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<br class="">
</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
I have a complex valued optimization code that requires non-linear least squares curve fitting at each iteration. I wanted to use Tao to do the non-linear least squares problem, but just discovered that Tao can only be used with real scalar types. Is there
 any workarounds?</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<br class="">
</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
I was wondering if maybe I could somehow use two different Petsc installations at once, or is there any other ways to hack tao into working?</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<br class="">
</div>
<div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
Thanks,
<div class="">Lucas</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</body>
</html>