owing a tiny deviation
% from the propagation vector of [0 0 1/7].

banb.optmagk
banb.optmagsteep('nRun',1e4)
banb.genmagstr('mode','rotate','n',[0 0 1])
E2 = banb.energy;
E2-E1

% The vetor normal to the rotation is opposite compared to the manual
% magnetic structure, while the propagation vector is the same. Thus the
% optimized magnetic structure has opposite chirality than the manual
% structure. So we should change the chirality. Instead we restore the
% manual magnetic structure.
banb.mag_str = Mag0;