expi(A) = exp(i A) function
This commit is contained in:
parent
997bcc95ad
commit
ad9e32ea98
9
matexp.h
9
matexp.h
@ -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
|
//this simple implementation seems not to be numerically stable enough
|
||||||
|
Loading…
Reference in New Issue
Block a user