Hi Lucas,

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.

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.

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.

Alp

On Jun 24, 2021, at 2:44 PM, Lucas Banting 
<[email protected]<mailto:[email protected]>> wrote:

Hi,

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?

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?

Thanks,
Lucas

Reply via email to