Example: NaSiCON (x = 1-4)
Primitive Cell
For the primitive cell (2 f.u.), 2x is an integer between 2-8. Then x is
[2,3,4..8]/2 = 1, 1.5, 2, 2.5, 3, 3.5 and 4
Super Cell
In 211 supercell (4 f.u.) 4x is a integer between 4-16. Then the ‘x’ in my script is:
[4,5,6…16]/4 = [1,1.25,2.5 …3.75,4]
The site occupancy for each Na is x/4 = [0.25,0.3125, …,1] which is reasonable. And I think Si and P are correct as well.
As a double check:
‘x = 1.25’: the code generated which is reduced as: ‘x = 2.25’: the code generated which is reduced as:
from pymatgen.transformations.standard_transformations import OrderDisorderedStructureTransformation, SubstitutionTransformation, AutoOxiStateDecorationTransformation,SupercellTransformation`
from pymatgen.alchemy.transmuters import PoscarTransmuter, CifTransmuter
from pymatgen.io.vasp.sets import MVLScanRelaxSet
from pymatgen.alchemy.filters import RemoveDuplicatesFilter
import re,os,multiprocessing
import numpy as np
from joblib import Parallel, delayed
source ="../EntryWithCollCode15546_Na4Zr2Si3O12_573K.cif"
home_dir = os.getcwd()
def ordering(x):
work_dir = home_dir+'/Na'+str(x)
os.mkdir(work_dir)
os.chdir(work_dir)
nasiconT = CifTransmuter.from_filenames([source], transformations=[AutoOxiStateDecorationTransformation()], primitive = True)
nasiconT.append_transformation(SupercellTransformation(scaling_matrix=((2, 0, 0), (0, 1, 0), (0, 0, 1))))
# Nax Zr2 Six-1 P4-x O12, x = 1-4`
chem_dict = {"Na+": {"Na+": x/4.0}, "Si4+" : {"Si4+": (x-1)/3.0, "P5+": (4-x)/3.0}}
nasiconT.append_transformation(SubstitutionTransformation(chem_dict))
nasiconT.append_transformation(OrderDisorderedStructureTransformation(),extend_collection=500)
print ("Total ordering:", len(nasiconT),chem_dict)
nasiconT.apply_filter(RemoveDuplicatesFilter())
print ("Reduce ordering:",len(nasiconT),chem_dict)
incar_mod = {"EDIFF" : 1e-5, "EDIFFG" : -0.01, "NSW" : 150, "NCORE" : 12, "LPLANE" : "True", "NSIM" : 4, "ISYM" : 0, "NELMIN" : 4, "ISPIN" : 1, "ISMEAR": 0}
nasiconT.write_vasp_input(vasp_input_set=MVLScanRelaxSet,potcar_functional='PBE_54', user_incar_settings=incar_mod, include_cif=True)
x_list = np.arange(4,16)/4
num_cores = multiprocessing.cpu_count()
print('Start structure generation over',num_cores,'Cores........')
Parallel(n_jobs=num_cores)(delayed(ordering)(x) for x in x_list)