[sage-support] Re: Quaternions and Lorentz Transformations

2022-04-22 Thread 'Alan Stafford' via sage-support
I was trying to look at the link between quaternions and twistor space. I did a little notebook. Not exactly what you are looking at but it might help. On Saturday, April 16, 2022 at 10:55:31 AM UTC+1 ny22...@gmail.com wrote: > I am trying to understand how to use Quaternions within sagemath to

[sage-support] Re: Quaternions, how to speed up computation

2018-11-19 Thread HG
sage-support is one of the best list. English is not my mother language and sometimes I don't explain myself well but always people here are very kind and trying to help... It's very important this can long ! Le vendredi 14 septembre 2018 18:00:55 UTC+2, Peter Luschny a écrit : > > How can I spe

Re: [sage-support] Re: Quaternions, how to speed up computation

2018-11-19 Thread Kolen Cheung
Thanks. This answer my question and I put the tip in https://groups.google.com/d/msg/sage-support/NFtI5XqjQWg/sz5WPcFMAgAJ On Monday, November 19, 2018 at 3:58:50 AM UTC-8, John Cremona wrote: > > I recommend importing anything you need from sage.all since the details of > where everything is mi

Re: [sage-support] Re: Quaternions, how to speed up computation

2018-11-19 Thread Kolen Cheung
I wonder why for me the result is >>> import_statements(QQ) # ** Warning **: several names for that object: Q, QQ from sage.rings.rational_field import Q On Monday, November 19, 2018 at 4:05:55 AM UTC-8, Dima Pasechnik wrote: On Mon, Nov 19, 2018 at 11:58 AM John Cremona > wrote: > > > > I

Re: [sage-support] Re: Quaternions, how to speed up computation

2018-11-19 Thread Dima Pasechnik
On Mon, Nov 19, 2018 at 11:58 AM John Cremona wrote: > > I recommend importing anything you need from sage.all since the details of > where everything is might change in time. This works perfectly well: > > $ sage -python # so we use Sage's python not my system-wide one > Python 2.7.15 (default

Re: [sage-support] Re: Quaternions, how to speed up computation

2018-11-19 Thread John Cremona
I recommend importing anything you need from sage.all since the details of where everything is might change in time. This works perfectly well: $ sage -python # so we use Sage's python not my system-wide one Python 2.7.15 (default, Nov 2 2018, 14:32:42) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] o

[sage-support] Re: Quaternions, how to speed up computation

2018-11-19 Thread Kolen Cheung
Thank you both for the answers. However, I’m still stuck: Focusing on just translating the first line: R. = QQ[] In sage, >>> preparse("R. = QQ[]")"R = QQ['x']; (x,) = R._first_ngens(1)">>> >>> import_statements(QQ)# ** Warning **: several names for that object: Q, >>> QQfrom sage.rings.rati

[sage-support] Re: Quaternions, how to speed up computation

2018-11-19 Thread slelievre
Mon 2018-11-19 09:41:03 UTC+1, Simon King: > > If I recall correctly, there is a function that for *many* (not all) > interactively created objects in Sage tells how they can be constructed, > but I don't recall the name of that function. That is sage_input, which can be used as follows: s

[sage-support] Re: Quaternions, how to speed up computation

2018-11-19 Thread Simon King
Hi On 2018-11-19, Kolen Cheung wrote: > Then I thought I can import it in Python like this: > > import sage.rings > # OK > > sage.rings.polynomial.polynomial_ring.PolynomialRing_field > # AttributeError Admittedly the following is not an ideal solution, but you can do >>> from sage import all

[sage-support] Re: quaternions

2008-03-27 Thread Justin C. Walker
On Mar 27, 2008, at 18:04 , Chris Godsil wrote: > > Just for reference, two comments on the documentation for quaternions: > > If x is an element of L as below, then neither x? nor x?? returns any > information about methods that apply to x. Tthe '?' and '??' operators only handle defined method

[sage-support] Re: quaternions

2008-03-27 Thread Chris Godsil
Just for reference, two comments on the documentation for quaternions: If x is an element of L as below, then neither x? nor x?? returns any information about methods that apply to x. Second, in the documentation on quaternions in the reference manual, there is no reference that I could find to

[sage-support] Re: quaternions

2008-03-27 Thread John Cremona
Although Justin's solution certainly works, one might consider adding a "real_part()" function to the quaternion class. But it would not do to call the function "real_part" since of course it depends on the ground field (which in the example is QQ and not RR). I am CC'ing sage-devel since this m

[sage-support] Re: quaternions

2008-03-27 Thread Justin Walker
On Mar 27, 2008, at 12:58 PM, Chris Godsil wrote: > > I want to extract the "real part" of a quaternion, i.e., if > > L. = QuaternionAlgebra(QQ,-1,-1); > > and a is in L, then I want the coefficient of 1 in the expansion of as > a linear combination of 1, i, j and k. > > Is there a way to do thi