Source code for dpgen.data.tools.diamond

import numpy as np

[docs]def numb_atoms () : return 2
[docs]def gen_box () : box = [[0.000000, 1.000000, 1.000000], [1.000000, 0.000000, 1.000000], [1.000000, 1.000000, 0.000000] ] return np.array(box)
[docs]def poscar_unit (latt) : box = gen_box() ret = "" ret += "DIAMOND\n" ret += "%.16f\n" % (latt) ret += "%.16f %.16f %.16f\n" % (box[0][0], box[0][1], box[0][2]) ret += "%.16f %.16f %.16f\n" % (box[1][0], box[1][1], box[1][2]) ret += "%.16f %.16f %.16f\n" % (box[2][0], box[2][1], box[2][2]) ret += "Type\n" ret += "%d\n" % numb_atoms() ret += "Direct\n" ret += "%.16f %.16f %.16f\n" % (0.12500000000000, 0.12500000000000, 0.12500000000000) ret += "%.16f %.16f %.16f\n" % (0.87500000000000, 0.87500000000000, 0.87500000000000) return ret