Ask Your Question

How do we define commutation relations?

asked 2022-04-22 23:09:27 +0200

tolga gravatar image

Let us say I have the following commutation relations for an algebra:




I would like to define these commutation relations and do manipulations with them. For example, I would like to calculate


How do (or, can) we do this in SageMath?

Bonus question: Can we find the Casimir operator for this algebra in SageMath?

edit retag flag offensive close merge delete


Searching the source code for 'Casimir' comes up almost empty.

John Palmieri gravatar imageJohn Palmieri ( 2022-04-23 00:07:57 +0200 )edit

Thank you! I was expecting that as it is not a straightforward calculation.

tolga gravatar imagetolga ( 2022-04-23 09:15:42 +0200 )edit

Maybe I am pushing my luck but can we define calculations like



tolga gravatar imagetolga ( 2022-04-23 11:16:03 +0200 )edit

You could define F as in my answer and then use A = F.enveloping_algebra(), and take a quotient of A by A.ideal( <your relation> , side='twosided').

John Palmieri gravatar imageJohn Palmieri ( 2022-04-23 17:06:45 +0200 )edit

Thank you, I changed .enveloping_algebra() to .universal_enveloping_algebra() as in the following

d = {('J0', 'J1'): {'J2': 1}, ('J0', 'J2'): {'J1': -1}, ('J1', 'J2'): {'J0': 2}}
F.<J0, J1, J2> = LieAlgebra(QQ, d)
A = F.universal_enveloping_algebra()
A.bracket(J0*J2, J2)

and it worked. However, if I change QQ to CC or SR, this yields the error "AttributeError: 'LieAlgebraWithStructureCoefficients_with_category' object has no attribute 'lift'". I may need to use imaginary numbers or symbolic variables in the future.

tolga gravatar imagetolga ( 2022-04-23 17:22:47 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2022-04-22 23:55:56 +0200

updated 2022-04-23 00:06:09 +0200

Lie algebra approach:

sage: d = {('J0', 'J1'): {'J2': 1}, ('J0', 'J2'): {'J1': -1}, ('J1', 'J2'): {'J0': 2}}
sage: F.<J0, J1, J2> = LieAlgebra(QQ, d)
sage: F
Lie algebra on 3 generators (J0, J1, J2) over Rational Field
sage: F.bracket(J0, J1)
sage: F.bracket(J0, F.bracket(J0, J1))
sage: F.bracket(J0, F.bracket(J0, J1)) + F.bracket(F.bracket(J1, J2), J1)
-J1 + 2*J2

Flawed approach below; feel free to ignore (or work on Sage to improve things!).

The following naïve approach doesn't seem to work well in Sage:

sage: F.<J0,J1,J2> = FreeAlgebra(QQ)
sage: def comm(x,y): return x*y-y*x
sage: I = F.ideal(comm(J0, J1) - J2, comm(J0, J2) + J1, comm(J1, J2) - 2*J0)
sage: A = F.quotient(I)

sage: comm(J0, comm(J0, J1)) + comm(comm(J1, J2), J1)
J0^2*J1 - 2*J0*J1*J0 + J1*J0^2 - J1^2*J2 + 2*J1*J2*J1 - J2*J1^2
sage: A(comm(J0, comm(J0, J1)) + comm(comm(J1, J2), J1))
J0bar^2*J1bar - 2*J0bar*J1bar*J0bar + J1bar*J0bar^2 - J1bar^2*J2bar + 2*J1bar*J2bar*J1bar - J2bar*J1bar^2

This is clearly flawed. It can't even tell that the generators of the ideal are sent to zero in the quotient:

sage: [A(x)==0 for x in I.gens()]
[False, False, False]

Another approach would be to construct the algebra from scratch. You should be able to describe a vector space basis for it, so you can then construct it using CombinatorialFreeModule, the way Clifford algebras (among many other examples) are constructed in Sage.

edit flag offensive delete link more


Thank you! This should do the job for me.

tolga gravatar imagetolga ( 2022-04-23 09:17:09 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2022-04-22 23:09:27 +0200

Seen: 485 times

Last updated: Apr 23 '22