Hi, Jacopo.
Here's the biquadratic autompo
You need to use Sm and Sp instead of Sx and Sy to avoid error from autompo.
ampo += K11/4.0,"Sp*Sp",j,"Sm*Sm",j+1;
ampo += K11/4.0,"Sm*Sm",j,"Sp*Sp",j+1;
ampo += K11/4.0,"Sp*Sm",j,"Sm*Sp",j+1;
ampo += K11/4.0,"Sm*Sp",j,"Sp*Sm",j+1;
ampo += K11/1.0,"Sz*Sz",j,"Sz*Sz",j+1;
ampo += K11/2.0,"Sp*Sz",j,"Sm*Sz",j+1;
ampo += K11/2.0,"Sm*Sz",j,"Sp*Sz",j+1;
ampo += K11/2.0,"Sz*Sp",j,"Sz*Sm",j+1;
ampo += K11/2.0,"Sz*Sm",j,"Sz*Sp",j+1;
For higher-quadratic terms, you can use mathematica to expand it.