It's probably a matter that ExteriorAlgebraElement has a "cdef _mul_" now. 
That means in cython code it can access the method if it has enough type 
information. That's probably why `p*p` works. It looks like in 
sage.matrix.matrix_generic_dense.Matrix_generic_dense._multiply_classical 
not enough type info is available on left._entries[m+k] to look up this 
_mul_ . It may be that the correct typecast, something like "(<Element> 
left._entries[m+k])" perhaps, does the trick. Or perhaps _mul_ is supposed 
to be "def" or "cpdef". I doubt the latter, though, since for the most 
part, multiplication seems to work: the coercion framework can figure out 
how to do it:

sage: coercion_model.bin_op(p,p,operator.mul)
0

it makes sense that matrix multiplication takes a shortcut to avoid the 
overhead of the coercion framework. But perhaps it doesn't have enough type 
info.

On Thursday, 6 March 2025 at 15:43:02 UTC-8 Seth Chaiken wrote:

> In Sage 10.4,
> Ext=ExteriorAlgebra(QQ,['p'])
> Ext.inject_variables()
> Mp = matrix(1,1,[[p]])
> Mp[0,0]*Mp[0,0]
> -> 0
> Mp*Mp 
> FAILS!
> (This did work in an older version.)
> --------------------------------------------------------------------------- 
> TypeError Traceback (most recent call last) Cell In[10], line 1 ----> 1 Mp
> *Mp File /data/Software/Sage/sage/src/sage/structure/element.pyx:4116, in 
> sage.structure.element.Matrix.__mul__() 4114 # better be square for the 
> product to be defined. 4115 if (<Matrix>left)._nrows == 
> (<Matrix>left)._ncols: -> 4116 return 
> (<Matrix>left)._matrix_times_matrix_(<Matrix>right) 4117 else: 4118 
> parent = (<Matrix>left)._parent File 
> /data/Software/Sage/sage/src/sage/matrix/matrix0.pyx:5675, in 
> sage.matrix.matrix0.Matrix._matrix_times_matrix_() 5673 return 
> self._multiply_strassen(right) 5674 else: -> 5675 return 
> self._multiply_classical(right) 5676 5677 cdef bint 
> _will_use_strassen(self, Matrix right) except -2: File 
> /data/Software/Sage/sage/src/sage/matrix/matrix_generic_dense.pyx:323, in 
> sage.matrix.matrix_generic_dense.Matrix_generic_dense._multiply_classical
> () 321 m = i*snc 322 for k in range(snc): --> 323 z += 
> left._entries[m+k]._mul_(right._entries[k*nc+j]) 324 v[p] = z 325 p += 1 
> TypeError: 'NotImplementedType' object is not callable
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/sage-support/39a9ffb3-acfc-4795-8450-44c0c361f425n%40googlegroups.com.

Reply via email to