23 | | sage: m2=matrix(CF~~C~~,[[-1, 1, 2*af],[-4*af*bf - 1, 4*af*bf + 4*bf^2, 4*af*bf + 2*af],[-2*af, 2*af + 2*bf, 2*af]]) |

| 23 | sage: m2=matrix(CF,[[-1, 1, 2*af],[-4*af*bf - 1, 4*af*bf + 4*bf^2, 4*af*bf + 2*af],[-2*af, 2*af + 2*bf, 2*af]]) |

| 29 | |

| 30 | Here is a univariate example where I disactivated the verification on cyclotomic fields on line 962 of the file /src/sage/matrix/matrix_space.py to get a matrix_generic_dense instead of matrix_cyclo_dense. |

| 31 | |

| 32 | {{{ |

| 33 | sage: PR=PolynomialRing(QQ,[x]) |

| 34 | sage: I=Ideal(x^2 - 1/2*x - 1/4) |

| 35 | sage: Q=PR.quotient(I) |

| 36 | sage: elmt_uni=matrix(Q,[[-2*x, 1, 6*x + 2],[-2*x, 2*x, 4*x + 1],[0,0,1]]) |

| 37 | sage: %timeit elmt_uni*elmt_uni |

| 38 | 1000 loops, best of 3: 1.46 ms per loop |

| 39 | |

| 40 | sage: CF.<F>=CyclotomicField(2*5) |

| 41 | sage: f5=(F+~F)/2 |

| 42 | sage: m=matrix(CF,[[-2*f5, 1, 6*f5 + 2],[-2*f5, 2*f5, 4*f5 + 1],[0,0,1]]) |

| 43 | sage: m.parent() |

| 44 | Full MatrixSpace of 3 by 3 dense matrices over Cyclotomic Field of order 10 and degree 4 |

| 45 | sage: type(m) |

| 46 | <type 'sage.matrix.matrix_generic_dense.Matrix_generic_dense'> |

| 47 | sage: %timeit m*m |

| 48 | 1000 loops, best of 3: 251 µs per loop |

| 49 | }}} |

| 50 | |

| 51 | The gain is significant. Is there a known use cases where the specialized implementation is faster than the generic one? If yes, should we make some threshold test to choose between the two implementations? |