Create the Lorentz group in Sagemath.

105 views
Skip to first unread message

Hongyi Zhao

unread,
May 26, 2022, 3:11:55 AM5/26/22
to sage-support
How can I create the Lorentz group, as described here [1], in Sage math?


Regards,
HZ

Nils Bruin

unread,
May 29, 2022, 6:27:18 AM5/29/22
to sage-support
It depends a little on what coefficients you want. If you're happy with rational numbers then this should do the trick:

G = diagonal_matrix(QQ,4,[-1,1,1,1])
lorentz_group = GO(4,QQ,invariant_form=G)

which just constructs the group of (in this case QQ-valued) matrices that preserve the quadratic form -t^2+x^2+y^2+z^2. Depending on what you actually want to do with it, you may be more interested in SO or perhaps the construction of its lie group/algebra.

Hongyi Zhao

unread,
May 31, 2022, 2:43:54 AM5/31/22
to sage-support
On Sunday, May 29, 2022 at 6:27:18 PM UTC+8 Nils Bruin wrote:
It depends a little on what coefficients you want. If you're happy with rational numbers then this should do the trick:

As far as the Lorentz group is concerned, I think it should be constructed on real numbers filed in general, but I'm not sure if sage math has the corresponding implementation on real numbers filed.
 

G = diagonal_matrix(QQ,4,[-1,1,1,1])
lorentz_group = GO(4,QQ,invariant_form=G)

which just constructs the group of (in this case QQ-valued) matrices that preserve the quadratic form -t^2+x^2+y^2+z^2. Depending on what you actually want to do with it, you may be more interested in SO

SO only includes the part where the determinant is equal to 1 in GO, which is not in line with the requirements of Lorentz group, IMO.

or perhaps the construction of its lie group/algebra.

The Lorentz group is a Lie group of symmetries of the spacetime of special relativity, as described here [1]. So, I'm not sure if your above code snippet also corresponds to a Lie group.


Regards,
HZ

Nils Bruin

unread,
May 31, 2022, 1:55:45 PM5/31/22
to sage-support
The "GO" mentioned here should correspond to the O(3;1) (or perhaps O(1;3) ) mentioned in the wikipedia article.

The problem with the "real numbers" is that representing many elements exactly in it is complicated. For many algebraic questions, you can probably get away with considering the group over Q (or some finite extensions).

I'm not entirely sure if the connected component SO^+ is readily implemented in sage.

"creation" of a mathematical object (particularly an infinite one) is a rather relative notion anyway: technically speaking

class LorentzGroup:
    pass

can be passed off as a class whose instances represent the Lorentz group: there are just many features that haven't been implemented (yet). It's probably worth checking if the object described above meets your needs. If not, then describing a little more about what you need might help an expert in giving you further tips.

Hongyi Zhao

unread,
May 31, 2022, 11:41:33 PM5/31/22
to sage-support
On Wednesday, June 1, 2022 at 1:55:45 AM UTC+8 Nils Bruin wrote:
The "GO" mentioned here should correspond to the O(3;1) (or perhaps O(1;3) ) mentioned in the wikipedia article.

Do you mean that these two ways of writing are a matter of convention?
 

The problem with the "real numbers" is that representing many elements exactly in it is complicated. For many algebraic questions, you can probably get away with considering the group over Q (or some finite extensions).

The Lorentz group is a physical problem, not just a pure algebraic problem, so, I am not sure whether this simplified treatment can meet the needs of the problem in any case.


I'm not entirely sure if the connected component SO^+ is readily implemented in sage.

"creation" of a mathematical object (particularly an infinite one) is a rather relative notion anyway: technically speaking

class LorentzGroup:
    pass

can be passed off as a class whose instances represent the Lorentz group: there are just many features that haven't been implemented (yet). It's probably worth checking if the object described above meets your needs.

You only gave the above two lines of code, so I don't know what you mean here.

If not, then describing a little more about what you need might help an expert in giving you further tips.

Yours,
Hongyi

Nils Bruin

unread,
Jun 1, 2022, 2:34:26 AM6/1/22
to sage-support
On Wednesday, 1 June 2022 at 05:41:33 UTC+2 hongy...@gmail.com wrote:
On Wednesday, June 1, 2022 at 1:55:45 AM UTC+8 Nils Bruin wrote:
The "GO" mentioned here should correspond to the O(3;1) (or perhaps O(1;3) ) mentioned in the wikipedia article.

Do you mean that these two ways of writing are a matter of convention?

setting t,x,y,z as coordinates on 4-space, O(3;1) is the group of matrices preserving the quadratic form t^2+x^2+y^2-z^2 (three plusses, one minus) and O(1;3) the group of matrices preserving the quadratic form t^2-x^2-y^2-z^2 (one plus, three minuses).
Hence, the definitions of the two groups are different: it's not just convention. The two groups are isomorphic, though, and one isomorphism is given by swapping t and z.

Hongyi Zhao

unread,
Jun 1, 2022, 3:33:00 AM6/1/22
to sage-support
Thank you for your explanation and clarification.

Regards,
HZ
Reply all
Reply to author
Forward
0 new messages