On Fri, 10 Jan 2020, Sven Schreiber wrote:
Am 10.01.2020 um 22:02 schrieb Allin Cottrell:
> On Fri, 10 Jan 2020, Allin Cottrell wrote:
>
>> 3) I'm not so sure about Sven's suggestion that (if I'm
understanding
>> him right) sqrt(M), for M a real matrix with some negative elements,
>> should return an appropriate complex matrix. It's clearly defensible,
>> but it might produce surprising/puzzling results in some cases so I
>> think it requires further discussion.
>
First of all, yes I understand what you mean, it would have some
downsides, too.
> In the meantime, it's not difficult to get what you want in this sort
> of case, if you know what you're doing. Example:
>
> <hansl>
> matrix B = {1,-4; -9,1}
> print B
> eval sqrt(complex(B,0))
> </hansl>
I was thinking of the same approach, but didn't know that a simple 0 was
enough and would broadcast.
That's actually quite explicit in the User's Guide, section 17.2.
But admittedly the online help for complex() is not so forthcoming;
amendment needed.
Allin