151
General Questions and Answers / how should i write a script to specify the different initial_scaled_spin
« on: January 14, 2011, 13:34 »
how should i write a script to specify the different initial_scaled_spin for different atoms in differnt region (has some rules)
hi. i have wrote a script including below small code:
for index in range(len(scattering_elements)):
if (scattering_elements[index]=="Carbon") :
if (scattering_coordinates[index][2]> 17):
scattering_region_initial_scaled_spin[index]=1
elif (scattering_coordinates[index][2]< 13):
scattering_region_initial_scaled_spin[index]=1
else:
scattering_region_initial_scaled_spin[index]=0
this code is used to specify initial_scaled_spin for the atoms in scattering region(obey some rules see the if
language), but there is errror:
Traceback (most recent call last):
File "two-my-own-scf-ALL-DZP.py", line 143, in ?
scattering_region_initial_scaled_spin[index]=0
NameError: name 'scattering_region_initial_scaled_spin' is not defined
how should i revised my code, i have a look at the manual ATK(2008)Page 215, the script is similar to mine, but
still can not find a way to solve.
ps: i am a beginner in python.
hi. i have wrote a script including below small code:
for index in range(len(scattering_elements)):
if (scattering_elements[index]=="Carbon") :
if (scattering_coordinates[index][2]> 17):
scattering_region_initial_scaled_spin[index]=1
elif (scattering_coordinates[index][2]< 13):
scattering_region_initial_scaled_spin[index]=1
else:
scattering_region_initial_scaled_spin[index]=0
this code is used to specify initial_scaled_spin for the atoms in scattering region(obey some rules see the if
language), but there is errror:
Traceback (most recent call last):
File "two-my-own-scf-ALL-DZP.py", line 143, in ?
scattering_region_initial_scaled_spin[index]=0
NameError: name 'scattering_region_initial_scaled_spin' is not defined
how should i revised my code, i have a look at the manual ATK(2008)Page 215, the script is similar to mine, but
still can not find a way to solve.
ps: i am a beginner in python.