tsdev / spinw

SpinW Matlab library for spin wave calculation
www.psi.ch/spinw
GNU General Public License v3.0
30 stars 35 forks source link

Question about SpinW manual and pyspinw (ADDCOUPLING) #58

Open tombadmanship opened 6 years ago

tombadmanship commented 6 years ago

I have been figuring out how to use this program over the past couple of days. I can't get the 'addcoupling' function to work for my system in pyspinw 3.0.0. Specifically, I'm trying to generate an antiferromagnetic coupling between 16 atoms using addmatrix and gencoupling.

here is my code for generating the negative J coupling (is it correct?):

H_sys.addmatrix('value',-np.eye(3),'label','J1')

Here is my code for generating the coupling:

H_sys.addcoupling('J1',1)

Thank you.

wardsimon commented 6 years ago

Hi,

The code for generating the negative couplings is correct but adding it to the bond should be:

H_sys.addcoupling('mat','J1','bond',1.)

Simon