On Saturday, July 2, 2022 at 1:38:59 AM UTC+8 John H Palmieri wrote:

> Is this the sort of thing you're looking for?
>
> def matrix_rep(z):
>     """
>     INPUT: complex number z = a + bi
>     OUTPUT: the matrix
>        [a -b]
>        [b  a]
>     """
>     a = z.real_part()
>     b = z.imag_part()
>     return matrix(RR, [[a, -b], [b, a]])
>

I want to identify the ring isomorphism between them programmatically, 
instead of defining a function based on this ring isomorphism.

Best,
HZ
 

>
> On Friday, July 1, 2022 at 3:04:40 AM UTC-7 hongy...@gmail.com wrote:
>
>> How can I find the matrix representations corresponding to complex 
>> numbers and quaternions with the help of SageMath 
>> <https://www.sagemath.org/>, i.e., the ring isomorphism 
>> <https://en.wikipedia.org/wiki/Ring_isomorphism> from the field of 
>> complex numbers and quaternions to the rings of corresponding matrices, 
>> respectively, as described here 
>> <https://en.wikipedia.org/wiki/Complex_number#Matrix_representation_of_complex_numbers>
>>  
>> and here 
>> <https://en.wikipedia.org/wiki/Quaternion#Matrix_representations>?
>>
>> Regards,
>> HZ
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/0f6a9fab-2f64-44f6-b1ca-07f43525090dn%40googlegroups.com.

Reply via email to