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

syms A B C hbar

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

H