<jupyter_start><jupyter_text>Now prepared the spins of diamond lattice and save<jupyter_code># Create diamond or o8b superlattice
sc6 = np.zeros([8*6**3,7]) # atIdx0-32, cell index x,y,z, atom index x, y, z
idx = 0
ibox = 0
for i in xrange(6):
    for j in xrange(6):
        for k in xrange(6):
            for l in np.arange(0,8):
                tetra = np.array(orBonds[orBonds[:,0]==l,1:5],dtype='int32')
                #print tetra
                idxCell = np.array([i,j,k] + tetra[:,1:4])
                idxCell = np.where(idxCell==6,0,idxCell)
                #print idxCell
                # 0:3 for Px, 3:6 for Px, 6 :9 for Pz
                sumTetra = spins[ibox,idxCell[:,0],idxCell[:,1],idxCell[:,2],tetra[:,0],0:3].sum(axis=0) 
                sc6[idx,:] = np.hstack((np.array([l+1,i,j,k]),sumTetra))
                idx = idx + 1
idxCell = np.array([[-1,0,0],[0,1, 0]])
[1,2,3]+ idxCell
np.where(idxCell==-1,0,idxCell)
# Save
path = r'D:\9_Program files\SpinVert\gdzro_ill\gd_ill_60mk-20k_with_paramag\diamond_correlations\spinice_spins_01_diamond.txt'

# second save super lattice
f = open(path, 'w+') # append
f.write('TITLE spin \n')
f.write('CELL 10.440 10.440 10.440 90.00 90.00 90.00\n')

names  = np.repeat('SITE',8)
outputs = map(lambda x: "%s  %f %f %f " % (x[0],x[1][0],x[1][1],x[1][2]),
              zip(names,o8b)) 
data = '\n'.join(outputs)+'\n' # Concat all strings in list, separated by line break
f.write(data)

f.write('BOX 6 6 6\nFORM_FACTOR_J0 0 0 0\n\
PROPOSED_MOVES 0\nACCEPTED_MOVES 0\nWEIGHT 3\nCHI_SQUARED 14\nR_FACTOR 3.4\nSCALE 72\n\
FLAT_BACKGROUND 0.0\nLINEAR_BACKGROUND 0\n')

names  = np.repeat('SPIN',8*6**3).astype('str')
outputs = map(lambda x: "%s %i %i %i %i %f %f %f " % (x[0],x[1][0],x[1][1],x[1][2],x[1][3],x[1][4],x[1][5],x[1][6]),
              zip(names, sc6)) 
data = '\n'.join(outputs) # Concat all strings in list, separated by line break
f.write(data)
f.close()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19274028629856851, 'fraction_numerical': 0.0679959100204499, 'mean_word_length': 3.2176724137931036, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '197080', 'license': 'MIT', 'n_tokens_mistral': 909, 'n_tokens_neox': 832, 'n_words': 170, 'path': 'scientific_data_analysis/reverse_MC_result_analysis/Mapping2Diamond_lattice.ipynb', 'repo_name': 'jh-xu/scientific_data_analysis', 'size': '1956'}