co = CrystalOut.from_file(c.out_file) dcm = CrystalMatrix.from_file(c.dm_file, co.cell, CrystalMatrix.DENSITY, 1e-3) ocm = CrystalMatrix.from_file(c.olp_file, co.cell, CrystalMatrix.OVERLAP, 1e-3) write_xyz(co.cell.cell, 'cell.xyz') #write_xyz(cm.cell.supercell, 'supercell.xyz') read_baders(co.cell) num = int(sys.argv[1]) layers = int(sys.argv[2]) electro = int(sys.argv[3]) center = co.cell.cell[num - 1] centers = [center] tmpshells = co.cell.neighbours.neighbours_cluster(centers, 2) for a in tmpshells[-1]: if a.name() != center.name(): centers.append(a) cluster = Cluster(co.cell, centers, layers, electro) key = AtomKeys.BADER_CHARGE cluster.estimate_charges_mulliken(dcm.matrix, ocm.matrix, key) dirname = "cluster_test%d_%d_%d" % (num, layers, electro) cluster.write_structure(dirname) cluster.write_charges(key, dirname) cluster.write_embedding(key, dirname)
init_log(sys.argv) d = DAT_INPUT.from_file('temporal_12345.input') write_xyz(d.cell.cell, 'cell.xyz') read_baders(d.cell) dm, olp, atoms = read_matrices(d.cell, 1e-3) num = int(sys.argv[1]) layers = int(sys.argv[2]) electro = int(sys.argv[3]) centers = [d.cell.cell[num - 1]] cluster = Cluster(d.cell, centers, layers, electro) cluster.estimate_charges(dm, olp) dirname = "cluster%d_%d_%d" % (num, layers, electro) cluster.write_structure(dirname) cluster.write_charges(dirname) cluster.write_embedding(dirname) rewrite_files(d, cluster, dirname)
from qcldm.structures.cluster_embedding import Cluster from qcldm.structures.atom_vector import AtomKeys init_log(sys.argv) co = CrystalOut.from_file('out') for a in co.cell.atoms: if a.name() == 'Yb': a.data()[AtomKeys.ESTIMATED_VALENCE] = 3 a.data()[AtomKeys.ESTIMATED_CHARGE] = 3 write_xyz(co.cell.cell, 'cell.xyz') write_xyz(co.cell.supercell, 'supercell.xyz') num = int(sys.argv[1]) layers = int(sys.argv[2]) electro = int(sys.argv[3]) centers = [co.cell.cell[num - 1]] cluster = Cluster(co.cell, centers, layers, electro) key = AtomKeys.MULLIKEN_CHARGE cluster.estimate_charges_dumb(key) dirname = "cluster_%d_%d_%d" % (num, layers, electro) cluster.write_structure(dirname) cluster.write_charges(key, dirname) cluster.write_embedding(key, dirname)
import re, sys, math, logging sys.dont_write_bytecode = True from qcldm.openmx_format.dat_format import DAT_INPUT from qcldm.util.log_colorizer import init_log from qcldm.util.xyz_format import write_xyz from qcldm.structures.cluster_embedding import Cluster init_log(sys.argv) d = DAT_INPUT.from_file('test.dat') write_xyz(d.cell.cell, 'cell.xyz') num = int(sys.argv[1]) layers = int(sys.argv[2]) electro = int(sys.argv[3]) center = d.cell.cell[num - 1] centers = [center] tmpshells = d.cell.neighbours.neighbours_cluster(centers, 2) for a in tmpshells[-1]: if a.name() != center.name(): centers.append(a) cluster = Cluster(d.cell, centers, layers, electro) dirname = "cluster_test%d_%d_%d" % (num, layers, electro) cluster.load_atoms_dummy() cluster.write_structure(dirname)