---
# System prepended metadata

title: Dp_Alloy working record

---

# Dp_Alloy working record

## 20190625

Preparing initial data:
--
We will prepare initial data for metal by building 2*2*2 super cells  with such three basic strutures.
1. fcc
2. hcp
3. bcc

Each system will be perturbed to 30 structures. Each run md for 20 steps and thus obtaining 600 frames.

Lattice-Constants for relaxing are fixed by:

+ Element Mass Density($g/cm^3$) Lattice-Constant(Angstrom) 
+ Mg  24 1.774 4.479
+ Al  27 2.72 4.034
+ Cu  64 8.888 3.630
+ Zn  65 6.981  3.954
+ Zr  91 6.446 4.543
+ Ti 47.87 4.647 4.09
+ Li 6.9 0.573 4.308
+ Ge 72.63 
Script:
```python=
def cal(mass, density):
    return (mass / 6.023e+23 *4 / density) ** (1/3) * 1e+8
```

Work path:
`/gpfs/share/home/1600017784/start/data`

Json path:
`/gpfs/share/home/1600017784/start/data/new_jsons`

POTCAR path:
`/gpfs/share/home/1600017784/start/data/POTCAR`

INCAR path:
`/gpfs/share/home/1600017784/start/pku_input_set/`


In current case, we only consider 5 none-metal elements: *B C Si P S*

Structures can be downloaded by following script:

```python=
#!/usr/bin/env python
import os
from pymatgen import Structure
from pymatgen import MPRester
from pymatgen.analysis.structure_analyzer import SpacegroupAnalyzer


web="materials.org"

def check_apikey():
    try:
       apikey=os.environ['MAPI_KEY']
       mpr = MPRester(apikey)
       return(mpr)
    except:
       print(" you have to get a MAPI_KEY from "+web)
       print(" and execute following command:")
       print(" echo export MAPI_KEY='yourkey' >> ~/.bashrc")
       print(" source ~/.bashrc")
       os._exit()

def get_conventional_cell(struct):
    sa=SpacegroupAnalyzer(struct)
    return sa.get_conventional_standard_structure()

mpr=check_apikey()
# all none-metal structures
all_d={"C":['mp-66','mp-47','mp-1188817'],
        'B':['mp-160','mp-1193675','mp-1202723'],
        'S':['mp-10869','mp-7'],
        'Si':['mp-149','mp-165','mp-1072544'],
        'P':['mp-130','mp-157','mp-12883']
        }
# supercell 
sc_d={
   'C':[1,2,1],
   'B':[1,1,1],
   'S':[3,1],
   'Si':[1,2,1],
   'P':[[2,2,1],[2,1,2],1]
  }
# download structure
for formula in all_d:
    for i,sid in enumerate(all_d[formula]):
        try:
           struct=mpr.get_structure_by_material_id(sid)
           assert formula in struct.symbol_set and len(struct.symbol_set)==1
           conv_struct=get_conventional_cell(struct)
           scn=sc_d[formula][i]
           conv_struct.make_supercell(scn)
           conv_struct.to(fmt='poscar',filename=formula+"_"+sid+'_conventional.vasp')
           abc=conv_struct.lattice.abc
           print('%s: mp-id %s ->\t %d %8.4f %8.4f %8.4f'%(formula,sid,len(conv_struct),abc[0],abc[1],abc[2]))
           
           struct.to(fmt='poscar',filename=formula+"_"+sid+'_primitive.vasp')
        except:
           print('%s: mp-id %s  fail'%(formula,sid))
```


##  20190627

Today we set up initial data jobs for non-metal crystals on the machine.

The POSCAR path for non-mental crystals is ` /gpfs/share/home/1600017784/start/none_metal_element `

Note that there are some differences between INCARs for metal and non-metal.

+ Metal : ISMEAR  =  1 SIGMA   =  0.22
+ Non-Metal : ISMEAR  =  0 SIGMA   =  0.02

POTCAR path:

`/gpfs/share/home/1600017784/start/pku_input_set/INCAR_metal_rlx_low`

`/gpfs/share/home/1600017784/start/pku_input_set/INCAR_metal_md`

`/gpfs/share/home/1600017784/start/pku_input_set/INCAR_nonmetal_rlx_low`

`/gpfs/share/home/1600017784/start/pku_input_set/INCAR_nonmetal_md


## 20190704


+ Al Li Cu Zr Ti 


## 最优先级： 
+ haiid: 更新代码
+ yuzhi: dpgen-Al 跑起来
## Expect 周一前
+ yuzhi:  data自动化,元素大小写的bug，合金从poscar开始的功能
+ haiid： local版程序重启功能
+ han: surf.py 去除lammps依赖

## 长期
+ init的unit-test


## 20190712
+ 0 - 2 Tc
0.5 
一个iteration

+ 50G Pa  
+ 对Li 特殊处理（太活泼）
+ 一个block 8个 iteration

+ 压强范围 1 10 100 1000 5000 10000 20000 50000


+ 构型数 5 5 10 10 10 10 20 20


+ MD steps: 1000 1000 3000 3000
+ DFT: ( 300 * 3 / 40) 0.5 h 

+ trust level 0.05 0.15

+ 高于 T_c 后 0.1 0.3

+ 用VASP GPU 要用 统一标准

+ 找清楚GPU配置  机器谁在用


+ 伟杰VASP benchmark 在未名一号机器


+ haiid 
    1.按照supplement material 准备
    2. 检查初始
+ yuzhi

    generator :
    1.Al Zr 跑起来
    2.
+ travis python3 3.6devel 3.6.3
surf 


## 20190720

代码改动：
1. 支持对sys_configs添加prefix (#35 by Yuzhi) 
2. 把`python setup.py` install 替换成`pip install .`通过了travis的unittest （# 35 by Jinzhe）
3. 将xml文件加入到`02.fp`的`back_files`中，在`post_fp`按照  `OUTCAR` &`xml`的顺序读取数据，如果个别vasp结果出错，保证generator继续进行。 (#39 by haidi)
4. 在`01.model_devi`和`02.fp`的每个文件夹中打印当前md的温压信息，便于入库 (#39 by yuzhi)
5. 开发支持AWS machine的接口并跑通甲烷样例 (#40 by Fengbo)
6. 



