On Thursday, June 18, 2020 at 5:00:00 AM UTC-7, kcrisman wrote:
>
>
> I assume that would need a pretty major change in the preparser?  Does 
> other mathematical software use this as a convention?  (Just asking, no 
> presuppositions here.) 
>

No, not the preparser. It would affect the coercion framework quite a bit, 
though. It would mean that __lshift__ and __rshift__ need to be hooked into 
left actions and right actions. Using ">>" and "<<" for actions has the 
large advantage that the methods are for the most part available. The 
coercion framework can already discover left and right multiplicative 
actions (used for scalar multiplication and matrix actions on modules), so 
I'd expect it can be made to discover "shift" actions by specifying the 
relevant operator. The operator precedence in python look way off, though: 
1 + 3<<2 == 16.

I think it has the large drawback that it doesn't look like math notation 
at all, whereas function application and exponentiation does. I'd be 
uncomfortable using it.

To compare: magma has function-application-on-the right in the notation x@f 
and map composition f*g (for right action). So with

QQ:=Rationals();
f:=map<QQ->QQ|x:->x+1>;
g:=map<QQ->QQ|x:->x^2>;

1@(f*g) == 1@f@g == 4

Magma also has left application as a notational help, but then

(f*g)(1) == 1@(f*g) == 4 so function composition really doesn't work well 
with that notation.

Permutations just act on the right, with exponentiation as notation. So if

S3:=SymmetricGroup(3); 
a:=S3!(1,2,3); 
b:=S3!(1,2); 

then this hold: 1^(a*b) == (1^a)^b


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/2d912002-7324-4c56-929c-d059d7000bb0o%40googlegroups.com.

Reply via email to