Re: [sage-support] Re: Find the matrix representations corresponding to complex numbers and quaternions.

2022-07-01 Thread Hongyi Zhao


On Saturday, July 2, 2022 at 2:49:25 AM UTC+8 raymond@gmail.com wrote:

> You (hongy) might be interested in 
> Matrix Groups (Universitext) 2nd Edition
> by M. L. Curtis (Author)
> Which is a pretty good introduction; although the price is a little high.  
>
Thank you for letting know this book [1]. The first chapter of the book 
talks about the problem discussed here.

[1] https://link.springer.com/book/10.1007/978-1-4684-0093-9

Best,
HZ
 

> On 7/1/22 13:38, 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]])
>
> 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 
>> , i.e., the ring isomorphism 
>>  from the field of 
>> complex numbers and quaternions to the rings of corresponding matrices, 
>> respectively, as described here 
>> 
>>  
>> and here 
>> ?
>>
>> 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...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-support/143f4daf-9e77-4b1b-92f4-ab8cde91a1bbn%40googlegroups.com
>  
> 
> .
>
>

-- 
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/1537fb2a-f3c8-422b-91fd-2ecd86e5cf29n%40googlegroups.com.


[sage-support] Re: Find the matrix representations corresponding to complex numbers and quaternions.

2022-07-01 Thread Hongyi Zhao


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 
>> , i.e., the ring isomorphism 
>>  from the field of 
>> complex numbers and quaternions to the rings of corresponding matrices, 
>> respectively, as described here 
>> 
>>  
>> and here 
>> ?
>>
>> 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.


Re: [sage-support] Re: Find the matrix representations corresponding to complex numbers and quaternions.

2022-07-01 Thread Ray Rogers

You (hongy) might be interested in
Matrix Groups (Universitext) 2nd Edition
by M. L. Curtis (Author)
Which is a pretty good introduction; although the price is a little high.

On 7/1/22 13:38, 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]])

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
, i.e., the ring isomorphism
 from the field of
complex numbers and quaternions to the rings of corresponding
matrices, respectively, as described here


and here
?

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/143f4daf-9e77-4b1b-92f4-ab8cde91a1bbn%40googlegroups.com 
.


--
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/4385e0f7-d3cb-e889-e855-b168ecb25841%40gmail.com.


[sage-support] Re: "Inappropriate ioctl for device" when displaying number in Jupyter notebook

2022-07-01 Thread Alex J Best
Indeed that should fix it, in the meantime you can run something like

sage: from sage.typeset.ascii_art import AsciiArt
sage: AsciiArt._terminal_width = lambda x: 80

Before running other commands to fix the problem in a given notebook 

On Friday, July 1, 2022 at 3:40:58 AM UTC+2 John H Palmieri wrote:

> This might be fixed by the change at 
> https://trac.sagemath.org/ticket/33996. That will presumably be merged in 
> the next beta release, since the ticket was just closed two days ago.
>
>
> On Thursday, June 30, 2022 at 11:30:11 AM UTC-7 Richard Stanton wrote:
>
>> I've just installed Sagemath 9.6 (Release Date: 2022-05-15) on my Mac 
>> running macOS 12.4. If I create a new Sagemath Jupyter notebook starting 
>> from Sagemath, everything seems to work fine. However, I'd like to start by 
>> just running "jupyter notebook" at the command line.  When I do this and 
>> create a new notebook, selecting Sagemath 9.6 as the kernel, the kernel 
>> starts up fine and I can run code. However, while `print(2)` correctly 
>> displays the number 2, just typing `2` results in the error message shown 
>> in the title. Any suggestions? Thanks!
>>
>> Here's the full error dump:
>>
>> {{{
>>
>> --
>> OSError   Traceback (most recent call 
>> last)
>> /var/folders/z_/x5g7y7vd6wqd2kzfnmfdqjjhgn/T/ipykernel_14807/1798176506.py
>>  
>> in 
>> > 1 Integer(2)
>>
>> /private/var/tmp/sage-9.6-current/local/var/lib/sage/venv-python3.10.3/lib/python3.10/site-packages/IPython/core/displayhook.py
>>  
>> in __call__(self, result)
>> 260 self.start_displayhook()
>> 261 self.write_output_prompt()
>> --> 262 format_dict, md_dict = 
>> self.compute_format_data(result)
>> 263 self.update_user_ns(result)
>> 264 self.fill_exec_result(result)
>>
>> /private/var/tmp/sage-9.6-current/local/var/lib/sage/venv-python3.10.3/lib/python3.10/site-packages/IPython/core/displayhook.py
>>  
>> in compute_format_data(self, result)
>> 149 
>> 150 """
>> --> 151 return self.shell.display_formatter.format(result)
>> 152 
>> 153 # This can be set to True by the write_output_prompt method 
>> in a subclass
>>
>> /private/var/tmp/sage-9.6-current/local/var/lib/sage/venv-python3.10.3/lib/python3.10/site-packages/sage/repl/display/formatter.py
>>  
>> in format(self, obj, include, exclude)
>> 186 I am repper
>> 187 """
>> --> 188 sage_format, sage_metadata = self.dm.displayhook(obj)
>> 189 assert PLAIN_TEXT in sage_format, 'plain text is always 
>> present'
>> 190 
>>
>> /private/var/tmp/sage-9.6-current/local/var/lib/sage/venv-python3.10.3/lib/python3.10/site-packages/sage/repl/rich_output/display_manager.py
>>  
>> in displayhook(self, obj)
>> 825 return
>> 826 self._backend.set_underscore_variable(obj)
>> --> 827 plain_text, rich_output = 
>> self._rich_output_formatter(obj, dict())
>> 828 return self._backend.displayhook(plain_text, rich_output)
>> 829 
>>
>> /private/var/tmp/sage-9.6-current/local/var/lib/sage/venv-python3.10.3/lib/python3.10/site-packages/sage/repl/rich_output/display_manager.py
>>  
>> in _rich_output_formatter(self, obj, rich_repr_kwds)
>> 652 plain_text = self._backend.plain_text_formatter(obj, 
>> **rich_repr_kwds)
>> 653 if rich_output is None:
>> --> 654 rich_output = self._preferred_text_formatter(
>> 655 obj, plain_text=plain_text, **rich_repr_kwds)
>> 656 # promote output container types to backend-specific 
>> containers
>>
>> /private/var/tmp/sage-9.6-current/local/var/lib/sage/venv-python3.10.3/lib/python3.10/site-packages/sage/repl/rich_output/display_manager.py
>>  
>> in _preferred_text_formatter(self, obj, plain_text, **kwds)
>> 550 return out
>> 551 if want == 'unicode_art' and OutputUnicodeArt in 
>> supported:
>> --> 552 out = self._backend.unicode_art_formatter(obj, **kwds)
>> 553 if type(out) is not OutputUnicodeArt:
>> 554 raise OutputTypeException('backend returned wrong 
>> output type, require UnicodeArt')
>>
>> /private/var/tmp/sage-9.6-current/local/var/lib/sage/venv-python3.10.3/lib/python3.10/site-packages/sage/repl/rich_output/backend_base.py
>>  
>> in unicode_art_formatter(self, obj, **kwds)
>> 425 result = unicode_art(obj)
>> 426 from sage.repl.rich_output.output_basic import 
>> OutputUnicodeArt
>> --> 427 return OutputUnicodeArt(str(result))
>> 428 
>> 429 def latex_formatter(self, obj, **kwds):
>>
>> /private/var/tmp/sage-9.6-current/local/var/lib/sage/venv-python3.10.3/lib/python3.10/site-packages/sage/structure/sage_object.pyx
>>  
>> in 

[sage-support] Re: Find the matrix representations corresponding to complex numbers and quaternions.

2022-07-01 Thread John H Palmieri
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]])

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 , 
> i.e., the ring isomorphism 
>  from the field of 
> complex numbers and quaternions to the rings of corresponding matrices, 
> respectively, as described here 
> 
>  
> and here 
> ?
>
> 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/143f4daf-9e77-4b1b-92f4-ab8cde91a1bbn%40googlegroups.com.


[sage-support] Find the matrix representations corresponding to complex numbers and quaternions.

2022-07-01 Thread Hongyi Zhao
How can I find the matrix representations corresponding to complex numbers 
and quaternions with the help of SageMath , 
i.e., the ring isomorphism  
from the field of complex numbers and quaternions to the rings of 
corresponding matrices, respectively, as described here 

 
and here ?

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/94389048-17b0-486d-a576-fe07953e807bn%40googlegroups.com.