asking on kron_del



this one work like charm..thanks a lot for your help..
i'm reading this paper" A full quantum theory of parametric down conversion
...." by sergey a. podoshvedov and jaewoo noh.
i try to solve to get equation for 18a in page 218

so here my code so far and its good to go when i simplify the result
----braket.mac----
declare(k, integer);
declare(A, integer);
declare(B, integer);
declare(x1, integer);
declare(x2, integer);
declare(y1, integer);
declare(y2, integer);
declare(n, integer);

declare(k, scalar);
declare(A, scalar);
declare(B, scalar);
declare(x1,scalar);
declare(x2,scalar);
declare(y1,scalar);
declare(y2,scalar);
declare(n,scalar);

declare(bra, nonscalar);
declare(ket, nonscalar);

matchdeclare(x1,lambda([t],featurep(t,integer)));
matchdeclare(x2,lambda([t],featurep(t,integer)));
matchdeclare(y1,lambda([t],featurep(t,integer)));
matchdeclare(y2,lambda([t],featurep(t,integer)));
matchdeclare(n,lambda([t],featurep(t,integer)));

matchdeclare(a, lambda([s], not mapatom(s) and op(s) = 'bra), b, lambda([s],
not mapatom(s) and op(s) = 'ket));
tellsimpafter(a.b, kron_delta(args(a), args(b)));

dotscrules:true;

tellsimp(I.ket(x1,x2,y1,y2), ket(x1,x2,y1,y2));

tellsimp(Lx1.ket(x1,x2,y1,y2), sqrt(x1)*ket(x1-1,x2,y1,y2));
tellsimp(Rx1.ket(x1,x2,y1,y2), sqrt(x1+1)*ket(x1+1,x2,y1,y2));

tellsimp(Lx2.ket(x1,x2,y1,y2), sqrt(x2)*ket(x1,x2-1,y1,y2));
tellsimp(Rx2.ket(x1,x2,y1,y2), sqrt(x2+1)*ket(x1,x2+1,y1,y2));

tellsimp(Ly1.ket(x1,x2,y1,y2), sqrt(y1)*ket(x1,x2,y1-1,y2));
tellsimp(Ry1.ket(x1,x2,y1,y2), sqrt(y1+1)*ket(x1,x2,y1+1,y2));

tellsimp(Ly2.ket(x1,x2,y1,y2), sqrt(y2)*ket(x1,x2,y1,y2-1));
tellsimp(Ry2.ket(x1,x2,y1,y2), sqrt(y2+1)*ket(x1,x2,y1,y2+1));

declare(I, linear);
declare(Lx1, linear);
declare(Rx1, linear);
declare(Lx2, linear);
declare(Rx2, linear);
declare(Ly1, linear);
declare(Ry1, linear);
declare(Ly2, linear);
declare(Ry2, linear);


matchdeclare(k,lambda([t],featurep(t,integer)));

tellsimp((Lx1^^k).ket(x1,x2,y1,y2), (Lx1^^(k-1)).(Lx1.ket(x1,x2,y1,y2)));
tellsimp((Rx1^^k).ket(x1,x2,y1,y2), (Rx1^^(k-1)).(Rx1.ket(x1,x2,y1,y2)));

tellsimp((Lx2^^k).ket(x1,x2,y1,y2), (Lx2^^(k-1)).(Lx2.ket(x1,x2,y1,y2)));
tellsimp((Rx2^^k).ket(x1,x2,y1,y2), (Rx2^^(k-1)).(Rx2.ket(x1,x2,y1,y2)));

tellsimp((Ly1^^k).ket(x1,x2,y1,y2), (Ly1^^(k-1)).(Ly1.ket(x1,x2,y1,y2)));
tellsimp((Ry1^^k).ket(x1,x2,y1,y2), (Ry1^^(k-1)).(Ry1.ket(x1,x2,y1,y2)));

tellsimp((Ly2^^k).ket(x1,x2,y1,y2), (Ly2^^(k-1)).(Ly2.ket(x1,x2,y1,y2)));
tellsimp((Ry2^^k).ket(x1,x2,y1,y2), (Ry2^^(k-1)).(Ry2.ket(x1,x2,y1,y2)));

tellsimp(I^^k, I);

tellsimp(((Lx1.Rx1)^^k).ket(x1,x2,y1,y2),
((Lx1.Rx1)^^(k-1)).(Lx1.Rx1.ket(x1,x2,y1,y2)));
tellsimp(((Rx1.Lx1)^^k).ket(x1,x2,y1,y2),
((Rx1.Lx1)^^(k-1)).(Rx1.Lx1.ket(x1,x2,y1,y2)));
tellsimp(((Lx2.Rx1)^^k).ket(x1,x2,y1,y2),
((Lx2.Rx1)^^(k-1)).(Lx2.Rx1.ket(x1,x2,y1,y2)));
tellsimp(((Rx2.Lx1)^^k).ket(x1,x2,y1,y2),
((Rx2.Lx1)^^(k-1)).(Rx2.Lx1.ket(x1,x2,y1,y2)));
tellsimp(((Ly1.Rx1)^^k).ket(x1,x2,y1,y2),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ket(x1,x2,y1,y2)));
tellsimp(((Ry1.Ly2)^^k).ket(x1,x2,y1,y2),
((Ry1.Ly2)^^(k-1)).(Ry1.Ly2.ket(x1,x2,y1,y2)));
tellsimp(((Ly2.Ry2)^^k).ket(x1,x2,y1,y2),
((Ly2.Ry2)^^(k-1)).(Ly2.Ry2.ket(x1,x2,y1,y2)));
tellsimp(((Ry2.Ly2)^^k).ket(x1,x2,y1,y2),
((Ry2.Ly2)^^(k-1)).(Ry2.Ly2.ket(x1,x2,y1,y2)));


tellsimp(Rx1.Lx1, Lx1.Rx1-I);
tellsimp(Rx2.Lx2, Lx2.Rx2-I);
tellsimp(Ry1.Ly1, Ly1.Ry1-I);
tellsimp(Ry2.Ly2, Ly2.Ry2-I);


declare(i, integer);
declare(i, scalar);
declare(j, integer);
declare(j, scalar);
---------------------------------------------------
in maxima load this file and then give specific problem which is

bra(n,0,0,n).(cos(B)*sqrt(0.5)*(-%i*Rx1+Rx2)+sin(B)*sqrt(0.5)*(+%i*Ry1+Ry2)).(cos(A)*sqrt(0.5)*(Rx1-%i*Rx2)+sin(A)*sqrt(0.5)*(Ry1+%i*Ry2)).(cos(B)*sqrt(0.5)*(%i*Lx1+Lx2)+sin(B)*sqrt(0.5)*(-%i*Ly1+Ly2)).(cos(A)*sqrt(0.5)*(Lx1+%i*Lx2)+sin(A)*sqrt(0.5)*(Ly1-%i*Ly2)).ket(n,0,0,n)

this term
(cos(B)*sqrt(0.5)*(-%i*Rx1+Rx2)+sin(B)*sqrt(0.5)*(+%i*Ry1+Ry2)).(cos(A)*sqrt(0.5)*(Rx1-%i*Rx2)+sin(A)*sqrt(0.5)*(Ry1+%i*Ry2)).(cos(B)*sqrt(0.5)*(%i*Lx1+Lx2)+sin(B)*sqrt(0.5)*(-%i*Ly1+Ly2)).(cos(A)*sqrt(0.5)*(Lx1+%i*Lx2)+sin(A)*sqrt(0.5)*(Ly1-%i*Ly2))

is the operator that use in the experiment.

thanks a lot for all help here :D


On Thu, May 19, 2011 at 11:39 PM, Barton Willis <willisb at unk.edu> wrote:

> The Maxima name for the Kronecker delta function is kron_delta, not
> kron_del; also,
> (e1,e2, ..., en) is a compound statement--evaluation proceeds from left to
> right.
> The last evaluation is the value of the compound statement. (I don't know
> where in the online help this is explained--it's difficult to find.)
>
> Example:
>
>  (%i1) (1,2,3);
>  (%o1) 3
>
> Other readers of this list are much more skilled with tellsimp rules than I
> am, but
> I'm guessing you want something like:
>
>  (%i1) matchdeclare(a, lambda([s], not mapatom(s) and op(s) = 'bra), b,
> lambda([s], not mapatom(s) and op(s) = 'ket));
>  (%o1) done
>
>  (%i2) tellsimpafter(a.b, kron_delta(args(a), args(b)));
>  (%o2) [.rule1,simpnct]
>
>  (%i3) bra(3,6,7) . ket(3,6,7);
>  (%o3) 1
>
>  (%i5) bra(1,0,1) . ket(1,0,1,8);
>  (%o5) 0
>
>  (%i6) bra(1,0,0,1).ket(1,0,0,1);
>  (%o6) 1
>
> --Barton
>
> -----maxima-bounces at math.utexas.edu wrote: -----
>
> >To: maxima at math.utexas.edu
> >From: razif razali <razif66 at gmail.com>
> >Sent by: maxima-bounces at math.utexas.edu
> >Date: 05/18/2011 11:49PM
> >Subject: asking on kron_del
> >
> >I try to make this equation <1,0,0,1 | 1,0,0,1> = 1 and else is equal to 0
> >like what kron_del command give
> >i giving maxima some rule,
> >tellsimp(bra(m,n,o,l).ket(l,o,m,n),kron_del((m,n,o,l),(m,n,o,l)));
> >
> >but when i execute bra(1,0,0,1).ket(1,0,0,1) it just give kron_del(1,1)
> >and the value should be 1 right?so how can do this in right way so that I
> >can get 1 for same bra and ket while 0 for different bra and ket.
> >
> >--
> >Regards,
> >
> >RAZIF RAZALI,
> >Tutor & Master Student,
> >Physics Department,
> >Faculty Of Science,
> >Universiti Teknologi Malaysia(UTM).
> >+60199393606
> >
> >
> >
> >
> >
> >_______________________________________________
> >Maxima mailing list
> >Maxima at math.utexas.edu
> >http://www.math.utexas.edu/mailman/listinfo/maxima




-- 
Regards,

RAZIF RAZALI,
Tutor & Master Student,
Physics Department,
Faculty Of Science,
Universiti Teknologi Malaysia(UTM).
+60199393606
-------------- next part --------------
A non-text attachment was scrubbed...
Name: A_Full_Quantum_Theory_of_PDC_and_Its_Application_to_Coincidence_Measurements_05.pdf
Type: application/pdf
Size: 392619 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20110520/d0b0bda9/attachment-0001.pdf>;