% script2 - this will compute ALx^2 + BLy^2 + CLz^2 for angular momentum 2

syms A B C hbar real

lplus=hbar * [		0		2		0		0		0; 			...
      				0		0	sqrt(6)	0		0; 			...
                  0		0		0 	sqrt(6)	0;				...
                  0		0		0		0		2;				...
               	0		0		0		0		0 ];
            
lminus=lplus';
            
lz=hbar * [			2		0		0		0		0; 			...
      				0		1		0		0		0; 			...
                  0		0		0		0		0;				...
                  0		0		0		-1		0;				...
               	0		0		0		0		-2 ];
            
H=1/4 * ((A-B) * (lplus*lplus+lminus*lminus) 	...
	+ (A+B) * (lplus*lminus+lminus*lplus)) 		...
   + C*lz*lz;

H