1 /* written by Furuya <go.maxima@gmail.com>
2 # This program is free software; you can redistribute it and/or modify
3 # it under the terms of the GNU General Public License as published by
4 # the Free Software Foundation; either version 2 of the License, or
5 # (at your option) any later version.
8 /* need to do load("diag") */
9 /* poisson braket operator */
11 p_braket(_f,_g):= block([_x,_a,_b,_j,_jj:[],basis ],
12 mode_declare([_x,_a,_b],any),
15 basis:endcons('basis[i],basis)
17 _x:coefmatrix([d(_f)],basis),
18 _j:matrix([0,1],[-1,0]),
19 for i:1 thru dim/2 do (
21 _b:(_x.diag(_jj)).basis,