expi(A) = exp(i A) function

This commit is contained in:
Jiri Pittner 2022-07-08 11:36:04 +02:00
parent 997bcc95ad
commit ad9e32ea98

View File

@ -379,6 +379,15 @@ for(int i=0; i<power; i++)
}
}
//exp(iA)
template<class T>
NRMat<std::complex<T> > expi(const NRMat<T> &x)
{
NRMat<T> r,i;
sincos(i,r,x);
return complexify(r,i);
}
//this simple implementation seems not to be numerically stable enough