# $Source: /u/maple/research/lib/DEtools/src/RCS/symmetric_power,v $ # $Notify: mvanhoei@daisy.uwaterloo.ca $ macro( DF=`DEtools/diffop/DF`, x=`DEtools/diffop/x`, symmetric_power=`DEtools/diffop/symmetric_power`, symmetric_product=`DEtools/diffop/symmetric_product`, exterior_power=`DEtools/diffop/exterior_power`, substitute=`DEtools/diffop/substitute`, to_diffop=`DEtools/diffop/to_diffop`, to_eqn=`DEtools/diffop/to_eqn` ): # The purpose of this file is to do the type checking and conversions # for the file DEtools/diffop/symmetric_power # Input a differential operator L # Or: a differential equation. # Output: the n'th symmetric_power `DEtools/symmetric_power`:=proc(L,n::nonnegint,domain) global DF,x; local d,M; option `Copyright (c) 1997 Waterloo Maple Inc. All rights reserved. Author: M. van Hoeij`; d:=`if`(nargs>2,domain,_Envdiffopdomain); if type(d,function) then return to_eqn(procname(to_diffop(L,d),n,[DF,x]),d) elif nops(d)<>2 then error "differential algebra not specified" fi; M:=collect(L,d[1],evala@Normal); if n=0 then d[1] elif M=0 then 0 elif not(has(M,d[1])) then 1 else # call the symmetric_power code sort(subs(DF=d[1],x=d[2], symmetric_power(subs(d[1]=DF,d[2]=x,M),n)),d[1]) fi end: #savelib('`DEtools/symmetric_power`'): # Input differential operator L1, L2, ... and the differential # algebra (must be the last argument) # Output: the n'th symmetric_product `DEtools/symmetric_product`:=proc() local d,b,i,A; option `Copyright (c) 1997 Waterloo Maple Inc. All rights reserved. Author: M. van Hoeij`; # Boolean b: domain specified? b:=evalb(nargs>0 and type(args[nargs],list)); d:=`if`(b,args[nargs],_Envdiffopdomain); if nops(d)<>2 then error "differential algebra not specified" fi; # remove the domain input from the arguments and collect(..,DF) A:=[seq(collect(args[i],d[1],evala@Normal),i=1..nargs-`if`(b,1,0))]; if A=[] then # product over an empty list is 1, minimal operator for # that is DF return d[1] fi; # remove constant operators: if A<>[seq(`if`(i<>0 and not(has(i,d[1])),NULL,i),i=A)] then return 1 elif member(0,A) then return 0 fi; if nops(A)=2 and not(has(A[2]-d[1],d[1])) then A:=[A[2],A[1]] fi; A:=subs(d[1]=DF,d[2]=x,A); if nops(A)=2 and not(has(A[1]-DF,DF)) then # this is a bit faster than symmetric_product: A:=substitute(op(A)); else A:=symmetric_product(op(A)) fi; sort(subs(DF=d[1],x=d[2],A),d[1]) end: #savelib('`DEtools/symmetric_product`'): # Input a differential operator L # Or: a differential equation. # Output: the n'th exterior_power `DEtools/exterior_power`:=proc(L,n::posint,domain) global DF,x; local d,M; option `Copyright (c) 1997 Waterloo Maple Inc. All rights reserved. Author: M. van Hoeij`; d:=`if`(nargs>2,domain,_Envdiffopdomain); if type(d,function) then return to_eqn(procname(to_diffop(L,d),n,[DF,x]),d) elif nops(d)<>2 then error "differential algebra not specified" fi; M:=collect(L,d[1],evala@Normal); if M=0 then 0 elif not(has(M,d[1])) then 1 else # call the exterior_power code sort(subs(DF=d[1],x=d[2], exterior_power(op(subs(d[1]=DF,d[2]=x,[M,n])),n)),d[1]) fi end: #savelib('`DEtools/exterior_power`'):