File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -4329,10 +4329,15 @@ def coxeter_transformation(self):
4329
4329
"""
4330
4330
return self ._hasse_diagram .coxeter_transformation ()
4331
4331
4332
- def coxeter_polynomial (self ):
4332
+ def coxeter_polynomial (self , algorithm = "sage" ):
4333
4333
"""
4334
4334
Return the Coxeter polynomial of the poset.
4335
4335
4336
+ INPUT:
4337
+
4338
+ - ``algorithm`` -- optional (default: ``"sage"``) ;
4339
+ the unique other option is ``"magma"``
4340
+
4336
4341
OUTPUT: a polynomial in one variable
4337
4342
4338
4343
The output is the characteristic polynomial of the Coxeter
@@ -4349,11 +4354,22 @@ def coxeter_polynomial(self):
4349
4354
sage: p.coxeter_polynomial() # needs sage.groups sage.libs.flint
4350
4355
x^6 + x^5 - x^3 + x + 1
4351
4356
4357
+ TESTS::
4358
+
4359
+ sage: P = posets.PentagonPoset()
4360
+ sage: P.coxeter_polynomial("magma") # optional - magma
4361
+ x^5 + x^4 + x + 1
4362
+
4352
4363
.. SEEALSO::
4353
4364
4354
4365
:meth:`coxeter_transformation`, :meth:`coxeter_smith_form`
4355
4366
"""
4356
- return self ._hasse_diagram .coxeter_transformation ().charpoly ()
4367
+ cox_matrix = self ._hasse_diagram .coxeter_transformation ()
4368
+ if algorithm == "magma" :
4369
+ from sage .interfaces .magma import magma
4370
+ dense_matrix = magma (cox_matrix ).Matrix ()
4371
+ return dense_matrix .CharacteristicPolynomial ().sage ()
4372
+ return cox_matrix .charpoly ()
4357
4373
4358
4374
def coxeter_smith_form (self , algorithm = 'singular' ):
4359
4375
"""
You can’t perform that action at this time.
0 commit comments