Building orthogonal supecells


In [1]:
import numpy
from siman.geo import ortho_vec, create_supercell
from siman.calc_manage import smart_structure_read
%matplotlib inline


/home/aksenov/simanrc.py was read

HCP Ti


In [4]:
st = smart_structure_read(input_geo_file = 'ti_hcp.POSCAR') # read hcp lattice

print('Initial vectors:\n', numpy.array(st.rprimd) )

mul_matrix = ortho_vec(st.rprimd, [10,10,10]) # matrix which allows to obtain supercell close to 10x10x10 A cube 

print('\nMultiplication matrix:\n', mul_matrix, '\n')

sc = create_supercell(st, mul_matrix)

sc.write_xyz(filename = 'ti_supercell') #save to xyz/ti_supercell.xyz


-- You provided the following geo file explicitly  ti_hcp.POSCAR ; Version of file does not matter, I use *curver*= 1 as a new version 

Initial vectors:
 [[ 2.546 -1.47   0.   ]
 [ 0.     2.94   0.   ]
 [ 0.     0.     4.65 ]]

Multiplication matrix:
 [[4 2 0]
 [0 3 0]
 [0 0 2]] 

New vectors (rprimd) of supercell:
 [[ 10.2   0.    0. ]
 [  0.    8.8   0. ]
 [  0.    0.    9.3]] 
-- The supercell should contain 48.0 atoms ...   -- OK 

-- File xyz/ti_supercell.xyz was written 

Bi2Se3

Construct large supercell for Bi2Se3. mp = 15 is needed to account all atoms


In [3]:
st = smart_structure_read(input_geo_file = 'Bi2Se3_mp-541837_computed.POSCAR') 
mul_matrix = ortho_vec(st.rprimd, [100, 98, 100]) # matrix which allows to obtain supercell close to 100x98x100 A cube 
print('Initial vectors:\n', numpy.array(st.rprimd) )

print('\nMultiplication matrix:\n', mul_matrix, '\n')
sc = create_supercell(st, mul_matrix, mp = 15) # larger *mp* values allow to find all atoms in supercell 
sc.write_xyz(filename = 'Bi2Se3_supercell')


-- You provided the following geo file explicitly  Bi2Se3_mp-541837_computed.POSCAR ; Version of file does not matter, I use *curver*= 1 as a new version 

Initial vectors:
 [[  4.103097   0.         9.409867]
 [  1.962329   3.603424   9.409867]
 [  0.         0.        10.265525]]

Multiplication matrix:
 [[ 24   0 -22]
 [-13  27 -13]
 [  0   0  10]] 

New vectors (rprimd) of supercell:
 [[  98.5    0.    -0. ]
 [  -0.4   97.3   -1.7]
 [   0.     0.   102.7]] 
-- The supercell should contain 32400.0 atoms ...   -- OK 

-- File xyz/Bi2Se3_supercell.xyz was written 

α-quartz P3_121


In [2]:
from calc_manage import get_structure_from_matproj
st = get_structure_from_matproj(mat_proj_id = 'mp-7000') #get SiO2 structure


Structure mp-7000 downloaded from materialsproject.org
 File mp-7000.POSCAR was written 

-- You provided the following geo file explicitly  mp-7000.POSCAR ; Version of file does not matter, I use *curver*= 1 as a new version 


In [3]:
print('Initial vectors:\n', numpy.array(st.rprimd) )

mul_matrix = ortho_vec(st.rprimd, [54, 54, 54])

print('\nMultiplication matrix:\n', mul_matrix, '\n')

sc = create_supercell(st, mul_matrix, mp = 8)

sc.write_xyz(filename = 'alpha_quartz')
print('Z of elements are: ',st.znucl, '; use the same order for *charges* list') #show atom types
sc.write_lammps(filename = 'alpha_quartz', charges = [-1.46, 2.92]  ) #write structure for lammps


Initial vectors:
 [[ 5.021502  0.        0.      ]
 [-2.510751  4.348749  0.      ]
 [ 0.        0.        5.51057 ]]

Multiplication matrix:
 [[11  0  0]
 [ 6 12  0]
 [ 0  0 10]] 

New vectors (rprimd) of supercell:
 [[ 55.2   0.    0. ]
 [  0.   52.2   0. ]
 [  0.    0.   55.1]] 
-- The supercell should contain 11880.0 atoms ...   -- OK 

-- File xyz/alpha_quartz.xyz was written 

Z of elements are:  [8, 14] ; use the same order for *charges* list
-- Warining! write_lammps(): this func supports only orthogonal cells 

-- File alpha_quartz.inp was written