diff --git a/dpdata/abacus/md.py b/dpdata/abacus/md.py index 9e0a416a..bbb02343 100644 --- a/dpdata/abacus/md.py +++ b/dpdata/abacus/md.py @@ -12,6 +12,7 @@ get_cell, get_coords, get_geometry_in, + get_mag_force, kbar2evperang3, ) @@ -199,6 +200,9 @@ def get_frame(fname): stress[iframe] *= np.linalg.det(cells[iframe, :, :].reshape([3, 3])) if np.sum(np.abs(stress[0])) < 1e-10: stress = None + + magmom, magforce = get_mag_force(outlines) + data = {} data["atom_names"] = atom_names data["atom_numbs"] = natoms @@ -213,5 +217,9 @@ def get_frame(fname): if not isinstance(data["virials"], np.ndarray): del data["virials"] data["orig"] = np.zeros(3) + if len(magmom) > 0: + data["spins"] = magmom + if len(magforce) > 0: + data["mag_forces"] = magforce return data diff --git a/dpdata/abacus/relax.py b/dpdata/abacus/relax.py index 7a4abf35..be80bc90 100644 --- a/dpdata/abacus/relax.py +++ b/dpdata/abacus/relax.py @@ -13,6 +13,7 @@ get_cell, get_coords, get_geometry_in, + get_mag_force, kbar2evperang3, ) @@ -198,6 +199,8 @@ def get_frame(fname): lines, atomnumber ) + magmom, magforce = get_mag_force(lines) + data = {} data["atom_names"] = atom_names data["atom_numbs"] = natoms @@ -211,4 +214,9 @@ def get_frame(fname): data["stress"] = stress data["orig"] = np.zeros(3) + if len(magmom) > 0: + data["spins"] = magmom + if len(magforce) > 0: + data["mag_forces"] = magforce + return data diff --git a/dpdata/abacus/scf.py b/dpdata/abacus/scf.py index 93e3d6e1..9919e912 100644 --- a/dpdata/abacus/scf.py +++ b/dpdata/abacus/scf.py @@ -112,6 +112,152 @@ def get_cell(geometry_inlines): return celldm, cell +def parse_stru_pos(pos_line): + """Parses a line from the atom position block in a structure file. + + The content in atom position block can include: + - `m` or NO key word: Three numbers (0 or 1) controlling atom movement in geometry relaxation calculations. + - `v`, `vel`, or `velocity`: Three components of initial velocity of atoms in geometry relaxation calculations. + - `mag` or `magmom`: Start magnetization for each atom. Can be one number (colinear) or three numbers (non-colinear). + - `angle1`: In non-colinear case, angle between c-axis and real spin (in degrees). + - `angle2`: In non-colinear case, angle between a-axis and real spin projection in ab-plane (in degrees). + - `cs` or `constrain`: Three numbers (0 or 1) controlling the spin constraint of the atom. + - `lambda`: Three numbers controlling the lambda of the atom. + + Parameters + ---------- + pos_line : A line from the atom position block. + + Returns + ------- + tuple: A tuple containing: + - pos (list of float): The position coordinates. + - move (list of int or None): Movement control values. + - velocity (list of float or None): Initial velocity components. + - magmom (float, list of float, or None): Magnetization values. + - angle1 (float or None): Angle1 value. + - angle2 (float or None): Angle2 value. + - constrain (list of bool or None): Spin constraint values. + - lambda1 (float, list of float, or None): Lambda values. + + e.g.: + ``` + Fe + 1.0 + 2 + 0.0 0.0 0.0 m 0 0 0 mag 1.0 angle1 90 angle2 0 cs 0 0 0 + 0.5 0.5 0.5 m 1 1 1 mag 1.0 angle1 90 angle2 180 + ``` + """ + pos_line = pos_line.split("#")[0] # remove comments + sline = pos_line.split() + pos = [float(i) for i in sline[:3]] + move = None + velocity = None + magmom = None + angle1 = None + angle2 = None + constrain = None + lambda1 = None + if len(sline) > 3: + mag_list = None + velocity_list = None + move_list = [] + angle1_list = None + angle2_list = None + constrain_list = None + lambda_list = None + label = "move" + for i in range(3, len(sline)): + # firstly read the label + if sline[i] == "m": + label = "move" + elif sline[i] in ["v", "vel", "velocity"]: + label = "velocity" + velocity_list = [] + elif sline[i] in ["mag", "magmom"]: + label = "magmom" + mag_list = [] + elif sline[i] == "angle1": + label = "angle1" + angle1_list = [] + elif sline[i] == "angle2": + label = "angle2" + angle2_list = [] + elif sline[i] in ["constrain", "sc"]: + label = "constrain" + constrain_list = [] + elif sline[i] in ["lambda"]: + label = "lambda" + lambda_list = [] + + # the read the value to the list + elif label == "move": + move_list.append(int(sline[i])) + elif label == "velocity": + velocity_list.append(float(sline[i])) + elif label == "magmom": + mag_list.append(float(sline[i])) + elif label == "angle1": + angle1_list.append(float(sline[i])) + elif label == "angle2": + angle2_list.append(float(sline[i])) + elif label == "constrain": + constrain_list.append(bool(int(sline[i]))) + elif label == "lambda": + lambda_list.append(float(sline[i])) + + if move_list is not None and len(move_list) > 0: + if len(move_list) == 3: + move = move_list + else: + raise RuntimeError(f"Invalid setting of move: {pos_line}") + + if velocity_list is not None: + if len(velocity_list) == 3: + velocity = velocity_list + else: + raise RuntimeError(f"Invalid setting of velocity: {pos_line}") + + if mag_list is not None: + if len(mag_list) == 3: + magmom = mag_list + elif len(mag_list) == 1: + magmom = mag_list[0] + else: + raise RuntimeError(f"Invalid magnetic moment {pos_line}") + + if angle1_list is not None: + if len(angle1_list) == 1: + angle1 = angle1_list[0] + else: + raise RuntimeError(f"Invalid angle1 {pos_line}") + + if angle2_list is not None: + if len(angle2_list) == 1: + angle2 = angle2_list[0] + else: + raise RuntimeError(f"Invalid angle2 {pos_line}") + + if constrain_list is not None: + if len(constrain_list) == 3: + constrain = constrain_list + elif len(constrain_list) == 1: + constrain = constrain_list[0] + else: + raise RuntimeError(f"Invalid constrain {pos_line}") + + if lambda_list is not None: + if len(lambda_list) == 3: + lambda1 = lambda_list + elif len(lambda_list) == 1: + lambda1 = lambda_list[0] + else: + raise RuntimeError(f"Invalid lambda {pos_line}") + + return pos, move, velocity, magmom, angle1, angle2, constrain, lambda1 + + def get_coords(celldm, cell, geometry_inlines, inlines=None): coords_lines = get_stru_block(geometry_inlines, "ATOMIC_POSITIONS") # assuming that ATOMIC_POSITIONS is at the bottom of the STRU file @@ -120,6 +266,14 @@ def get_coords(celldm, cell, geometry_inlines, inlines=None): atom_types = [] # index of atom_names of each atom in the geometry atom_numbs = [] # of atoms for each element coords = [] # coordinations of atoms + move = [] # move flag of each atom + velocity = [] # velocity of each atom + mag = [] # magnetic moment of each atom + angle1 = [] # angle1 of each atom + angle2 = [] # angle2 of each atom + sc = [] # spin constraint flag of each atom + lambda_ = [] # lambda of each atom + ntype = get_nele_from_stru(geometry_inlines) line_idx = 1 # starting line of first element for it in range(ntype): @@ -128,7 +282,10 @@ def get_coords(celldm, cell, geometry_inlines, inlines=None): atom_numbs.append(int(coords_lines[line_idx].split()[0])) line_idx += 1 for iline in range(atom_numbs[it]): - xyz = np.array([float(xx) for xx in coords_lines[line_idx].split()[0:3]]) + pos, imove, ivelocity, imagmom, iangle1, iangle2, iconstrain, ilambda1 = ( + parse_stru_pos(coords_lines[line_idx]) + ) + xyz = np.array(pos) if coord_type == "cartesian": xyz = xyz * celldm elif coord_type == "direct": @@ -141,6 +298,15 @@ def get_coords(celldm, cell, geometry_inlines, inlines=None): ) coords.append(xyz) atom_types.append(it) + + move.append(imove) + velocity.append(ivelocity) + mag.append(imagmom) + angle1.append(iangle1) + angle2.append(iangle2) + sc.append(iconstrain) + lambda_.append(ilambda1) + line_idx += 1 coords = np.array(coords) # need transformation!!! atom_types = np.array(atom_types) @@ -234,15 +400,57 @@ def get_stress(outlines): return np.array(stress[-1]) * kbar2evperang3 # only return the last stress +def get_mag_force(outlines): + """Read atomic magmom and magnetic force from OUT.ABACUS/running_scf.log. + + Returns + ------- + magmom: list of list of atomic magnetic moments (three dimensions: ION_STEP * NATOMS * 1/3) + magforce: list of list of atomic magnetic forces (three dimensions: ION_STEP * NATOMS * 1/3) + e.g.: + ------------------------------------------------------------------------------------------- + Total Magnetism (uB) + ------------------------------------------------------------------------------------------- + Fe 0.0000000001 0.0000000000 3.0000000307 + Fe -0.0000000000 -0.0000000000 3.0000001151 + ------------------------------------------------------------------------------------------- + ------------------------------------------------------------------------------------------- + Magnetic force (eV/uB) + ------------------------------------------------------------------------------------------- + Fe 0.0000000000 0.0000000000 -1.2117698671 + Fe 0.0000000000 0.0000000000 -1.2117928796 + ------------------------------------------------------------------------------------------- + + """ + mags = [] + magforces = [] + for i, line in enumerate(outlines): + if "Total Magnetism (uB)" in line: + j = i + 2 + mag = [] + while "-------------------------" not in outlines[j]: + mag.append([float(ii) for ii in outlines[j].split()[1:]]) + j += 1 + mags.append(mag) + if "Magnetic force (eV/uB)" in line: + j = i + 2 + magforce = [] + while "-------------------------" not in outlines[j]: + magforce.append([float(ii) for ii in outlines[j].split()[1:]]) + j += 1 + magforces.append(magforce) + return np.array(mags), np.array(magforces) + + def get_frame(fname): data = { "atom_names": [], "atom_numbs": [], "atom_types": [], - "cells": [], - "coords": [], - "energies": [], - "forces": [], + "cells": np.array([]), + "coords": np.array([]), + "energies": np.array([]), + "forces": np.array([]), } if isinstance(fname, str): @@ -272,6 +480,12 @@ def get_frame(fname): atom_names, natoms, types, coords = get_coords( celldm, cell, geometry_inlines, inlines ) + magmom, magforce = get_mag_force(outlines) + if len(magmom) > 0: + magmom = magmom[-1:] + if len(magforce) > 0: + magforce = magforce[-1:] + data["atom_names"] = atom_names data["atom_numbs"] = natoms data["atom_types"] = types @@ -291,6 +505,11 @@ def get_frame(fname): if stress is not None: data["virials"] = stress[np.newaxis, :, :] data["orig"] = np.zeros(3) + + if len(magmom) > 0: + data["spins"] = magmom + if len(magforce) > 0: + data["mag_forces"] = magforce # print("atom_names = ", data['atom_names']) # print("natoms = ", data['atom_numbs']) # print("types = ", data['atom_types']) @@ -313,12 +532,9 @@ def get_nele_from_stru(geometry_inlines): ] keyword_sequence = [] keyword_line_index = [] - atom_names = [] - atom_numbs = [] for iline, line in enumerate(geometry_inlines): if line.split() == []: continue - have_key_word = False for keyword in key_words_list: if keyword in line and keyword == line.split()[0]: keyword_sequence.append(keyword) @@ -343,7 +559,7 @@ def get_frame_from_stru(fname): with open_file(fname) as fp: geometry_inlines = fp.read().split("\n") nele = get_nele_from_stru(geometry_inlines) - inlines = ["ntype %d" % nele] + inlines = [f"ntype {nele}"] celldm, cell = get_cell(geometry_inlines) atom_names, natoms, types, coords = get_coords( celldm, cell, geometry_inlines, inlines @@ -366,32 +582,180 @@ def make_unlabeled_stru( numerical_orbital=None, numerical_descriptor=None, mass=None, + move=None, + velocity=None, + mag=None, + angle1=None, + angle2=None, + sc=None, + lambda_=None, + link_file=False, + dest_dir=None, + **kwargs, ): + """Make an unlabeled STRU file from a dictionary. + + Parameters + ---------- + data : dict + System data + frame_idx : int + The index of the frame to dump + pp_file : list of string or dict, optional + List of pseudo potential files, or a dictionary of pseudo potential files for each atomnames + numerical_orbital : list of string or dict, optional + List of orbital files, or a dictionary of orbital files for each atomnames + numerical_descriptor : str, optional + numerical descriptor file + mass : list of float, optional + List of atomic masses + move : list of list of bool, optional + List of the move flag of each xyz direction of each atom + velocity : list of list of float, optional + List of the velocity of each xyz direction of each atom + mag : list of (list of float or float), optional + List of the magnetic moment of each atom, can be a list of three floats or one float + For noncollinear, three floats are the xyz component of the magnetic moment. + For collinear, one float is the norm of the magnetic moment. + angle1 : list of float, optional + List of the angle1 of each atom. For noncollinear calculation, it is the angle between the magnetic moment and the z-axis. + angle2 : list of float, optional + List of the angle2 of each atom. For noncollinear calculation, it is the angle between the projection of magnetic moment on xy plane and the x-axis. + sc : list of (bool or list of 3 bool), optional + List of the spin constraint flag of each atom. Each element can be a bool or a list of three bools or None. + lambda_ : list of (float or list of 3 float), optional + List of the lambda of each atom. Each element can be a float or a list of three floats. + link_file : bool, optional + Whether to link the pseudo potential files and orbital files in the STRU file. + If True, then only filename will be written in the STRU file, and make a soft link to the real file. + For velocity, mag, angle1, angle2, sc, and lambda_, if the value is None, then the corresponding information will not be written. + ABACUS support defining "mag" and "angle1"/"angle2" at the same time, and in this case, the "mag" only define the norm of the magnetic moment, and "angle1" and "angle2" define the direction of the magnetic moment. + If data has spins, then it will be written as mag to STRU file; while if mag is passed at the same time, then mag will be used. + """ + + def _link_file(dest_dir, src_file): + if not os.path.isfile(src_file): + print(f"ERROR: link_file: {src_file} is not a file.") + return False + src_file = os.path.abspath(src_file) + if not os.path.isdir(dest_dir): + os.makedirs(dest_dir) + dest_file = os.path.join(dest_dir, os.path.basename(src_file)) + if os.path.isfile(dest_file): + if os.path.samefile(src_file, dest_file): + return True + else: + os.remove(dest_file) + os.symlink(src_file, dest_file) + return True + + def ndarray2list(i): + if isinstance(i, np.ndarray): + return i.tolist() + else: + return i + + if link_file and dest_dir is None: + print( + "WARNING: make_unlabeled_stru: link_file is True, but dest_dir is None. Will write the filename to STRU but not making soft link." + ) + if dest_dir is not None and dest_dir.strip() == "": + dest_dir = "." + + if mag is None and data.get("spins") is not None and len(data["spins"]) > 0: + mag = data["spins"][frame_idx] + + atom_numbs = sum(data["atom_numbs"]) + for key in [move, velocity, mag, angle1, angle2, sc, lambda_]: + if key is not None: + if ( + not isinstance(ndarray2list(key), (list, tuple)) + and len(key) != atom_numbs + ): + key_name = [name for name, value in locals().items() if value is key][0] + print( + f"ERROR: make_unlabeled_stru: the length of '{key_name}' ({len(key)}) should be equal to the number of atom number ({atom_numbs})." + ) + return "" + + # ATOMIC_SPECIES block out = "ATOMIC_SPECIES\n" + if pp_file is not None: + pp_file = ndarray2list(pp_file) for iele in range(len(data["atom_names"])): + if data["atom_numbs"][iele] == 0: + continue out += data["atom_names"][iele] + " " if mass is not None: out += f"{mass[iele]:.3f} " else: out += "1 " if pp_file is not None: - out += f"{pp_file[iele]}\n" - else: - out += "\n" + if isinstance(pp_file, (list, tuple)): + ipp_file = pp_file[iele] + elif isinstance(pp_file, dict): + if data["atom_names"][iele] not in pp_file: + print( + f"ERROR: make_unlabeled_stru: pp_file does not contain {data['atom_names'][iele]}" + ) + ipp_file = None + else: + ipp_file = pp_file[data["atom_names"][iele]] + else: + ipp_file = None + if ipp_file is not None: + if not link_file: + out += ipp_file + else: + out += os.path.basename(ipp_file.rstrip("/")) + if dest_dir is not None: + _link_file(dest_dir, ipp_file) + + out += "\n" out += "\n" + # NUMERICAL_ORBITAL block if numerical_orbital is not None: assert len(numerical_orbital) == len(data["atom_names"]) + numerical_orbital = ndarray2list(numerical_orbital) out += "NUMERICAL_ORBITAL\n" - for iele in range(len(numerical_orbital)): - out += f"{numerical_orbital[iele]}\n" + for iele in range(len(data["atom_names"])): + if data["atom_numbs"][iele] == 0: + continue + if isinstance(numerical_orbital, (list, tuple)): + inum_orbital = numerical_orbital[iele] + elif isinstance(numerical_orbital, dict): + if data["atom_names"][iele] not in numerical_orbital: + print( + f"ERROR: make_unlabeled_stru: numerical_orbital does not contain {data['atom_names'][iele]}" + ) + inum_orbital = None + else: + inum_orbital = numerical_orbital[data["atom_names"][iele]] + else: + inum_orbital = None + if inum_orbital is not None: + if not link_file: + out += inum_orbital + else: + out += os.path.basename(inum_orbital.rstrip("/")) + if dest_dir is not None: + _link_file(dest_dir, inum_orbital) + out += "\n" out += "\n" + # deepks block if numerical_descriptor is not None: assert isinstance(numerical_descriptor, str) - out += f"NUMERICAL_DESCRIPTOR\n{numerical_descriptor}\n" + if not link_file: + out += f"NUMERICAL_DESCRIPTOR\n{numerical_descriptor}\n" + else: + out += f"NUMERICAL_DESCRIPTOR\n{os.path.basename(numerical_descriptor)}\n" + if dest_dir is not None: + _link_file(dest_dir, numerical_descriptor) out += "\n" + # LATTICE_CONSTANT and LATTICE_VECTORS block out += "LATTICE_CONSTANT\n" out += str(1 / bohr2ang) + "\n\n" @@ -402,24 +766,80 @@ def make_unlabeled_stru( out += "\n" out += "\n" + # ATOMIC_POSITIONS block out += "ATOMIC_POSITIONS\n" out += "Cartesian # Cartesian(Unit is LATTICE_CONSTANT)\n" # ret += "\n" - natom_tot = 0 + natom_tot = 0 # in for loop, it is also the atom index for iele in range(len(data["atom_names"])): + if data["atom_numbs"][iele] == 0: + continue out += data["atom_names"][iele] + "\n" out += "0.0\n" out += str(data["atom_numbs"][iele]) + "\n" for iatom in range(data["atom_numbs"][iele]): iatomtype = np.nonzero(data["atom_types"] == iele)[0][iatom] - out += "%.12f %.12f %.12f %d %d %d\n" % ( - data["coords"][frame_idx][iatomtype, 0], - data["coords"][frame_idx][iatomtype, 1], - data["coords"][frame_idx][iatomtype, 2], - 1, - 1, - 1, - ) + iout = f"{data['coords'][frame_idx][iatomtype, 0]:.12f} {data['coords'][frame_idx][iatomtype, 1]:.12f} {data['coords'][frame_idx][iatomtype, 2]:.12f}" + # add flags for move, velocity, mag, angle1, angle2, and sc + if move is not None: + if ( + isinstance(ndarray2list(move[natom_tot]), (list, tuple)) + and len(move[natom_tot]) == 3 + ): + iout += " " + " ".join( + ["1" if ii else "0" for ii in move[natom_tot]] + ) + elif isinstance(ndarray2list(move[natom_tot]), (int, float, bool)): + iout += " 1 1 1" if move[natom_tot] else " 0 0 0" + else: + iout += " 1 1 1" + + if ( + velocity is not None + and isinstance(ndarray2list(velocity[natom_tot]), (list, tuple)) + and len(velocity[natom_tot]) == 3 + ): + iout += " v " + " ".join([f"{ii:.12f}" for ii in velocity[natom_tot]]) + + if mag is not None: + if isinstance(ndarray2list(mag[natom_tot]), (list, tuple)) and len( + mag[natom_tot] + ) in [1, 3]: + iout += " mag " + " ".join([f"{ii:.12f}" for ii in mag[natom_tot]]) + elif isinstance(ndarray2list(mag[natom_tot]), (int, float)): + iout += " mag " + f"{mag[natom_tot]:.12f}" + + if angle1 is not None and isinstance( + ndarray2list(angle1[natom_tot]), (int, float) + ): + iout += " angle1 " + f"{angle1[natom_tot]:.12f}" + + if angle2 is not None and isinstance( + ndarray2list(angle2[natom_tot]), (int, float) + ): + iout += " angle2 " + f"{angle2[natom_tot]:.12f}" + + if sc is not None: + if isinstance(ndarray2list(sc[natom_tot]), (list, tuple)) and len( + sc[natom_tot] + ) in [1, 3]: + iout += " sc " + " ".join( + ["1" if ii else "0" for ii in sc[natom_tot]] + ) + elif isinstance(ndarray2list(sc[natom_tot]), (int, float, bool)): + iout += " sc " + "1" if sc[natom_tot] else "0" + + if lambda_ is not None: + if isinstance(ndarray2list(lambda_[natom_tot]), (list, tuple)) and len( + lambda_[natom_tot] + ) in [1, 3]: + iout += " lambda " + " ".join( + [f"{ii:.12f}" for ii in lambda_[natom_tot]] + ) + elif isinstance(ndarray2list(lambda_[natom_tot]), (int, float)): + iout += " lambda " + f"{lambda_[natom_tot]:.12f}" + + out += iout + "\n" natom_tot += 1 assert natom_tot == sum(data["atom_numbs"]) return out diff --git a/dpdata/plugins/abacus.py b/dpdata/plugins/abacus.py index e3367b35..cbd1475f 100644 --- a/dpdata/plugins/abacus.py +++ b/dpdata/plugins/abacus.py @@ -1,10 +1,14 @@ from __future__ import annotations +import os from typing import TYPE_CHECKING +import numpy as np + import dpdata.abacus.md import dpdata.abacus.relax import dpdata.abacus.scf +from dpdata.data_type import Axis, DataType from dpdata.format import Format from dpdata.utils import open_file @@ -29,40 +33,49 @@ def to_system(self, data, file_name: FileType, frame_idx=0, **kwargs): The output file name frame_idx : int The index of the frame to dump - pp_file : list of string, optional - List of pseudo potential files - numerical_orbital : list of string, optional - List of orbital files - mass : list of float, optional - List of atomic masses - numerical_descriptor : str, optional - numerical descriptor file **kwargs : dict other parameters """ - pp_file = kwargs.get("pp_file") - numerical_orbital = kwargs.get("numerical_orbital") - mass = kwargs.get("mass") - numerical_descriptor = kwargs.get("numerical_descriptor") stru_string = dpdata.abacus.scf.make_unlabeled_stru( data=data, frame_idx=frame_idx, - pp_file=pp_file, - numerical_orbital=numerical_orbital, - numerical_descriptor=numerical_descriptor, - mass=mass, + dest_dir=os.path.dirname(file_name), + **kwargs, ) with open_file(file_name, "w") as fp: fp.write(stru_string) +def register_mag_data(data): + if "spins" in data: + dt = DataType( + "spins", + np.ndarray, + (Axis.NFRAMES, Axis.NATOMS, 3), + required=False, + deepmd_name="spin", + ) + dpdata.LabeledSystem.register_data_type(dt) + if "mag_forces" in data: + dt = DataType( + "mag_forces", + np.ndarray, + (Axis.NFRAMES, Axis.NATOMS, 3), + required=False, + deepmd_name="force_mag", + ) + dpdata.LabeledSystem.register_data_type(dt) + + @Format.register("abacus/scf") @Format.register("abacus/pw/scf") @Format.register("abacus/lcao/scf") class AbacusSCFFormat(Format): # @Format.post("rot_lower_triangular") def from_labeled_system(self, file_name, **kwargs): - return dpdata.abacus.scf.get_frame(file_name) + data = dpdata.abacus.scf.get_frame(file_name) + register_mag_data(data) + return data @Format.register("abacus/md") @@ -71,7 +84,9 @@ def from_labeled_system(self, file_name, **kwargs): class AbacusMDFormat(Format): # @Format.post("rot_lower_triangular") def from_labeled_system(self, file_name, **kwargs): - return dpdata.abacus.md.get_frame(file_name) + data = dpdata.abacus.md.get_frame(file_name) + register_mag_data(data) + return data @Format.register("abacus/relax") @@ -80,4 +95,6 @@ def from_labeled_system(self, file_name, **kwargs): class AbacusRelaxFormat(Format): # @Format.post("rot_lower_triangular") def from_labeled_system(self, file_name, **kwargs): - return dpdata.abacus.relax.get_frame(file_name) + data = dpdata.abacus.relax.get_frame(file_name) + register_mag_data(data) + return data diff --git a/tests/abacus.relax/INPUT.spin b/tests/abacus.relax/INPUT.spin new file mode 100644 index 00000000..cbdc3fdd --- /dev/null +++ b/tests/abacus.relax/INPUT.spin @@ -0,0 +1,35 @@ +INPUT_PARAMETERS +suffix spin +calculation relax +ecutwfc 100 +scf_thr 1.0e-3 +scf_nmax 200 +smearing_method gauss +smearing_sigma 0.01 +#ks_solver genelpa +basis_type pw +symmetry 0 +noncolin 1 +nspin 4 + +onsite_radius 3 + +relax_nmax 3 + +force_thr 0.00001 + +sc_mag_switch 1 +decay_grad_switch 1 +sc_thr 1e-4 +nsc 100 +nsc_min 2 +alpha_trial 0.01 +sccut 3 + + + +#md_nstep 3 +#md_type nve +#md_dt 1 +#md_tfirst 300 + diff --git a/tests/abacus.relax/STRU.spin b/tests/abacus.relax/STRU.spin new file mode 100644 index 00000000..441b30d1 --- /dev/null +++ b/tests/abacus.relax/STRU.spin @@ -0,0 +1,21 @@ +ATOMIC_SPECIES +Fe 55.845 Fe.upf + +NUMERICAL_ORBITAL +Fe_gga_8au_100Ry_4s2p2d1f.orb + +LATTICE_CONSTANT +1.880277359 +LATTICE_VECTORS + 2.8274254848 0.0000000000 0.0000000000 #latvec1 + 0.0000000000 2.8274254848 0.0000000000 #latvec2 + 0.0000000000 0.0000000000 2.8274254848 #latvec3 + +ATOMIC_POSITIONS +Direct + +Fe #label +1 #magnetism +2 #number of atoms + 0.0000000000 0.0000000000 0.0000000000 mag 1.25 1.25 1.25 sc 1 1 1 + 0.500000000 0.500000000 0.500000000 mag 1.25 1.25 1.25 sc 1 1 1 diff --git a/tests/abacus.scf/C.orb b/tests/abacus.scf/C.orb new file mode 100644 index 00000000..e69de29b diff --git a/tests/abacus.scf/C.upf b/tests/abacus.scf/C.upf new file mode 100644 index 00000000..e69de29b diff --git a/tests/abacus.scf/H.orb b/tests/abacus.scf/H.orb new file mode 100644 index 00000000..e69de29b diff --git a/tests/abacus.scf/H.upf b/tests/abacus.scf/H.upf new file mode 100644 index 00000000..e69de29b diff --git a/tests/abacus.scf/jle.orb b/tests/abacus.scf/jle.orb new file mode 100644 index 00000000..e69de29b diff --git a/tests/abacus.scf/stru.ref b/tests/abacus.scf/stru.ref new file mode 100644 index 00000000..8485de36 --- /dev/null +++ b/tests/abacus.scf/stru.ref @@ -0,0 +1,29 @@ +ATOMIC_SPECIES +C 12.000 C.upf +H 1.000 H.upf + +NUMERICAL_ORBITAL +C.orb +H.orb + +LATTICE_CONSTANT +1.8897261246257702 + +LATTICE_VECTORS +5.291772109029999 0.0 0.0 +0.0 5.291772109029999 0.0 +0.0 0.0 5.291772109029999 + +ATOMIC_POSITIONS +Cartesian # Cartesian(Unit is LATTICE_CONSTANT) +C +0.0 +1 +5.192682633809 4.557725978258 4.436846615358 1 1 1 mag 4.000000000000 angle2 100.000000000000 sc 1 lambda 0.100000000000 0.200000000000 0.300000000000 +H +0.0 +4 +5.416431453540 4.011298860305 3.511161492417 1 1 1 mag 1.000000000000 1.000000000000 1.000000000000 angle2 90.000000000000 sc 1 lambda 0.400000000000 0.500000000000 0.600000000000 +4.131588222365 4.706745191323 4.431136645083 1 1 1 mag 1.000000000000 angle1 100.000000000000 angle2 80.000000000000 sc 1 0 1 lambda 0.700000000000 0.800000000000 0.900000000000 +5.630930319126 5.521640894956 4.450356541303 0 0 0 mag 1.000000000000 angle1 90.000000000000 angle2 70.0000000000000 +5.499851012568 4.003388899277 5.342621842622 0 0 0 mag 1.000000000000 angle1 80.000000000000 sc 1 diff --git a/tests/abacus.spin/INPUT b/tests/abacus.spin/INPUT new file mode 100644 index 00000000..bc0b1df0 --- /dev/null +++ b/tests/abacus.spin/INPUT @@ -0,0 +1,27 @@ +INPUT_PARAMETERS +suffix ABACUS +calculation scf +ecutwfc 100 +scf_thr 1e-07 +scf_nmax 100 +out_chg 0 +smearing_method gauss +smearing_sigma 0.01 +mixing_type broyden +mixing_ndim 10 +ks_solver genelpa +basis_type lcao +symmetry 0 +noncolin 1 +lspinorb 0 +nspin 4 +out_mul true +sc_mag_switch 1 +decay_grad_switch 1 +sc_thr 1e-07 +sc_scf_thr 1e-09 +nsc 100 +nsc_min 2 +alpha_trial 0.01 +sccut 3 +cal_force 1 diff --git a/tests/abacus.spin/INPUT.md b/tests/abacus.spin/INPUT.md new file mode 100644 index 00000000..2be67861 --- /dev/null +++ b/tests/abacus.spin/INPUT.md @@ -0,0 +1,34 @@ +INPUT_PARAMETERS +calculation md +ecutwfc 100 +scf_thr 1.0e-3 +scf_nmax 200 +smearing_method gauss +smearing_sigma 0.01 +#ks_solver genelpa +basis_type pw +symmetry 0 +noncolin 1 +nspin 4 + +onsite_radius 3 + +relax_nmax 3 + +force_thr 0.00001 + +sc_mag_switch 1 +decay_grad_switch 1 +sc_thr 1e-4 +nsc 100 +nsc_min 2 +alpha_trial 0.01 +sccut 3 + + +md_type nvt +md_nstep 3 +md_dt 1 +md_tfirst 300 +md_tfreq 1 + diff --git a/tests/abacus.spin/INPUT.relax b/tests/abacus.spin/INPUT.relax new file mode 100644 index 00000000..9a9466d3 --- /dev/null +++ b/tests/abacus.spin/INPUT.relax @@ -0,0 +1,34 @@ +INPUT_PARAMETERS +calculation relax +ecutwfc 100 +scf_thr 1.0e-3 +scf_nmax 200 +smearing_method gauss +smearing_sigma 0.01 +#ks_solver genelpa +basis_type pw +symmetry 0 +noncolin 1 +nspin 4 + +onsite_radius 3 + +relax_nmax 3 + +force_thr 0.00001 + +sc_mag_switch 1 +decay_grad_switch 1 +sc_thr 1e-4 +nsc 100 +nsc_min 2 +alpha_trial 0.01 +sccut 3 + + + +#md_nstep 3 +#md_type nve +#md_dt 1 +#md_tfirst 300 + diff --git a/tests/abacus.spin/INPUT.scf b/tests/abacus.spin/INPUT.scf new file mode 100644 index 00000000..bc0b1df0 --- /dev/null +++ b/tests/abacus.spin/INPUT.scf @@ -0,0 +1,27 @@ +INPUT_PARAMETERS +suffix ABACUS +calculation scf +ecutwfc 100 +scf_thr 1e-07 +scf_nmax 100 +out_chg 0 +smearing_method gauss +smearing_sigma 0.01 +mixing_type broyden +mixing_ndim 10 +ks_solver genelpa +basis_type lcao +symmetry 0 +noncolin 1 +lspinorb 0 +nspin 4 +out_mul true +sc_mag_switch 1 +decay_grad_switch 1 +sc_thr 1e-07 +sc_scf_thr 1e-09 +nsc 100 +nsc_min 2 +alpha_trial 0.01 +sccut 3 +cal_force 1 diff --git a/tests/abacus.spin/OUT.ABACUS/MD_dump b/tests/abacus.spin/OUT.ABACUS/MD_dump new file mode 100644 index 00000000..a4d41a9b --- /dev/null +++ b/tests/abacus.spin/OUT.ABACUS/MD_dump @@ -0,0 +1,44 @@ +MDSTEP: 0 +LATTICE_CONSTANT: 0.994999532004 Angstrom +LATTICE_VECTORS + 2.827425484800 0.000000000000 0.000000000000 + 0.000000000000 2.827425484800 0.000000000000 + 0.000000000000 0.000000000000 2.827425484800 +INDEX LABEL POSITION (Angstrom) FORCE (eV/Angstrom) VELOCITY (Angstrom/fs) + 0 Fe 0.000000000000 0.000000000000 0.000000000000 -0.000023448027 0.000084873040 0.000395963967 0.001501148908 0.001168257569 -0.001755430621 + 1 Fe 1.406643426095 1.406643426095 1.406643426095 0.000023448027 -0.000084873040 -0.000395963967 -0.001501148908 -0.001168257569 0.001755430621 + + +MDSTEP: 1 +LATTICE_CONSTANT: 0.994999532004 Angstrom +LATTICE_VECTORS + 2.827425484800 0.000000000000 0.000000000000 + 0.000000000000 2.827425484800 0.000000000000 + 0.000000000000 0.000000000000 2.827425484800 +INDEX LABEL POSITION (Angstrom) FORCE (eV/Angstrom) VELOCITY (Angstrom/fs) + 0 Fe 0.001501146882 0.001168264901 2.811531455776 -0.082174998068 -0.064183237637 0.094555758230 0.001495732780 0.001164031434 -0.001749198271 + 1 Fe 1.405142279213 1.405475161194 1.408398822510 0.082174998068 0.064183237637 -0.094555758230 -0.001495732780 -0.001164031434 0.001749198271 + + +MDSTEP: 2 +LATTICE_CONSTANT: 0.994999532004 Angstrom +LATTICE_VECTORS + 2.827425484800 0.000000000000 0.000000000000 + 0.000000000000 2.827425484800 0.000000000000 + 0.000000000000 0.000000000000 2.827425484800 +INDEX LABEL POSITION (Angstrom) FORCE (eV/Angstrom) VELOCITY (Angstrom/fs) + 0 Fe 0.002994040541 0.002330066808 2.809785444314 -0.026325867140 -0.019829200318 0.032814119442 0.001497639352 0.001165552232 -0.001751386047 + 1 Fe 1.403649385554 1.404313359287 1.410144833972 0.026325867140 0.019829200318 -0.032814119442 -0.001497639352 -0.001165552232 0.001751386047 + + +MDSTEP: 3 +LATTICE_CONSTANT: 0.994999532004 Angstrom +LATTICE_VECTORS + 2.827425484800 0.000000000000 0.000000000000 + 0.000000000000 2.827425484800 0.000000000000 + 0.000000000000 0.000000000000 2.827425484800 +INDEX LABEL POSITION (Angstrom) FORCE (eV/Angstrom) VELOCITY (Angstrom/fs) + 0 Fe 0.004498128094 0.003500694358 2.808026692717 -0.044129139592 -0.028138926921 0.059726500602 0.001507997443 0.001174209539 -0.001762617927 + 1 Fe 1.402145298001 1.403142731738 1.411903585568 0.044129139592 0.028138926921 -0.059726500602 -0.001507997443 -0.001174209539 0.001762617927 + + diff --git a/tests/abacus.spin/OUT.ABACUS/running_md.log b/tests/abacus.spin/OUT.ABACUS/running_md.log new file mode 100644 index 00000000..272a44ce --- /dev/null +++ b/tests/abacus.spin/OUT.ABACUS/running_md.log @@ -0,0 +1,997 @@ + + ABACUS v3.7.1 + + Atomic-orbital Based Ab-initio Computation at UStc + + Website: http://abacus.ustc.edu.cn/ + Documentation: https://abacus.deepmodeling.com/ + Repository: https://github.com/abacusmodeling/abacus-develop + https://github.com/deepmodeling/abacus-develop + Commit: 8443c42b5 (Thu Sep 5 14:19:05 2024 +0800) + + Start Time is Fri Sep 6 10:04:51 2024 + + ------------------------------------------------------------------------------------ + + READING GENERAL INFORMATION + global_out_dir = OUT.ABACUS/ + global_in_card = INPUT + pseudo_dir = ./ + orbital_dir = ./ + DRANK = 1 + DSIZE = 1 + DCOLOR = 1 + GRANK = 1 + GSIZE = 1 + + + + + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + | | + | Reading atom information in unitcell: | + | From the input file and the structure file we know the number of | + | different elments in this unitcell, then we list the detail | + | information for each element, especially the zeta and polar atomic | + | orbital number for each element. The total atom number is counted. | + | We calculate the nearest atom distance for each atom and show the | + | Cartesian and Direct coordinates for each atom. We list the file | + | address for atomic orbitals. The volume and the lattice vectors | + | in real and reciprocal space is also shown. | + | | + <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + + + + READING UNITCELL INFORMATION + ntype = 1 + lattice constant (Bohr) = 1.88028 + lattice constant (Angstrom) = 0.995 + + READING ATOM TYPE 1 + atom label = Fe + L=0, number of zeta = 4 + L=1, number of zeta = 2 + L=2, number of zeta = 2 + L=3, number of zeta = 1 + number of atom for this type = 2 + magnetization of element 1 = [ 1.25, 1.25, 1.25 ] + + TOTAL ATOM NUMBER = 2 +DIRECT COORDINATES + atom x y z mag vx vy vz +taud_Fe1 0.0000000000 0.0000000000 0.0000000000 2.1651 0.0000000000 0.0000000000 0.0000000000 +taud_Fe2 0.5000000000 0.5000000000 0.5000000000 2.1651 0.0000000000 0.0000000000 0.0000000000 + + + + Volume (Bohr^3) = 150.259 + Volume (A^3) = 22.266 + + Lattice vectors: (Cartesian coordinate: in unit of a_0) + +2.82743 +0 +0 + +0 +2.82743 +0 + +0 +0 +2.82743 + Reciprocal vectors: (Cartesian coordinate: in unit of 2 pi/a_0) + +0.353679 -0 +0 + -0 +0.353679 -0 + +0 -0 +0.353679 + The esolver type has been set to : ksdft_pw + + RUNNING WITH DEVICE : CPU / Intel(R) Xeon(R) Platinum + + + + + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + | | + | Reading pseudopotentials files: | + | The pseudopotential file is in UPF format. The 'NC' indicates that | + | the type of pseudopotential is 'norm conserving'. Functional of | + | exchange and correlation is decided by 4 given parameters in UPF | + | file. We also read in the 'core correction' if there exists. | + | Also we can read the valence electrons number and the maximal | + | angular momentum used in this pseudopotential. We also read in the | + | trail wave function, trail atomic density and local-pseudopotential| + | on logrithmic grid. The non-local pseudopotential projector is also| + | read in if there is any. | + | | + <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + + + + PAO radial cut off (Bohr) = 15 + + Read in pseudopotential file is Fe.upf + pseudopotential type = NC + exchange-correlation functional = PBE + nonlocal core correction = 1 + valence electrons = 16 + lmax = 2 + number of zeta = 4 + number of projectors = 6 + L of projector = 0 + L of projector = 0 + L of projector = 1 + L of projector = 1 + L of projector = 2 + L of projector = 2 + initial pseudo atomic orbital number = 40 + NLOCAL = 108 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Warning: the number of valence electrons in pseudopotential > 8 for Fe: [Ar] 3d6 4s2 + Pseudopotentials with additional electrons can yield (more) accurate outcomes, but may be less efficient. + If you're confident that your chosen pseudopotential is appropriate, you can safely ignore this warning. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + + + + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + | | + | Setup plane waves of charge/potential: | + | Use the energy cutoff and the lattice vectors to generate the | + | dimensions of FFT grid. The number of FFT grid on each processor | + | is 'nrxx'. The number of plane wave basis in reciprocal space is | + | different for charege/potential and wave functions. We also set | + | the 'sticks' for the parallel of FFT. The number of plane waves | + | is 'npw' in each processor. | + <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + + + + + SETUP THE PLANE WAVE BASIS + energy cutoff for charge/potential (unit:Ry) = 400 + fft grid for charge/potential = [ 36, 36, 36 ] + fft grid division = [ 1, 1, 1 ] + big fft grid for charge/potential = [ 36, 36, 36 ] + nbxx = 46656 + nrxx = 46656 + + SETUP PLANE WAVES FOR CHARGE/POTENTIAL + number of plane waves = 20341 + number of sticks = 885 + + PARALLEL PW FOR CHARGE/POTENTIAL + PROC COLUMNS(POT) PW + 1 885 20341 + --------------- sum ------------------- + 1 885 20341 + number of |g| = 241 + max |g| = 35.7753 + min |g| = 0 + +----------- Double Check Mixing Parameters Begin ------------ +mixing_type: broyden +mixing_beta: 0.4 +mixing_gg0: 1 +mixing_gg0_min: 0.1 +mixing_beta_mag: 1.6 +mixing_gg0_mag: 0 +mixing_ndim: 8 +----------- Double Check Mixing Parameters End ------------ + + SETUP THE ELECTRONS NUMBER + electron number of element Fe = 16 + total electron number of element Fe = 32 + AUTOSET number of electrons: = 32 + DONE : SETUP UNITCELL Time : 0.102785 (SEC) + + + + + + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + | | + | Setup K-points | + | We setup the k-points according to input parameters. | + | The reduced k-points are set according to symmetry operations. | + | We treat the spin as another set of k-points. | + | | + <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + + + + + SETUP K-POINTS + nspin = 4 + Input type of k points = Monkhorst-Pack(Gamma) + nkstot = 1 + nkstot_ibz = 1 +K-POINTS REDUCTION ACCORDING TO SYMMETRY + IBZ DIRECT_X DIRECT_Y DIRECT_Z WEIGHT ibz2bz + 1 0.00000000 0.00000000 0.00000000 1.0000 0 + + nkstot now = 1 +K-POINTS DIRECT COORDINATES + KPOINTS DIRECT_X DIRECT_Y DIRECT_Z WEIGHT + 1 0.00000000 0.00000000 0.00000000 1.0000 + + + k-point number in this process = 1 + minimum distributed K point number = 1 + +K-POINTS CARTESIAN COORDINATES + KPOINTS CARTESIAN_X CARTESIAN_Y CARTESIAN_Z WEIGHT + 1 0.00000000 0.00000000 0.00000000 1.0000 + + +K-POINTS DIRECT COORDINATES + KPOINTS DIRECT_X DIRECT_Y DIRECT_Z WEIGHT + 1 0.00000000 0.00000000 0.00000000 1.0000 + + DONE : INIT K-POINTS Time : 0.112353 (SEC) + + + + + + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + | | + | Setup plane waves of wave functions: | + | Use the energy cutoff and the lattice vectors to generate the | + | dimensions of FFT grid. The number of FFT grid on each processor | + | is 'nrxx'. The number of plane wave basis in reciprocal space is | + | different for charege/potential and wave functions. We also set | + | the 'sticks' for the parallel of FFT. The number of plane wave of | + | each k-point is 'npwk[ik]' in each processor | + <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + + + + + SETUP PLANE WAVES FOR WAVE FUNCTIONS + energy cutoff for wavefunc (unit:Ry) = 100 + fft grid for wave functions = [ 36, 36, 36 ] + number of plane waves = 2517 + number of sticks = 221 + + PARALLEL PW FOR WAVE FUNCTIONS + PROC COLUMNS(POT) PW + 1 221 2517 + --------------- sum ------------------- + 1 221 2517 + DONE : INIT PLANEWAVE Time : 0.113487 (SEC) + + occupied bands = 16 + NBANDS = 52 + + SETUP NONLOCAL PSEUDOPOTENTIALS IN PLANE WAVE BASIS + Fe non-local projectors: + projector 1 L=0 + projector 2 L=0 + projector 3 L=1 + projector 4 L=1 + projector 5 L=2 + projector 6 L=2 + TOTAL NUMBER OF NONLOCAL PROJECTORS = 36 + DONE : LOCAL POTENTIAL Time : 0.128854 (SEC) + + + Init Non-Local PseudoPotential table : + Init Non-Local-Pseudopotential done. + DONE : NON-LOCAL POTENTIAL Time : 0.15862 (SEC) + + npwx = 2517 + + Make real space PAO into reciprocal space. + max mesh points in Pseudopotential = 1425 + dq(describe PAO in reciprocal space) = 0.01 + max q = 1204 + + number of pseudo atomic orbitals for Fe is 4 +WARNING: norm of atomic wavefunction # 2 of atomic type Fe is 0.999981, renormalized +WARNING: norm of atomic wavefunction # 3 of atomic type Fe is 0.999997, renormalized + DONE : INIT BASIS Time : 0.330341 (SEC) + + + ------------------------------------------- + STEP OF MOLECULAR DYNAMICS : 0 + ------------------------------------------- + init_chg = atomic + DONE : INIT SCF Time : 0.528545 (SEC) + + + PW ALGORITHM --------------- ION= 1 ELEC= 1-------------------------------- +total magnetism (Bohr mag/cell) 2.30943 2.30938 2.30941 + absolute magnetism (Bohr mag/cell) = 4.01976 + Notice: Threshold on eigenvalues was too large. + hsover_error=0.32 > DRHO=0.0686869 + Origin diag_ethr = 0.01 + New diag_ethr = 0.000214646 +total magnetism (Bohr mag/cell) 2.30943 2.30937 2.3094 + absolute magnetism (Bohr mag/cell) = 4.01964 + + Density error is 0.0548949686243 + Error Threshold = 0.000214646406708 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6632803550 -6825.4790901992 + E_Harris -501.6647758269 -6825.4994371390 + E_Fermi 1.4575316668 19.8307356840 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 1 ELEC= 2-------------------------------- +total magnetism (Bohr mag/cell) 2.3094424965 2.30934448798 2.30941621651 + absolute magnetism (Bohr mag/cell) = 4.13707180938 + + Density error is 0.00986449919003 + Error Threshold = 0.000171546776951 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6774595966 -6825.6720086784 + E_Harris -499.7039503033 -6798.8210372331 + E_Fermi 1.4964230898 20.3598806394 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 1 ELEC= 3-------------------------------- +total magnetism (Bohr mag/cell) 2.30944490813 2.30935345105 2.30940487564 + absolute magnetism (Bohr mag/cell) = 4.08853707061 + + Density error is 0.00240445773415 + Error Threshold = 3.08265599688e-05 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6784060189 -6825.6848854146 + E_Harris -501.4802459250 -6822.9887790210 + E_Fermi 1.4994551309 20.4011336751 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 1 ELEC= 4-------------------------------- +total magnetism (Bohr mag/cell) 2.30944724752 2.30935862214 2.30939736766 + absolute magnetism (Bohr mag/cell) = 4.08848804651 + + Density error is 0.00057214611471 + Error Threshold = 7.51393041921e-06 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6784787714 -6825.6858752634 + E_KS(sigma->0) -501.6746222162 -6825.6334041381 + E_Harris -501.6738375513 -6825.6227282240 + E_band -27.9117558414 -379.7589206280 + E_one_elec -203.4207485774 -2767.6812720784 + E_Hartree 123.6718684724 1682.6420935310 + E_xc -71.4390193374 -971.9777225215 + E_Ewald -350.4828662186 -4768.5640319440 + E_entropy(-TS) -0.0077131104 -0.1049422506 + E_descf 0.0000000000 0.0000000000 + E_exx 0.0000000000 0.0000000000 + E_Fermi 1.5017611709 20.4325089589 +---------------------------------------------------------- + +------------------------------------------------------------------------------------------- + Magnetic force (eV/uB) +------------------------------------------------------------------------------------------- + Fe 0.0000000000 0.0000000000 0.0000000000 + Fe 0.0000000000 0.0000000000 0.0000000000 +------------------------------------------------------------------------------------------- + + +------------------------------------------------------------------------------------------- +Orbital Charge Analysis Charge Mag(x) Mag(y) Mag(z) +------------------------------------------------------------------------------------------- +Fe1 + s 1.1149 0.0010 0.0010 0.0010 + p 5.9971 0.0002 0.0002 0.0002 + d 6.5931 1.1679 1.1678 1.1678 + Sum 13.7051 1.1691 1.1690 1.1690 +Fe2 + s 1.1150 0.0010 0.0010 0.0010 + p 5.9971 0.0002 0.0002 0.0002 + d 6.5959 1.1671 1.1671 1.1672 + Sum 13.7079 1.1683 1.1683 1.1684 +------------------------------------------------------------------------------------------- + +------------------------------------------------------------------------------------------- + Total Magnetism (uB) +------------------------------------------------------------------------------------------- + Fe 1.1690981855 1.1689596529 1.1689548475 + Fe 1.1682782547 1.1683271615 1.1683689897 +------------------------------------------------------------------------------------------- + + + charge density convergence is achieved + final etot is -6825.6858753 eV + + +------------------------------------------------------------------------------------------ + TOTAL-FORCE (eV/Angstrom) +------------------------------------------------------------------------------------------ + Fe1 -0.0000234480 0.0000848730 0.0003959639 + Fe2 0.0000234480 -0.0000848730 -0.0003959639 +------------------------------------------------------------------------------------------ + + + + ------------------------------------------------------------------------------------------------ + Energy (Ry) Potential (Ry) Kinetic (Ry) Temperature (K) + -501.67563 -501.67848 0.0028501339 300 + ------------------------------------------------------------------------------------------------ + + + + ------------------------------------------- + STEP OF MOLECULAR DYNAMICS : 1 + ------------------------------------------- + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + NEW-OLD atomic charge density approx. for the potential ! + DONE : INIT SCF Time : 4.69025 (SEC) + + + PW ALGORITHM --------------- ION=2 ELEC=1 -------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0 ; where current threshold is: 7.51393e-06 . +total magnetism (Bohr mag/cell) 2.46069 2.4606 2.46063 + absolute magnetism (Bohr mag/cell) = 4.35476 + Notice: Threshold on eigenvalues was too large. + hsover_error=0.32 > DRHO=0.00192412 + Origin diag_ethr = 0.01 + New diag_ethr = 6.01286e-06 +total magnetism (Bohr mag/cell) 2.46066 2.46058 2.46061 + absolute magnetism (Bohr mag/cell) = 4.36174 + + Density error is 0.00201217065486 + Error Threshold = 6.01286073232e-06 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6717206991 -6825.5939269727 + E_Harris -501.6715817664 -6825.5920366956 + E_Fermi 1.4766917900 20.0914225341 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 2 ELEC= 2-------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0 ; where current threshold is: 6.01286073232e-06 . +total magnetism (Bohr mag/cell) 2.45367664792 2.45369451898 2.45369632661 + absolute magnetism (Bohr mag/cell) = 4.36076913778 + + Density error is 0.00924150911613 + Error Threshold = 6.28803329643e-06 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6713570140 -6825.5889787830 + E_Harris -501.5122751175 -6823.4245585418 + E_Fermi 1.4801602125 20.1386128426 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 2 ELEC= 3-------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0 ; where current threshold is: 6.28803329643e-06 . +total magnetism (Bohr mag/cell) 2.45535480016 2.45535779838 2.45535744914 + absolute magnetism (Bohr mag/cell) = 4.36222821556 + + Density error is 0.00222730537898 + Error Threshold = 6.28803329643e-06 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6723462878 -6825.6024385430 + E_Harris -501.6357961303 -6825.1051481383 + E_Fermi 1.4800078639 20.1365400332 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 2 ELEC= 4-------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0 ; where current threshold is: 6.28803329643e-06 . +total magnetism (Bohr mag/cell) 2.4557794855 2.45578128279 2.45578053957 + absolute magnetism (Bohr mag/cell) = 4.36171007414 + + Density error is 6.47878398594e-06 + Error Threshold = 6.28803329643e-06 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6724876966 -6825.6043625085 + E_KS(sigma->0) -501.6678952474 -6825.5418790320 + E_Harris -501.6633376598 -6825.4798698707 + E_band -27.8834155884 -379.3733317038 + E_one_elec -203.5744480246 -2769.7724603392 + E_Hartree 123.7840339882 1684.1681836654 + E_xc -71.4833250872 -972.5805331721 + E_Ewald -350.4821832426 -4768.5547395789 + E_entropy(-TS) -0.0091848983 -0.1249669530 + E_descf 0.0000000000 0.0000000000 + E_exx 0.0000000000 0.0000000000 + E_Fermi 1.4799614353 20.1359083399 +---------------------------------------------------------- + +------------------------------------------------------------------------------------------- + Magnetic force (eV/uB) +------------------------------------------------------------------------------------------- + Fe -0.1674727502 -0.1674714507 -0.1674677599 + Fe -0.1685388103 -0.1685393463 -0.1685411873 +------------------------------------------------------------------------------------------- + + +------------------------------------------------------------------------------------------- +Orbital Charge Analysis Charge Mag(x) Mag(y) Mag(z) +------------------------------------------------------------------------------------------- +Fe1 + s 1.1147 0.0019 0.0019 0.0019 + p 5.9971 0.0002 0.0002 0.0002 + d 6.5877 1.2479 1.2479 1.2479 + Sum 13.6994 1.2500 1.2501 1.2501 +Fe2 + s 1.1148 0.0019 0.0019 0.0019 + p 5.9971 0.0002 0.0002 0.0002 + d 6.5911 1.2480 1.2480 1.2480 + Sum 13.7030 1.2502 1.2502 1.2502 +------------------------------------------------------------------------------------------- + +------------------------------------------------------------------------------------------- + Total Magnetism (uB) +------------------------------------------------------------------------------------------- + Fe 1.2500362016 1.2500750113 1.2500654974 + Fe 1.2501907811 1.2501525281 1.2501618807 +------------------------------------------------------------------------------------------- + + + charge density convergence is achieved + final etot is -6825.6043625 eV + + +------------------------------------------------------------------------------------------ + TOTAL-FORCE (eV/Angstrom) +------------------------------------------------------------------------------------------ + Fe1 -0.0821749928 -0.0641832335 0.0945557521 + Fe2 0.0821749928 0.0641832335 -0.0945557521 +------------------------------------------------------------------------------------------ + + + + ------------------------------------------------------------------------------------------------ + Energy (Ry) Potential (Ry) Kinetic (Ry) Temperature (K) + -501.66966 -501.67249 0.0028297442 297.85381 + ------------------------------------------------------------------------------------------------ + + + + ------------------------------------------- + STEP OF MOLECULAR DYNAMICS : 2 + ------------------------------------------- + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + first order charge density extrapolation ! + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + DONE : INIT SCF Time : 20.3341 (SEC) + + + PW ALGORITHM --------------- ION=3 ELEC=1 -------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0 ; where current threshold is: 6.28803e-06 . +total magnetism (Bohr mag/cell) 2.45486 2.45489 2.45489 + absolute magnetism (Bohr mag/cell) = 4.36543 + Notice: Threshold on eigenvalues was too large. + hsover_error=0.32 > DRHO=0.00210159 + Origin diag_ethr = 0.01 + New diag_ethr = 6.56747e-06 +total magnetism (Bohr mag/cell) 2.45485 2.45488 2.45488 + absolute magnetism (Bohr mag/cell) = 4.36511 + + Density error is 0.00210610440114 + Error Threshold = 6.56747174472e-06 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6717145278 -6825.5938430078 + E_Harris -501.6715861090 -6825.5920957801 + E_Fermi 1.4832199190 20.1802422850 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 3 ELEC= 2-------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0 ; where current threshold is: 6.56747174472e-06 . +total magnetism (Bohr mag/cell) 2.45728332606 2.45728465763 2.45728362282 + absolute magnetism (Bohr mag/cell) = 4.36144612893 + + Density error is 0.0100994423697 + Error Threshold = 6.58157625357e-06 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6712030534 -6825.5868840416 + E_Harris -501.8309806843 -6827.7607702341 + E_Fermi 1.4801826654 20.1389183308 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 3 ELEC= 3-------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0 ; where current threshold is: 6.58157625357e-06 . +total magnetism (Bohr mag/cell) 2.45602003892 2.45602235568 2.45602305001 + absolute magnetism (Bohr mag/cell) = 4.36008011062 + + Density error is 0.0022259696948 + Error Threshold = 6.58157625357e-06 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6723719367 -6825.6027875138 + E_Harris -501.7036416542 -6826.0282338473 + E_Fermi 1.4800402952 20.1369812842 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 3 ELEC= 4-------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0 ; where current threshold is: 6.58157625357e-06 . +total magnetism (Bohr mag/cell) 2.45568827013 2.45568820365 2.45568816609 + absolute magnetism (Bohr mag/cell) = 4.36059357058 + + Density error is 0.000113741995613 + Error Threshold = 6.58157625357e-06 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6725298576 -6825.6049361390 + E_KS(sigma->0) -501.6679841586 -6825.5430887303 + E_Harris -501.6890083521 -6825.8291375583 + E_band -27.8841363403 -379.3831380370 + E_one_elec -203.5689978550 -2769.6983069772 + E_Hartree 123.7762138387 1684.0617850727 + E_xc -71.4816492900 -972.5577327814 + E_Ewald -350.4801490952 -4768.5270635846 + E_entropy(-TS) -0.0090913981 -0.1236948175 + E_descf 0.0000000000 0.0000000000 + E_exx 0.0000000000 0.0000000000 + E_Fermi 1.4800346303 20.1369042091 +---------------------------------------------------------- + +------------------------------------------------------------------------------------------- + Magnetic force (eV/uB) +------------------------------------------------------------------------------------------- + Fe -0.1652181739 -0.1652325578 -0.1652321249 + Fe -0.1654941827 -0.1654786653 -0.1654791319 +------------------------------------------------------------------------------------------- + + +------------------------------------------------------------------------------------------- +Orbital Charge Analysis Charge Mag(x) Mag(y) Mag(z) +------------------------------------------------------------------------------------------- +Fe1 + s 1.1147 0.0019 0.0019 0.0019 + p 5.9971 0.0002 0.0002 0.0002 + d 6.5895 1.2477 1.2476 1.2476 + Sum 13.7013 1.2499 1.2498 1.2498 +Fe2 + s 1.1147 0.0019 0.0019 0.0019 + p 5.9971 0.0002 0.0002 0.0002 + d 6.5893 1.2478 1.2479 1.2479 + Sum 13.7011 1.2500 1.2500 1.2500 +------------------------------------------------------------------------------------------- + +------------------------------------------------------------------------------------------- + Total Magnetism (uB) +------------------------------------------------------------------------------------------- + Fe 1.2498513779 1.2497690096 1.2497695030 + Fe 1.2499638767 1.2500461778 1.2500456124 +------------------------------------------------------------------------------------------- + + + charge density convergence is achieved + final etot is -6825.6049361 eV + + +------------------------------------------------------------------------------------------ + TOTAL-FORCE (eV/Angstrom) +------------------------------------------------------------------------------------------ + Fe1 -0.0263258654 -0.0198291990 0.0328141173 + Fe2 0.0263258654 0.0198291990 -0.0328141173 +------------------------------------------------------------------------------------------ + + + + ------------------------------------------------------------------------------------------------ + Energy (Ry) Potential (Ry) Kinetic (Ry) Temperature (K) + -501.66969 -501.67253 0.0028369371 298.61093 + ------------------------------------------------------------------------------------------------ + + + + ------------------------------------------- + STEP OF MOLECULAR DYNAMICS : 3 + ------------------------------------------- + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + second order charge density extrapolation ! + alpha = -0.46539717 + beta = 1.4648176 + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + Find the file, try to read charge from file. + read in fermi energy = 0 + DONE : INIT SCF Time : 41.017 (SEC) + + + PW ALGORITHM --------------- ION=4 ELEC=1 -------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0 ; where current threshold is: 6.58158e-06 . +total magnetism (Bohr mag/cell) 2.45395 2.45395 2.45395 + absolute magnetism (Bohr mag/cell) = 4.36621 + Notice: Threshold on eigenvalues was too large. + hsover_error=0.32 > DRHO=0.00327757 + Origin diag_ethr = 0.01 + New diag_ethr = 1.02424e-05 +total magnetism (Bohr mag/cell) 2.45393 2.45393 2.45393 + absolute magnetism (Bohr mag/cell) = 4.36585 + + Density error is 0.00328180767194 + Error Threshold = 1.02424082459e-05 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6714819577 -6825.5906787296 + E_Harris -501.6704871756 -6825.5771440242 + E_Fermi 1.4848945022 20.2030261586 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 4 ELEC= 2-------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0 ; where current threshold is: 1.02424082459e-05 . +total magnetism (Bohr mag/cell) 2.45834495411 2.45824446616 2.45825644792 + absolute magnetism (Bohr mag/cell) = 4.36143824469 + + Density error is 0.00407139541475 + Error Threshold = 1.02556489748e-05 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6718059210 -6825.5950864757 + E_Harris -501.8968017467 -6828.6563117308 + E_Fermi 1.4803720649 20.1414952427 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 4 ELEC= 3-------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0 ; where current threshold is: 1.02556489748e-05 . +total magnetism (Bohr mag/cell) 2.4561430127 2.4561402075 2.45614046704 + absolute magnetism (Bohr mag/cell) = 4.36006713268 + + Density error is 0.00621121698173 + Error Threshold = 1.02556489748e-05 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6723961915 -6825.6031175180 + E_Harris -501.7084280186 -6826.0933556758 + E_Fermi 1.4808558000 20.1480767961 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 4 ELEC= 4-------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0 ; where current threshold is: 1.02556489748e-05 . +total magnetism (Bohr mag/cell) 2.45642597595 2.45642438896 2.45642568116 + absolute magnetism (Bohr mag/cell) = 4.36090201409 + + Density error is 0.000907798588431 + Error Threshold = 1.02556489748e-05 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6725094449 -6825.6046584088 + E_KS(sigma->0) -501.6682437690 -6825.5466209109 + E_Harris -501.6882798535 -6825.8192258261 + E_band -27.8806642947 -379.3358984328 + E_one_elec -203.5720364691 -2769.7396494442 + E_Hartree 123.7795681857 1684.1074233046 + E_xc -71.4830945963 -972.5773971831 + E_Ewald -350.4767334207 -4768.4805909482 + E_entropy(-TS) -0.0085313518 -0.1160749959 + E_descf 0.0000000000 0.0000000000 + E_exx 0.0000000000 0.0000000000 + E_Fermi 1.4811684035 20.1523299848 +---------------------------------------------------------- + +------------------------------------------------------------------------------------------- + Magnetic force (eV/uB) +------------------------------------------------------------------------------------------- + Fe -0.1614117188 -0.1614064417 -0.1614126965 + Fe -0.1590151938 -0.1590593187 -0.1590482375 +------------------------------------------------------------------------------------------- + + +------------------------------------------------------------------------------------------- +Orbital Charge Analysis Charge Mag(x) Mag(y) Mag(z) +------------------------------------------------------------------------------------------- +Fe1 + s 1.1148 0.0020 0.0020 0.0020 + p 5.9971 0.0002 0.0002 0.0002 + d 6.5942 1.2476 1.2477 1.2477 + Sum 13.7061 1.2498 1.2499 1.2499 +Fe2 + s 1.1146 0.0018 0.0018 0.0018 + p 5.9971 0.0002 0.0002 0.0002 + d 6.5847 1.2480 1.2480 1.2480 + Sum 13.6964 1.2501 1.2500 1.2500 +------------------------------------------------------------------------------------------- + +------------------------------------------------------------------------------------------- + Total Magnetism (uB) +------------------------------------------------------------------------------------------- + Fe 1.2498251342 1.2498544518 1.2498533551 + Fe 1.2500507306 1.2500181434 1.2500206507 +------------------------------------------------------------------------------------------- + + + charge density convergence is achieved + final etot is -6825.6046584 eV + + +------------------------------------------------------------------------------------------ + TOTAL-FORCE (eV/Angstrom) +------------------------------------------------------------------------------------------ + Fe1 -0.0441291367 -0.0281389251 0.0597264967 + Fe2 0.0441291367 0.0281389251 -0.0597264967 +------------------------------------------------------------------------------------------ + + + + ------------------------------------------------------------------------------------------------ + Energy (Ry) Potential (Ry) Kinetic (Ry) Temperature (K) + -501.66963 -501.67251 0.0028755884 302.67929 + ------------------------------------------------------------------------------------------------ + + + + + -------------------------------------------- + !FINAL_ETOT_IS -6825.60465840883 eV + -------------------------------------------- + + +TIME STATISTICS +----------------------------------------------------------------------------- + CLASS_NAME NAME TIME/s CALLS AVG/s PER/% +----------------------------------------------------------------------------- + total 59.14 21 2.82 100.00 + Driver reading 0.03 1 0.03 0.05 + Input_Conv Convert 0.00 1 0.00 0.00 + Driver driver_line 59.11 1 59.11 99.95 + UnitCell check_tau 0.00 1 0.00 0.00 + PW_Basis_Sup setuptransform 0.00 1 0.00 0.01 + PW_Basis_Sup distributeg 0.00 1 0.00 0.00 + mymath heapsort 0.00 7 0.00 0.00 + PW_Basis_K setuptransform 0.00 1 0.00 0.00 + PW_Basis_K distributeg 0.00 1 0.00 0.00 + PW_Basis setup_struc_factor 0.01 4 0.00 0.01 + ppcell_vnl init 0.00 1 0.00 0.00 + ppcell_vl init_vloc 0.01 1 0.01 0.01 + ppcell_vnl init_vnl 0.03 1 0.03 0.05 + WF_atomic init_at_1 0.17 1 0.17 0.29 + wavefunc wfcinit 0.00 1 0.00 0.00 + Run_MD md_line 58.80 1 58.80 99.43 + Nose_Hoover setup 4.18 1 4.18 7.06 + MD_func force_virial 58.73 4 14.68 99.31 + ESolver_KS_PW runner 58.35 4 14.59 98.66 + H_Ewald_pw compute_ewald 0.00 4 0.00 0.01 + Charge set_rho_core 0.03 4 0.01 0.05 + PW_Basis_Sup recip2real 0.35 492 0.00 0.60 + PW_Basis_Sup gathers_scatterp 0.06 492 0.00 0.10 + Charge atomic_rho 0.09 8 0.01 0.15 + Potential init_pot 0.28 4 0.07 0.47 + Potential update_from_charge 1.36 20 0.07 2.29 + Potential cal_fixed_v 0.00 4 0.00 0.01 + PotLocal cal_fixed_v 0.00 4 0.00 0.00 + Potential cal_v_eff 1.34 20 0.07 2.27 + H_Hartree_pw v_hartree 0.04 20 0.00 0.06 + PW_Basis_Sup real2recip 0.33 648 0.00 0.56 + PW_Basis_Sup gatherp_scatters 0.03 648 0.00 0.05 + PotXC cal_v_eff 1.30 20 0.06 2.20 + XC_Functional v_xc 1.55 24 0.06 2.63 + Potential interpolate_vrs 0.01 20 0.00 0.01 + OnsiteProj cubspl_tabulate 0.09 1 0.09 0.16 + Charge_Mixing init_mixing 0.00 4 0.00 0.01 + ESolver_KS_PW hamilt2density 10.19 20 0.51 17.24 + HSolverPW solve 16.62 32 0.52 28.10 + pp_cell_vnl getvnl 0.86 330 0.00 1.46 + Structure_Factor get_sk 0.10 340 0.00 0.16 + OnsiteProj getvnl 0.00 330 0.00 0.00 + OnsiteProj tabulate_atomic 0.00 366 0.00 0.00 + WF_atomic atomic_wfc 0.01 1 0.01 0.01 + DiagoIterAssist diagH_subspace_init 0.13 1 0.13 0.23 + Operator hPsi 48.88 4254 0.01 82.65 + Operator EkineticPW 0.25 4254 0.00 0.41 + Operator VeffPW 43.72 4254 0.01 73.93 + PW_Basis_K recip2real 12.72 43840 0.00 21.51 + PW_Basis_K gathers_scatterp 1.93 43840 0.00 3.26 + PW_Basis_K real2recip 11.60 41760 0.00 19.62 + PW_Basis_K gatherp_scatters 0.85 41760 0.00 1.44 + Operator NonlocalPW 3.23 4254 0.00 5.46 + Nonlocal add_nonlocal_pp 1.98 4254 0.00 3.35 + Operator OnsiteProjPW 1.67 4254 0.00 2.82 + OnsiteProj overlap 0.82 4290 0.00 1.39 + FS_Nonlocal_tools cal_becp 0.83 4298 0.00 1.40 + OnsiteProj add_onsite_proj 0.70 4254 0.00 1.19 + DiagoIterAssist diagH_LAPACK 0.36 326 0.00 0.61 + DiagoCG diag_once 12.02 32 0.38 20.33 + DiagoCG_New spsi_func 0.11 7856 0.00 0.19 + DiagoCG_New hpsi_func 10.47 3928 0.00 17.70 + ElecStatePW psiToRho 0.90 20 0.05 1.52 + Charge_Mixing get_drho 0.10 20 0.00 0.17 + Charge_Mixing inner_product_recip_rho 0.00 20 0.00 0.01 + Charge mix_rho 0.14 12 0.01 0.24 + Charge Broyden_mixing 0.02 12 0.00 0.03 + DiagoIterAssist diagH_subspace 3.39 27 0.13 5.73 + Charge_Mixing inner_product_recip_hartree 0.01 24 0.00 0.01 + OnsiteProj cal_occupation 0.01 4 0.00 0.01 + Forces cal_force_loc 0.01 4 0.00 0.01 + Forces cal_force_ew 0.01 4 0.00 0.01 + Forces cal_force_nl 0.03 4 0.01 0.06 + FS_Nonlocal_tools cal_dbecp_f 0.04 24 0.00 0.06 + Forces cal_force_onsite 0.02 4 0.00 0.03 + Forces cal_force_cc 0.29 4 0.07 0.49 + Forces cal_force_scc 0.03 4 0.01 0.05 + Nose_Hoover first_half 0.00 3 0.00 0.00 + SpinConstrain cal_mw_from_lambda 44.69 310 0.14 75.57 + DiagoIterAssist diag_responce 37.41 298 0.13 63.25 + Nose_Hoover second_half 0.00 3 0.00 0.00 + ModuleIO write_istate_info 0.01 1 0.01 0.01 +----------------------------------------------------------------------------- + + + NAME-------------------------|MEMORY(MB)-------- +total 24.43 +Psi_PW 3.994 +DiagSub::temp 3.994 +FFT::grid 1.424 +Chg::rho 1.424 +Chg::rho_save 1.424 +Pot::veff 1.424 +Pot::veff_smooth 1.424 +VNL::vkb 1.383 + ------------- < 1.0 MB has been ignored ---------------- + ---------------------------------------------------------- + + Start Time : Fri Sep 6 10:04:51 2024 + Finish Time : Fri Sep 6 10:05:51 2024 + Total Time : 0 h 1 mins 0 secs diff --git a/tests/abacus.spin/OUT.ABACUS/running_relax.log b/tests/abacus.spin/OUT.ABACUS/running_relax.log new file mode 100644 index 00000000..d94c8f89 --- /dev/null +++ b/tests/abacus.spin/OUT.ABACUS/running_relax.log @@ -0,0 +1,1002 @@ + + ABACUS v3.7.1 + + Atomic-orbital Based Ab-initio Computation at UStc + + Website: http://abacus.ustc.edu.cn/ + Documentation: https://abacus.deepmodeling.com/ + Repository: https://github.com/abacusmodeling/abacus-develop + https://github.com/deepmodeling/abacus-develop + Commit: 8443c42b5 (Thu Sep 5 14:19:05 2024 +0800) + + Start Time is Fri Sep 6 09:29:43 2024 + + ------------------------------------------------------------------------------------ + + READING GENERAL INFORMATION + global_out_dir = OUT.spin/ + global_in_card = INPUT + pseudo_dir = ./ + orbital_dir = ./ + DRANK = 1 + DSIZE = 1 + DCOLOR = 1 + GRANK = 1 + GSIZE = 1 + + + + + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + | | + | Reading atom information in unitcell: | + | From the input file and the structure file we know the number of | + | different elments in this unitcell, then we list the detail | + | information for each element, especially the zeta and polar atomic | + | orbital number for each element. The total atom number is counted. | + | We calculate the nearest atom distance for each atom and show the | + | Cartesian and Direct coordinates for each atom. We list the file | + | address for atomic orbitals. The volume and the lattice vectors | + | in real and reciprocal space is also shown. | + | | + <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + + + + READING UNITCELL INFORMATION + ntype = 1 + lattice constant (Bohr) = 1.88028 + lattice constant (Angstrom) = 0.995 + + READING ATOM TYPE 1 + atom label = Fe + L=0, number of zeta = 4 + L=1, number of zeta = 2 + L=2, number of zeta = 2 + L=3, number of zeta = 1 + number of atom for this type = 2 + magnetization of element 1 = [ 1.25, 1.25, 1.25 ] + + TOTAL ATOM NUMBER = 2 +DIRECT COORDINATES + atom x y z mag vx vy vz +taud_Fe1 0.0000000000 0.0000000000 0.0000000000 2.1651 0.0000000000 0.0000000000 0.0000000000 +taud_Fe2 0.5000000000 0.5000000000 0.5000000000 2.1651 0.0000000000 0.0000000000 0.0000000000 + + + + Volume (Bohr^3) = 150.259 + Volume (A^3) = 22.266 + + Lattice vectors: (Cartesian coordinate: in unit of a_0) + +2.82743 +0 +0 + +0 +2.82743 +0 + +0 +0 +2.82743 + Reciprocal vectors: (Cartesian coordinate: in unit of 2 pi/a_0) + +0.353679 -0 +0 + -0 +0.353679 -0 + +0 -0 +0.353679 + The esolver type has been set to : ksdft_pw + + RUNNING WITH DEVICE : CPU / Intel(R) Xeon(R) Platinum + + + + + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + | | + | Reading pseudopotentials files: | + | The pseudopotential file is in UPF format. The 'NC' indicates that | + | the type of pseudopotential is 'norm conserving'. Functional of | + | exchange and correlation is decided by 4 given parameters in UPF | + | file. We also read in the 'core correction' if there exists. | + | Also we can read the valence electrons number and the maximal | + | angular momentum used in this pseudopotential. We also read in the | + | trail wave function, trail atomic density and local-pseudopotential| + | on logrithmic grid. The non-local pseudopotential projector is also| + | read in if there is any. | + | | + <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + + + + PAO radial cut off (Bohr) = 15 + + Read in pseudopotential file is Fe.upf + pseudopotential type = NC + exchange-correlation functional = PBE + nonlocal core correction = 1 + valence electrons = 16 + lmax = 2 + number of zeta = 4 + number of projectors = 6 + L of projector = 0 + L of projector = 0 + L of projector = 1 + L of projector = 1 + L of projector = 2 + L of projector = 2 + initial pseudo atomic orbital number = 40 + NLOCAL = 108 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Warning: the number of valence electrons in pseudopotential > 8 for Fe: [Ar] 3d6 4s2 + Pseudopotentials with additional electrons can yield (more) accurate outcomes, but may be less efficient. + If you're confident that your chosen pseudopotential is appropriate, you can safely ignore this warning. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + + + + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + | | + | Setup plane waves of charge/potential: | + | Use the energy cutoff and the lattice vectors to generate the | + | dimensions of FFT grid. The number of FFT grid on each processor | + | is 'nrxx'. The number of plane wave basis in reciprocal space is | + | different for charege/potential and wave functions. We also set | + | the 'sticks' for the parallel of FFT. The number of plane waves | + | is 'npw' in each processor. | + <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + + + + + SETUP THE PLANE WAVE BASIS + energy cutoff for charge/potential (unit:Ry) = 400 + fft grid for charge/potential = [ 36, 36, 36 ] + fft grid division = [ 1, 1, 1 ] + big fft grid for charge/potential = [ 36, 36, 36 ] + nbxx = 46656 + nrxx = 46656 + + SETUP PLANE WAVES FOR CHARGE/POTENTIAL + number of plane waves = 20341 + number of sticks = 885 + + PARALLEL PW FOR CHARGE/POTENTIAL + PROC COLUMNS(POT) PW + 1 885 20341 + --------------- sum ------------------- + 1 885 20341 + number of |g| = 241 + max |g| = 35.7753 + min |g| = 0 + +----------- Double Check Mixing Parameters Begin ------------ +mixing_type: broyden +mixing_beta: 0.4 +mixing_gg0: 1 +mixing_gg0_min: 0.1 +mixing_beta_mag: 1.6 +mixing_gg0_mag: 0 +mixing_ndim: 8 +----------- Double Check Mixing Parameters End ------------ + + SETUP THE ELECTRONS NUMBER + electron number of element Fe = 16 + total electron number of element Fe = 32 + AUTOSET number of electrons: = 32 + DONE : SETUP UNITCELL Time : 0.0957571 (SEC) + + + + + + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + | | + | Setup K-points | + | We setup the k-points according to input parameters. | + | The reduced k-points are set according to symmetry operations. | + | We treat the spin as another set of k-points. | + | | + <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + + + + + SETUP K-POINTS + nspin = 4 + Input type of k points = Monkhorst-Pack(Gamma) + nkstot = 1 + nkstot_ibz = 1 +K-POINTS REDUCTION ACCORDING TO SYMMETRY + IBZ DIRECT_X DIRECT_Y DIRECT_Z WEIGHT ibz2bz + 1 0.00000000 0.00000000 0.00000000 1.0000 0 + + nkstot now = 1 +K-POINTS DIRECT COORDINATES + KPOINTS DIRECT_X DIRECT_Y DIRECT_Z WEIGHT + 1 0.00000000 0.00000000 0.00000000 1.0000 + + + k-point number in this process = 1 + minimum distributed K point number = 1 + +K-POINTS CARTESIAN COORDINATES + KPOINTS CARTESIAN_X CARTESIAN_Y CARTESIAN_Z WEIGHT + 1 0.00000000 0.00000000 0.00000000 1.0000 + + +K-POINTS DIRECT COORDINATES + KPOINTS DIRECT_X DIRECT_Y DIRECT_Z WEIGHT + 1 0.00000000 0.00000000 0.00000000 1.0000 + + DONE : INIT K-POINTS Time : 0.105664 (SEC) + + + + + + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + | | + | Setup plane waves of wave functions: | + | Use the energy cutoff and the lattice vectors to generate the | + | dimensions of FFT grid. The number of FFT grid on each processor | + | is 'nrxx'. The number of plane wave basis in reciprocal space is | + | different for charege/potential and wave functions. We also set | + | the 'sticks' for the parallel of FFT. The number of plane wave of | + | each k-point is 'npwk[ik]' in each processor | + <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + + + + + SETUP PLANE WAVES FOR WAVE FUNCTIONS + energy cutoff for wavefunc (unit:Ry) = 100 + fft grid for wave functions = [ 36, 36, 36 ] + number of plane waves = 2517 + number of sticks = 221 + + PARALLEL PW FOR WAVE FUNCTIONS + PROC COLUMNS(POT) PW + 1 221 2517 + --------------- sum ------------------- + 1 221 2517 + DONE : INIT PLANEWAVE Time : 0.106715 (SEC) + + occupied bands = 16 + NBANDS = 52 + + SETUP NONLOCAL PSEUDOPOTENTIALS IN PLANE WAVE BASIS + Fe non-local projectors: + projector 1 L=0 + projector 2 L=0 + projector 3 L=1 + projector 4 L=1 + projector 5 L=2 + projector 6 L=2 + TOTAL NUMBER OF NONLOCAL PROJECTORS = 36 + DONE : LOCAL POTENTIAL Time : 0.122677 (SEC) + + + Init Non-Local PseudoPotential table : + Init Non-Local-Pseudopotential done. + DONE : NON-LOCAL POTENTIAL Time : 0.153353 (SEC) + + npwx = 2517 + + Make real space PAO into reciprocal space. + max mesh points in Pseudopotential = 1425 + dq(describe PAO in reciprocal space) = 0.01 + max q = 1204 + + number of pseudo atomic orbitals for Fe is 4 +WARNING: norm of atomic wavefunction # 2 of atomic type Fe is 0.999981, renormalized +WARNING: norm of atomic wavefunction # 3 of atomic type Fe is 0.999997, renormalized + DONE : INIT BASIS Time : 0.325415 (SEC) + + + ------------------------------------------- + STEP OF RELAXATION : 1 + ------------------------------------------- + init_chg = atomic + DONE : INIT SCF Time : 0.524608 (SEC) + + + PW ALGORITHM --------------- ION= 1 ELEC= 1-------------------------------- +total magnetism (Bohr mag/cell) 2.30943 2.30938 2.30941 + absolute magnetism (Bohr mag/cell) = 4.01976 + Notice: Threshold on eigenvalues was too large. + hsover_error=0.32 > DRHO=0.0686869 + Origin diag_ethr = 0.01 + New diag_ethr = 0.000214646 +total magnetism (Bohr mag/cell) 2.30943 2.30937 2.3094 + absolute magnetism (Bohr mag/cell) = 4.01964 + + Density error is 0.0548949686243 + Error Threshold = 0.000214646406708 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6632803550 -6825.4790901992 + E_Harris -501.6647758269 -6825.4994371390 + E_Fermi 1.4575316668 19.8307356840 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 1 ELEC= 2-------------------------------- +total magnetism (Bohr mag/cell) 2.3094424965 2.30934448798 2.30941621651 + absolute magnetism (Bohr mag/cell) = 4.13707180938 + + Density error is 0.00986449919003 + Error Threshold = 0.000171546776951 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6774595966 -6825.6720086784 + E_Harris -499.7039503033 -6798.8210372331 + E_Fermi 1.4964230898 20.3598806394 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 1 ELEC= 3-------------------------------- +total magnetism (Bohr mag/cell) 2.30944490813 2.30935345105 2.30940487564 + absolute magnetism (Bohr mag/cell) = 4.08853707061 + + Density error is 0.00240445773415 + Error Threshold = 3.08265599688e-05 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6784060189 -6825.6848854146 + E_Harris -501.4802459250 -6822.9887790210 + E_Fermi 1.4994551309 20.4011336751 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 1 ELEC= 4-------------------------------- +total magnetism (Bohr mag/cell) 2.30944724752 2.30935862214 2.30939736766 + absolute magnetism (Bohr mag/cell) = 4.08848804651 + + Density error is 0.00057214611471 + Error Threshold = 7.51393041921e-06 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6784787714 -6825.6858752634 + E_KS(sigma->0) -501.6746222162 -6825.6334041381 + E_Harris -501.6738375513 -6825.6227282240 + E_band -27.9117558414 -379.7589206280 + E_one_elec -203.4207485774 -2767.6812720784 + E_Hartree 123.6718684724 1682.6420935310 + E_xc -71.4390193374 -971.9777225215 + E_Ewald -350.4828662186 -4768.5640319440 + E_entropy(-TS) -0.0077131104 -0.1049422506 + E_descf 0.0000000000 0.0000000000 + E_exx 0.0000000000 0.0000000000 + E_Fermi 1.5017611709 20.4325089589 +---------------------------------------------------------- + +------------------------------------------------------------------------------------------- + Magnetic force (eV/uB) +------------------------------------------------------------------------------------------- + Fe 0.0000000000 0.0000000000 0.0000000000 + Fe 0.0000000000 0.0000000000 0.0000000000 +------------------------------------------------------------------------------------------- + + +------------------------------------------------------------------------------------------- +Orbital Charge Analysis Charge Mag(x) Mag(y) Mag(z) +------------------------------------------------------------------------------------------- +Fe1 + s 1.1149 0.0010 0.0010 0.0010 + p 5.9971 0.0002 0.0002 0.0002 + d 6.5931 1.1679 1.1678 1.1678 + Sum 13.7051 1.1691 1.1690 1.1690 +Fe2 + s 1.1150 0.0010 0.0010 0.0010 + p 5.9971 0.0002 0.0002 0.0002 + d 6.5959 1.1671 1.1671 1.1672 + Sum 13.7079 1.1683 1.1683 1.1684 +------------------------------------------------------------------------------------------- + +------------------------------------------------------------------------------------------- + Total Magnetism (uB) +------------------------------------------------------------------------------------------- + Fe 1.1690981855 1.1689596529 1.1689548475 + Fe 1.1682782547 1.1683271615 1.1683689897 +------------------------------------------------------------------------------------------- + + + charge density convergence is achieved + final etot is -6825.6858753 eV + EFERMI = 20.432508959 eV + + STATE ENERGY(eV) AND OCCUPATIONS NSPIN == 4 + 1/1 kpoint (Cartesian) = 0.0000 0.0000 0.0000 (2517 pws) + 1 -67.4569 1.00000 + 2 -67.2982 1.00000 + 3 -65.2976 1.00000 + 4 -65.1287 1.00000 + 5 -33.6978 1.00000 + 6 -33.6978 1.00000 + 7 -33.6978 1.00000 + 8 -33.3602 1.00000 + 9 -33.3602 1.00000 + 10 -33.3602 1.00000 + 11 -31.4558 1.00000 + 12 -31.4557 1.00000 + 13 -31.4553 1.00000 + 14 -31.0894 1.00000 + 15 -31.0892 1.00000 + 16 -31.0888 1.00000 + 17 10.4705 1.00000 + 18 10.6689 1.00000 + 19 14.7652 1.00000 + 20 14.7654 1.00000 + 21 16.3838 1.00000 + 22 16.3838 1.00000 + 23 17.7210 1.00000 + 24 17.7211 1.00000 + 25 17.7213 1.00000 + 26 19.1329 1.00000 + 27 19.1332 1.00000 + 28 19.5268 1.00000 + 29 19.5272 1.00000 + 30 19.5274 1.00000 + 31 20.3909 0.667123 + 32 20.3910 0.666801 + 33 20.3912 0.666076 + 34 21.6006 0.00000 + 35 21.6007 0.00000 + 36 22.5186 0.00000 + 37 22.5192 0.00000 + 38 22.5194 0.00000 + 39 29.2339 0.00000 + 40 29.2339 0.00000 + 41 29.2339 0.00000 + 42 29.4154 0.00000 + 43 29.4154 0.00000 + 44 29.4155 0.00000 + 45 35.3354 0.00000 + 46 35.3355 0.00000 + 47 36.5789 0.00000 + 48 36.5789 0.00000 + 49 40.4434 0.00000 + 50 41.3886 0.00000 + 51 43.5577 0.00000 + 52 43.5578 0.00000 + + + +------------------------------------------------------------------------------------------ + TOTAL-FORCE (eV/Angstrom) +------------------------------------------------------------------------------------------ + Fe1 -0.0000234480 0.0000848730 0.0003959639 + Fe2 0.0000234480 -0.0000848730 -0.0003959639 +------------------------------------------------------------------------------------------ + + + Relaxation is not converged yet! +DIRECT COORDINATES + atom x y z mag vx vy vz +taud_Fe1 0.9999995833 0.0000015084 0.0000070374 2.1651 0.0000000000 0.0000000000 0.0000000000 +taud_Fe2 0.5000004167 0.4999984916 0.4999929626 2.1651 0.0000000000 0.0000000000 0.0000000000 + + + + ------------------------------------------- + STEP OF RELAXATION : 2 + ------------------------------------------- + Find the file, try to read charge from file. + read in fermi energy = 0.000000 + Find the file, try to read charge from file. + read in fermi energy = 0.000000 + Find the file, try to read charge from file. + read in fermi energy = 0.000000 + Find the file, try to read charge from file. + read in fermi energy = 0.000000 + NEW-OLD atomic charge density approx. for the potential ! + DONE : INIT SCF Time : 4.144735 (SEC) + + + PW ALGORITHM --------------- ION= 2 ELEC= 1-------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0.000000 ; where current threshold is: 0.000008 . +total magnetism (Bohr mag/cell) 2.460713 2.460629 2.460667 + absolute magnetism (Bohr mag/cell) = 4.354773 + Notice: Threshold on eigenvalues was too large. + hsover_error=0.320000 > DRHO=0.001904 + Origin diag_ethr = 0.010000 + New diag_ethr = 0.000006 +total magnetism (Bohr mag/cell) 2.460685 2.460607 2.460642 + absolute magnetism (Bohr mag/cell) = 4.361930 + + Density error is 0.001992966717 + Error Threshold = 0.000005950543 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6717345462 -6825.5941153720 + E_Harris -501.6715923037 -6825.5921800627 + E_Fermi 1.4766962002 20.0914825374 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 2 ELEC= 2-------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0.000000000000 ; where current threshold is: 0.000005950543 . +total magnetism (Bohr mag/cell) 2.454388903679 2.454380662451 2.454379655944 + absolute magnetism (Bohr mag/cell) = 4.361912797650 + + Density error is 0.009228272161 + Error Threshold = 0.000006228021 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6713440630 -6825.5888025749 + E_Harris -501.5133874565 -6823.4396926906 + E_Fermi 1.4801385565 20.1383181977 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 2 ELEC= 3-------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0.000000000000 ; where current threshold is: 0.000006228021 . +total magnetism (Bohr mag/cell) 2.455337730187 2.455339212147 2.455339333866 + absolute magnetism (Bohr mag/cell) = 4.362219771057 + + Density error is 0.002195963526 + Error Threshold = 0.000006228021 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6723554230 -6825.6025628342 + E_Harris -501.6387445550 -6825.1452635146 + E_Fermi 1.4799798703 20.1361591613 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 2 ELEC= 4-------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0.000000000000 ; where current threshold is: 0.000006228021 . +total magnetism (Bohr mag/cell) 2.455780448000 2.455781001768 2.455780765168 + absolute magnetism (Bohr mag/cell) = 4.361708226902 + + Density error is 0.000005361548 + Error Threshold = 0.000006228021 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6724951355 -6825.6044637205 + E_KS(sigma->0) -501.6679025517 -6825.5419784114 + E_Harris -501.6617290453 -6825.4579835487 + E_band -27.8843141296 -379.3855569848 + E_one_elec -203.5744655302 -2769.7726985160 + E_Hartree 123.7850811379 1684.1824308678 + E_xc -71.4835967872 -972.5842298408 + E_Ewald -350.4828661766 -4768.5640313736 + E_entropy(-TS) -0.0091851677 -0.1249706181 + E_descf 0.0000000000 0.0000000000 + E_exx 0.0000000000 0.0000000000 + E_Fermi 1.4799376237 20.1355843666 +---------------------------------------------------------- + +------------------------------------------------------------------------------------------- + Magnetic force (eV/uB) +------------------------------------------------------------------------------------------- + Fe -0.1673462642 -0.1673537756 -0.1673561712 + Fe -0.1683646747 -0.1683589722 -0.1683562492 +------------------------------------------------------------------------------------------- + + +------------------------------------------------------------------------------------------- +Orbital Charge Analysis Charge Mag(x) Mag(y) Mag(z) +------------------------------------------------------------------------------------------- +Fe1 + s 1.1147 0.0019 0.0019 0.0019 + p 5.9971 0.0002 0.0002 0.0002 + d 6.5877 1.2479 1.2479 1.2479 + Sum 13.6995 1.2501 1.2501 1.2500 +Fe2 + s 1.1148 0.0019 0.0019 0.0019 + p 5.9971 0.0002 0.0002 0.0002 + d 6.5911 1.2480 1.2480 1.2480 + Sum 13.7029 1.2502 1.2502 1.2502 +------------------------------------------------------------------------------------------- + +------------------------------------------------------------------------------------------- + Total Magnetism (uB) +------------------------------------------------------------------------------------------- + Fe 1.2500714313 1.2500616663 1.2500458747 + Fe 1.2501576398 1.2501678047 1.2501834374 +------------------------------------------------------------------------------------------- + + + charge density convergence is achieved + final etot is -6825.60446372048 eV + EFERMI = 20.13558436665 eV + + STATE ENERGY(eV) AND OCCUPATIONS NSPIN == 4 + 1/1 kpoint (Cartesian) = 0.00000 0.00000 0.00000 (2517 pws) + 1 -67.494313 1.000000 + 2 -67.340218 1.000000 + 3 -65.146260 1.000000 + 4 -64.972269 1.000000 + 5 -34.011284 1.000000 + 6 -34.011263 1.000000 + 7 -34.011242 1.000000 + 8 -33.673639 1.000000 + 9 -33.673617 1.000000 + 10 -33.673596 1.000000 + 11 -31.014754 1.000000 + 12 -31.014713 1.000000 + 13 -31.014689 1.000000 + 14 -30.647472 1.000000 + 15 -30.647431 1.000000 + 16 -30.647407 1.000000 + 17 10.202179 1.000000 + 18 10.967145 1.000000 + 19 14.534082 1.000000 + 20 14.534103 1.000000 + 21 16.670113 1.000000 + 22 16.670140 1.000000 + 23 17.413528 1.000000 + 24 17.413556 1.000000 + 25 17.413589 1.000000 + 26 18.850839 1.000000 + 27 18.850854 1.000000 + 28 19.969576 0.957785 + 29 19.969617 0.957746 + 30 19.969666 0.957700 + 31 20.082615 0.709038 + 32 20.082645 0.708930 + 33 20.082682 0.708801 + 34 21.999005 0.000000 + 35 21.999021 0.000000 + 36 22.978862 0.000000 + 37 22.978908 0.000000 + 38 22.978962 0.000000 + 39 29.262993 0.000000 + 40 29.263007 0.000000 + 41 29.263018 0.000000 + 42 29.450239 0.000000 + 43 29.450247 0.000000 + 44 29.450271 0.000000 + 45 35.322294 0.000000 + 46 35.322339 0.000000 + 47 36.677233 0.000000 + 48 36.677283 0.000000 + 49 40.233768 0.000000 + 50 41.594113 0.000000 + 51 43.613799 0.000000 + 52 43.613882 0.000000 + + + +------------------------------------------------------------------------------------------ + TOTAL-FORCE (eV/Angstrom) +------------------------------------------------------------------------------------------ + Fe1 0.0000423260 0.0001601470 0.0005255426 + Fe2 -0.0000423260 -0.0001601470 -0.0005255426 +------------------------------------------------------------------------------------------ + + + Relaxation is not converged yet! +DIRECT COORDINATES + atom x y z mag vx vy vz +taud_Fe1 0.9999983331 0.0000060337 0.0000281496 2.1651 0.0000000000 0.0000000000 0.0000000000 +taud_Fe2 0.5000016669 0.4999939663 0.4999718504 2.1651 0.0000000000 0.0000000000 0.0000000000 + + + + ------------------------------------------- + STEP OF RELAXATION : 3 + ------------------------------------------- + Find the file, try to read charge from file. + read in fermi energy = 0.000000 + Find the file, try to read charge from file. + read in fermi energy = 0.000000 + Find the file, try to read charge from file. + read in fermi energy = 0.000000 + Find the file, try to read charge from file. + read in fermi energy = 0.000000 + first order charge density extrapolation ! + Find the file, try to read charge from file. + read in fermi energy = 0.000000 + Find the file, try to read charge from file. + read in fermi energy = 0.000000 + Find the file, try to read charge from file. + read in fermi energy = 0.000000 + Find the file, try to read charge from file. + read in fermi energy = 0.000000 + DONE : INIT SCF Time : 19.338131 (SEC) + + + PW ALGORITHM --------------- ION= 3 ELEC= 1-------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0.000000 ; where current threshold is: 0.000006 . +total magnetism (Bohr mag/cell) 2.455075 2.455068 2.455069 + absolute magnetism (Bohr mag/cell) = 4.365921 + Notice: Threshold on eigenvalues was too large. + hsover_error=0.320000 > DRHO=0.002000 + Origin diag_ethr = 0.010000 + New diag_ethr = 0.000006 +total magnetism (Bohr mag/cell) 2.455050 2.455043 2.455045 + absolute magnetism (Bohr mag/cell) = 4.365458 + + Density error is 0.002011456982 + Error Threshold = 0.000006249033 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6717775158 -6825.5947000038 + E_Harris -501.6716068292 -6825.5923776932 + E_Fermi 1.4833035949 20.1813807543 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 3 ELEC= 2-------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0.000000000000 ; where current threshold is: 0.000006249033 . +total magnetism (Bohr mag/cell) 2.457174616872 2.457187849929 2.457184529753 + absolute magnetism (Bohr mag/cell) = 4.361364469883 + + Density error is 0.008790489237 + Error Threshold = 0.000006285803 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6713261044 -6825.5885582359 + E_Harris -501.8313917187 -6827.7663626437 + E_Fermi 1.4802224904 20.1394601766 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 3 ELEC= 3-------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0.000000000000 ; where current threshold is: 0.000006285803 . +total magnetism (Bohr mag/cell) 2.455913724950 2.455916535345 2.455916133793 + absolute magnetism (Bohr mag/cell) = 4.360083340583 + + Density error is 0.002354066573 + Error Threshold = 0.000006285803 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6723623430 -6825.6026569852 + E_Harris -501.7081536771 -6826.0896230689 + E_Fermi 1.4800610576 20.1372637709 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 3 ELEC= 4-------------------------------- +Average iterative diagonalization steps for k-points 0 is: 0.000000000000 ; where current threshold is: 0.000006285803 . +total magnetism (Bohr mag/cell) 2.455552549274 2.455552935684 2.455553065202 + absolute magnetism (Bohr mag/cell) = 4.360588456959 + + Density error is 0.000003562109 + Error Threshold = 0.000006285803 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.6725119610 -6825.6046926422 + E_KS(sigma->0) -501.6679202282 -6825.5422189132 + E_Harris -501.6917485490 -6825.8664198503 + E_band -27.8833131578 -379.3719380647 + E_one_elec -203.5627195010 -2769.6128855894 + E_Hartree 123.7718909794 1684.0029695549 + E_xc -71.4811134180 -972.5504418684 + E_Ewald -350.4828655476 -4768.5640228156 + E_entropy(-TS) -0.0091834655 -0.1249474581 + E_descf 0.0000000000 0.0000000000 + E_exx 0.0000000000 0.0000000000 + E_Fermi 1.4799197855 20.1353416661 +---------------------------------------------------------- + +------------------------------------------------------------------------------------------- + Magnetic force (eV/uB) +------------------------------------------------------------------------------------------- + Fe -0.1657340600 -0.1657462694 -0.1657444988 + Fe -0.1661948902 -0.1661794752 -0.1661827215 +------------------------------------------------------------------------------------------- + + +------------------------------------------------------------------------------------------- +Orbital Charge Analysis Charge Mag(x) Mag(y) Mag(z) +------------------------------------------------------------------------------------------- +Fe1 + s 1.1147 0.0019 0.0019 0.0019 + p 5.9971 0.0002 0.0002 0.0002 + d 6.5891 1.2477 1.2476 1.2476 + Sum 13.7008 1.2498 1.2498 1.2498 +Fe2 + s 1.1147 0.0019 0.0019 0.0019 + p 5.9971 0.0002 0.0002 0.0002 + d 6.5897 1.2478 1.2479 1.2479 + Sum 13.7015 1.2500 1.2500 1.2500 +------------------------------------------------------------------------------------------- + +------------------------------------------------------------------------------------------- + Total Magnetism (uB) +------------------------------------------------------------------------------------------- + Fe 1.2498499353 1.2497710829 1.2497831345 + Fe 1.2499653291 1.2500441039 1.2500320770 +------------------------------------------------------------------------------------------- + + + charge density convergence is achieved + final etot is -6825.60469264220 eV + EFERMI = 20.13534166609 eV + + STATE ENERGY(eV) AND OCCUPATIONS NSPIN == 4 + 1/1 kpoint (Cartesian) = 0.00000 0.00000 0.00000 (2517 pws) + 1 -67.494346 1.000000 + 2 -67.340195 1.000000 + 3 -65.142147 1.000000 + 4 -64.968232 1.000000 + 5 -34.009462 1.000000 + 6 -34.009434 1.000000 + 7 -34.009266 1.000000 + 8 -33.671810 1.000000 + 9 -33.671781 1.000000 + 10 -33.671615 1.000000 + 11 -31.015112 1.000000 + 12 -31.014434 1.000000 + 13 -31.014342 1.000000 + 14 -30.647876 1.000000 + 15 -30.647195 1.000000 + 16 -30.647103 1.000000 + 17 10.203611 1.000000 + 18 10.967020 1.000000 + 19 14.532886 1.000000 + 20 14.532987 1.000000 + 21 16.668995 1.000000 + 22 16.669002 1.000000 + 23 17.413224 1.000000 + 24 17.413591 1.000000 + 25 17.413900 1.000000 + 26 18.850000 1.000000 + 27 18.850124 1.000000 + 28 19.968700 0.958374 + 29 19.969266 0.957847 + 30 19.969947 0.957208 + 31 20.082043 0.710209 + 32 20.082447 0.708773 + 33 20.082779 0.707589 + 34 21.997966 0.000000 + 35 21.997988 0.000000 + 36 22.976716 0.000000 + 37 22.977326 0.000000 + 38 22.978087 0.000000 + 39 29.262086 0.000000 + 40 29.262096 0.000000 + 41 29.262190 0.000000 + 42 29.456009 0.000000 + 43 29.456271 0.000000 + 44 29.456319 0.000000 + 45 35.320363 0.000000 + 46 35.320446 0.000000 + 47 36.677678 0.000000 + 48 36.677685 0.000000 + 49 40.231928 0.000000 + 50 41.593535 0.000000 + 51 43.611156 0.000000 + 52 43.611230 0.000000 + + + +------------------------------------------------------------------------------------------ + TOTAL-FORCE (eV/Angstrom) +------------------------------------------------------------------------------------------ + Fe1 0.0000917195 -0.0005088150 -0.0021920644 + Fe2 -0.0000917195 0.0005088150 0.0021920644 +------------------------------------------------------------------------------------------ + + + Relaxation is not converged yet! +DIRECT COORDINATES + atom x y z mag vx vy vz +taud_Fe1 0.9999984177 0.0000055644 0.0000261275 2.1651 0.0000000000 0.0000000000 0.0000000000 +taud_Fe2 0.5000015823 0.4999944356 0.4999738725 2.1651 0.0000000000 0.0000000000 0.0000000000 + + + + + -------------------------------------------- + !FINAL_ETOT_IS -6825.6046926421959142 eV + -------------------------------------------- + + +TIME STATISTICS +----------------------------------------------------------------------------- + CLASS_NAME NAME TIME/s CALLS AVG/s PER/% +----------------------------------------------------------------------------- + total 38.86 19 2.05 100.00 + Driver reading 0.02 1 0.02 0.05 + Input_Conv Convert 0.00 1 0.00 0.00 + Driver driver_line 38.84 1 38.84 99.95 + UnitCell check_tau 0.00 1 0.00 0.00 + PW_Basis_Sup setuptransform 0.00 1 0.00 0.01 + PW_Basis_Sup distributeg 0.00 1 0.00 0.00 + mymath heapsort 0.00 6 0.00 0.01 + PW_Basis_K setuptransform 0.00 1 0.00 0.00 + PW_Basis_K distributeg 0.00 1 0.00 0.00 + PW_Basis setup_struc_factor 0.00 3 0.00 0.01 + ppcell_vnl init 0.00 1 0.00 0.01 + ppcell_vl init_vloc 0.01 1 0.01 0.01 + ppcell_vnl init_vnl 0.03 1 0.03 0.08 + WF_atomic init_at_1 0.17 1 0.17 0.44 + wavefunc wfcinit 0.00 1 0.00 0.00 + Ions opt_ions 38.53 1 38.53 99.14 + ESolver_KS_PW runner 38.20 3 12.73 98.28 + H_Ewald_pw compute_ewald 0.00 3 0.00 0.01 + Charge set_rho_core 0.02 3 0.01 0.06 + PW_Basis_Sup recip2real 0.22 369 0.00 0.57 + PW_Basis_Sup gathers_scatterp 0.03 369 0.00 0.08 + Charge atomic_rho 0.07 6 0.01 0.18 + Potential init_pot 0.21 3 0.07 0.54 + Potential update_from_charge 1.03 15 0.07 2.64 + Potential cal_fixed_v 0.00 3 0.00 0.01 + PotLocal cal_fixed_v 0.00 3 0.00 0.01 + Potential cal_v_eff 1.02 15 0.07 2.62 + H_Hartree_pw v_hartree 0.02 15 0.00 0.06 + PW_Basis_Sup real2recip 0.25 486 0.00 0.64 + PW_Basis_Sup gatherp_scatters 0.02 486 0.00 0.06 + PotXC cal_v_eff 0.99 15 0.07 2.54 + XC_Functional v_xc 1.18 18 0.07 3.04 + Potential interpolate_vrs 0.01 15 0.00 0.01 + OnsiteProj cubspl_tabulate 0.09 1 0.09 0.24 + Charge_Mixing init_mixing 0.00 3 0.00 0.01 + ESolver_KS_PW hamilt2density 7.41 15 0.49 19.07 + HSolverPW solve 11.45 23 0.50 29.46 + pp_cell_vnl getvnl 0.57 213 0.00 1.46 + Structure_Factor get_sk 0.06 221 0.00 0.16 + OnsiteProj getvnl 0.00 213 0.00 0.00 + OnsiteProj tabulate_atomic 0.00 239 0.00 0.00 + WF_atomic atomic_wfc 0.01 1 0.01 0.01 + DiagoIterAssist diagH_subspace_init 0.14 1 0.14 0.35 + Operator hPsi 31.99 2952 0.01 82.32 + Operator EkineticPW 0.15 2952 0.00 0.39 + Operator VeffPW 28.61 2952 0.01 73.61 + PW_Basis_K recip2real 8.33 28782 0.00 21.42 + PW_Basis_K gathers_scatterp 1.23 28782 0.00 3.16 + PW_Basis_K real2recip 7.66 27222 0.00 19.72 + PW_Basis_K gatherp_scatters 0.58 27222 0.00 1.49 + Operator NonlocalPW 2.14 2952 0.00 5.51 + Nonlocal add_nonlocal_pp 1.30 2952 0.00 3.35 + Operator OnsiteProjPW 1.09 2952 0.00 2.79 + OnsiteProj overlap 0.55 2978 0.00 1.42 + FS_Nonlocal_tools cal_becp 0.56 2984 0.00 1.43 + OnsiteProj add_onsite_proj 0.47 2952 0.00 1.20 + DiagoIterAssist diagH_LAPACK 0.23 209 0.00 0.59 + DiagoCG diag_once 8.26 23 0.36 21.24 + DiagoCG_New spsi_func 0.07 5486 0.00 0.17 + DiagoCG_New hpsi_func 7.20 2743 0.00 18.52 + ElecStatePW psiToRho 0.63 15 0.04 1.62 + Charge_Mixing get_drho 0.07 15 0.00 0.19 + Charge_Mixing inner_product_recip_rho 0.00 15 0.00 0.01 + Charge mix_rho 0.05 9 0.01 0.14 + Charge Broyden_mixing 0.01 9 0.00 0.03 + DiagoIterAssist diagH_subspace 2.30 18 0.13 5.92 + Charge_Mixing inner_product_recip_hartree 0.00 18 0.00 0.01 + OnsiteProj cal_occupation 0.00 3 0.00 0.01 + Forces cal_force_loc 0.01 3 0.00 0.02 + Forces cal_force_ew 0.00 3 0.00 0.01 + Forces cal_force_nl 0.03 3 0.01 0.07 + FS_Nonlocal_tools cal_dbecp_f 0.03 18 0.00 0.07 + Forces cal_force_onsite 0.01 3 0.00 0.04 + Forces cal_force_cc 0.22 3 0.07 0.57 + Forces cal_force_scc 0.02 3 0.01 0.06 + SpinConstrain cal_mw_from_lambda 28.58 198 0.14 73.53 + DiagoIterAssist diag_responce 23.97 190 0.13 61.69 + ModuleIO write_istate_info 0.01 1 0.01 0.02 +----------------------------------------------------------------------------- + + + NAME-------------------------|MEMORY(MB)-------- + total 24.4333 + Psi_PW 3.9943 + DiagSub::temp 3.9943 + FFT::grid 1.4238 + Chg::rho 1.4238 + Chg::rho_save 1.4238 + Pot::veff 1.4238 + Pot::veff_smooth 1.4238 + VNL::vkb 1.3826 + ------------- < 1.0 MB has been ignored ---------------- + ---------------------------------------------------------- + + Start Time : Fri Sep 6 09:29:43 2024 + Finish Time : Fri Sep 6 09:30:22 2024 + Total Time : 0 h 0 mins 39 secs diff --git a/tests/abacus.spin/OUT.ABACUS/running_scf.log b/tests/abacus.spin/OUT.ABACUS/running_scf.log new file mode 100644 index 00000000..2e6e98cc --- /dev/null +++ b/tests/abacus.spin/OUT.ABACUS/running_scf.log @@ -0,0 +1,565 @@ + + ABACUS v3.7.1 + + Atomic-orbital Based Ab-initio Computation at UStc + + Website: http://abacus.ustc.edu.cn/ + Documentation: https://abacus.deepmodeling.com/ + Repository: https://github.com/abacusmodeling/abacus-develop + https://github.com/deepmodeling/abacus-develop + Commit: 1a7a3158b (Fri Aug 23 00:52:25 2024 +0800) + + Start Time is Fri Aug 23 16:06:02 2024 + + ------------------------------------------------------------------------------------ + + READING GENERAL INFORMATION + global_out_dir = OUT.ABACUS/ + global_in_card = INPUT + pseudo_dir = ./ + orbital_dir = ./ + DRANK = 1 + DSIZE = 16 + DCOLOR = 1 + GRANK = 1 + GSIZE = 1 + + + + + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + | | + | Reading atom information in unitcell: | + | From the input file and the structure file we know the number of | + | different elments in this unitcell, then we list the detail | + | information for each element, especially the zeta and polar atomic | + | orbital number for each element. The total atom number is counted. | + | We calculate the nearest atom distance for each atom and show the | + | Cartesian and Direct coordinates for each atom. We list the file | + | address for atomic orbitals. The volume and the lattice vectors | + | in real and reciprocal space is also shown. | + | | + <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + + + + READING UNITCELL INFORMATION + ntype = 1 + lattice constant (Bohr) = 1.88028 + lattice constant (Angstrom) = 0.995 + + READING ATOM TYPE 1 + atom label = Fe + L=0, number of zeta = 4 + L=1, number of zeta = 2 + L=2, number of zeta = 2 + L=3, number of zeta = 1 + number of atom for this type = 2 + magnetization of element 1 = [ 0, 0, 2.4 ] + + TOTAL ATOM NUMBER = 2 +DIRECT COORDINATES + atom x y z mag vx vy vz +taud_Fe1 0.0500000000 0.1000000000 0.1500000000 2.4000 0.0000000000 0.0000000000 0.0000000000 +taud_Fe2 0.5000000000 0.5000000000 0.5000000000 2.4000 0.0000000000 0.0000000000 0.0000000000 + + + + Volume (Bohr^3) = 150.259 + Volume (A^3) = 22.266 + + Lattice vectors: (Cartesian coordinate: in unit of a_0) + +2.82743 +0 +0 + +0 +2.82743 +0 + +0 +0 +2.82743 + Reciprocal vectors: (Cartesian coordinate: in unit of 2 pi/a_0) + +0.353679 -0 +0 + -0 +0.353679 -0 + +0 -0 +0.353679 + The esolver type has been set to : ksdft_pw + + RUNNING WITH DEVICE : CPU / Intel(R) Xeon(R) Platinum 8255C CPU @ 2.50GHz + + + + + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + | | + | Reading pseudopotentials files: | + | The pseudopotential file is in UPF format. The 'NC' indicates that | + | the type of pseudopotential is 'norm conserving'. Functional of | + | exchange and correlation is decided by 4 given parameters in UPF | + | file. We also read in the 'core correction' if there exists. | + | Also we can read the valence electrons number and the maximal | + | angular momentum used in this pseudopotential. We also read in the | + | trail wave function, trail atomic density and local-pseudopotential| + | on logrithmic grid. The non-local pseudopotential projector is also| + | read in if there is any. | + | | + <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + + + + PAO radial cut off (Bohr) = 15 + + Read in pseudopotential file is Fe.upf + pseudopotential type = NC + exchange-correlation functional = PBE + nonlocal core correction = 1 + valence electrons = 16 + lmax = 2 + number of zeta = 6 + number of projectors = 10 + L of projector = 0 + L of projector = 0 + L of projector = 1 + L of projector = 1 + L of projector = 1 + L of projector = 1 + L of projector = 2 + L of projector = 2 + L of projector = 2 + L of projector = 2 + initial pseudo atomic orbital number = 40 + NLOCAL = 108 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Warning: the number of valence electrons in pseudopotential > 8 for Fe: [Ar] 3d6 4s2 + Pseudopotentials with additional electrons can yield (more) accurate outcomes, but may be less efficient. + If you're confident that your chosen pseudopotential is appropriate, you can safely ignore this warning. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + + + + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + | | + | Setup plane waves of charge/potential: | + | Use the energy cutoff and the lattice vectors to generate the | + | dimensions of FFT grid. The number of FFT grid on each processor | + | is 'nrxx'. The number of plane wave basis in reciprocal space is | + | different for charege/potential and wave functions. We also set | + | the 'sticks' for the parallel of FFT. The number of plane waves | + | is 'npw' in each processor. | + <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + + + + + SETUP THE PLANE WAVE BASIS + energy cutoff for charge/potential (unit:Ry) = 320 + fft grid for charge/potential = [ 32, 32, 32 ] + fft grid division = [ 1, 1, 1 ] + big fft grid for charge/potential = [ 32, 32, 32 ] + nbxx = 2048 + nrxx = 2048 + + SETUP PLANE WAVES FOR CHARGE/POTENTIAL + number of plane waves = 14531 + number of sticks = 725 + + PARALLEL PW FOR CHARGE/POTENTIAL + PROC COLUMNS(POT) PW + 1 45 909 + 2 45 909 + 3 46 908 + 4 46 908 + 5 45 909 + 6 45 909 + 7 45 909 + 8 45 909 + 9 45 909 + 10 46 908 + 11 46 908 + 12 46 908 + 13 45 907 + 14 45 907 + 15 45 907 + 16 45 907 + --------------- sum ------------------- + 16 725 14531 + number of |g| = 165 + max |g| = 28.6453 + min |g| = 0.500354 + +----------- Double Check Mixing Parameters Begin ------------ +mixing_type: broyden +mixing_beta: 0.4 +mixing_gg0: 1 +mixing_gg0_min: 0.1 +mixing_beta_mag: 1.6 +mixing_gg0_mag: 0 +mixing_ndim: 10 +----------- Double Check Mixing Parameters End ------------ + + SETUP THE ELECTRONS NUMBER + electron number of element Fe = 16 + total electron number of element Fe = 32 + AUTOSET number of electrons: = 32 + DONE : SETUP UNITCELL Time : 0.316237 (SEC) + + + + + + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + | | + | Setup K-points | + | We setup the k-points according to input parameters. | + | The reduced k-points are set according to symmetry operations. | + | We treat the spin as another set of k-points. | + | | + <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + + + + + SETUP K-POINTS + nspin = 4 + Input type of k points = Monkhorst-Pack(Gamma) + nkstot = 216 +K-POINTS DIRECT COORDINATES + KPOINTS DIRECT_X DIRECT_Y DIRECT_Z WEIGHT + + DONE : INIT K-POINTS Time : 0.376998 (SEC) + + + + + + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + | | + | Setup plane waves of wave functions: | + | Use the energy cutoff and the lattice vectors to generate the | + | dimensions of FFT grid. The number of FFT grid on each processor | + | is 'nrxx'. The number of plane wave basis in reciprocal space is | + | different for charege/potential and wave functions. We also set | + | the 'sticks' for the parallel of FFT. The number of plane wave of | + | each k-point is 'npwk[ik]' in each processor | + <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + + + + + SETUP PLANE WAVES FOR WAVE FUNCTIONS + energy cutoff for wavefunc (unit:Ry) = 80 + fft grid for wave functions = [ 32, 32, 32 ] + number of plane waves = 3071 + number of sticks = 253 + + PARALLEL PW FOR WAVE FUNCTIONS + PROC COLUMNS(POT) PW + 1 16 192 + 2 16 192 + 3 16 192 + 4 16 192 + 5 15 191 + 6 15 191 + 7 16 194 + 8 16 192 + 9 16 192 + 10 16 192 + 11 16 192 + 12 16 192 + 13 16 192 + 14 16 192 + 15 16 192 + 16 15 191 + --------------- sum ------------------- + 16 253 3071 + DONE : INIT PLANEWAVE Time : 0.380345 (SEC) + + occupied bands = 32 + NBANDS = 52 + + SETUP NONLOCAL PSEUDOPOTENTIALS IN PLANE WAVE BASIS + Fe non-local projectors: + projector 1 L=0 + projector 2 L=0 + projector 3 L=1 + projector 4 L=1 + projector 5 L=1 + projector 6 L=1 + projector 7 L=2 + projector 8 L=2 + projector 9 L=2 + projector 10 L=2 + TOTAL NUMBER OF NONLOCAL PROJECTORS = 68 + DONE : LOCAL POTENTIAL Time : 0.40963 (SEC) + + + Init Non-Local PseudoPotential table : + Init Non-Local-Pseudopotential done. + DONE : NON-LOCAL POTENTIAL Time : 0.443773 (SEC) + + npwx = 128 + + Warning_Memory_Consuming allocated: Psi_PW 43.875 MB + + Make real space PAO into reciprocal space. + max mesh points in Pseudopotential = 1425 + dq(describe PAO in reciprocal space) = 0.01 + max q = 1078 + + number of pseudo atomic orbitals for Fe is 6 + DONE : INIT BASIS Time : 0.620862 (SEC) + + + ------------------------------------------- + SELF-CONSISTENT + ------------------------------------------- + init_chg = atomic + DONE : INIT SCF Time : 0.761759 (SEC) + + + PW ALGORITHM --------------- ION= 1 ELEC= 1-------------------------------- +total magnetism (Bohr mag/cell) -8.56154e-05 -3.16838e-05 3.87672 + absolute magnetism (Bohr mag/cell) = 3.90219 + Notice: Threshold on eigenvalues was too large. + hsover_error=0.32 > DRHO=0.0810864 + Origin diag_ethr = 0.01 + New diag_ethr = 0.000253395 +total magnetism (Bohr mag/cell) -9.09654e-05 -3.00029e-05 3.87658 + absolute magnetism (Bohr mag/cell) = 3.90286 + + Density error is 0.0818013187196 + Error Threshold = 0.000253394954616 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.1638820263 -6818.6844273569 + E_Harris -501.1650591987 -6818.7004436094 + E_Fermi 1.4203911993 19.3254136999 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 1 ELEC= 2-------------------------------- +total magnetism (Bohr mag/cell) -2.92622585913e-05 -0.000266812474323 3.65800660509 + absolute magnetism (Bohr mag/cell) = 3.88387266047 + + Density error is 0.0165562104235 + Error Threshold = 0.000255629120999 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.1785311471 -6818.8837388713 + E_Harris -501.4729927600 -6822.8900946492 + E_Fermi 1.4123735299 19.2163277107 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 1 ELEC= 3-------------------------------- +total magnetism (Bohr mag/cell) -1.41288005953e-05 -0.000388528787066 3.72548472333 + absolute magnetism (Bohr mag/cell) = 3.91023806289 + + Density error is 0.00318633115585 + Error Threshold = 5.17381575736e-05 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.1785047719 -6818.8833800180 + E_Harris -501.0742053019 -6817.4643129270 + E_Fermi 1.4117399370 19.2077072372 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 1 ELEC= 4-------------------------------- +total magnetism (Bohr mag/cell) 2.26526732328e-05 -0.000450436470697 3.73775099313 + absolute magnetism (Bohr mag/cell) = 3.92308219614 + + Density error is 0.000165938860835 + Error Threshold = 9.95728486202e-06 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.1804562269 -6818.9099309251 + E_Harris -501.0912756169 -6817.6965664782 + E_Fermi 1.4131895976 19.2274308815 +---------------------------------------------------------- + + + PW ALGORITHM --------------- ION= 1 ELEC= 5-------------------------------- + +total magnetism (Bohr mag/cell) -0.000682480084963 -0.000407948602903 4.47635324671 + absolute magnetism (Bohr mag/cell) = 4.82248432181 + + Density error is 6.61858307885e-09 + Error Threshold = 5.40730613116e-10 +---------------------------------------------------------- + Energy Rydberg eV +---------------------------------------------------------- + E_KohnSham -501.1664531630 -6818.7194094666 + E_KS(sigma->0) -501.1658847659 -6818.7116760274 + E_Harris -501.1680065331 -6818.7405441510 + E_band -30.1701507306 -410.4859594555 + E_one_elec -214.9321986489 -2924.3025852934 + E_Hartree 128.2299640744 1744.6581657467 + E_xc -71.3503189041 -970.7708912124 + E_Ewald -343.2422281761 -4670.0500974110 + E_entropy(-TS) -0.0011367942 -0.0154668785 + E_descf 0.0000000000 0.0000000000 + E_exx 0.0000000000 0.0000000000 + E_Fermi 1.4108073605 19.1950188828 +---------------------------------------------------------- + +------------------------------------------------------------------------------------------- + Total Magnetism (uB) +------------------------------------------------------------------------------------------- + Fe -0.0000002724 -0.0000001728 2.4000001004 + Fe -0.0000003180 -0.0000002299 2.3999994597 +------------------------------------------------------------------------------------------- + +------------------------------------------------------------------------------------------- + Magnetic force (eV/uB) +------------------------------------------------------------------------------------------- + Fe -0.0000175013 -0.0000418680 -0.3669618965 + Fe -0.0000161517 -0.0000195198 -0.3669821632 +------------------------------------------------------------------------------------------- + +Charge and Mag of Atom 0 + Orbital 1 Charge: 1.99985926204 Mag: -8.50835272933e-09 -8.84955876115e-09 2.84869655853e-06 + Orbital 2 Charge: 5.99701367096 Mag: -2.18088393737e-07 -2.40618119919e-07 0.000105269162551 + Orbital 3 Charge: 6.37379729477 Mag: -4.581340875e-08 7.66548679323e-08 2.39989198254 +Sum of atom 0 is: 14.3706702278 -2.72410155216e-07 -1.72812810748e-07 2.4000001004 +Charge and Mag of Atom 1 + Orbital 1 Charge: 1.99985925962 Mag: -6.91586723071e-09 -8.93979594505e-09 2.85090960195e-06 + Orbital 2 Charge: 5.99701367924 Mag: -2.16539560943e-07 -2.55979271358e-07 0.000105265428294 + Orbital 3 Charge: 6.37381969542 Mag: -9.45758719447e-08 3.50118887944e-08 2.3998913434 +Sum of atom 1 is: 14.3706926343 -3.18031300118e-07 -2.29907178509e-07 2.39999945974 + + charge density convergence is achieved + final etot is -6818.7194095 eV + EFERMI = 19.195018883 eV + +------------------------------------------------------------------------------------------ + TOTAL-FORCE (eV/Angstrom) +------------------------------------------------------------------------------------------ + Fe1 -0.0000234480 0.0000848730 0.0003959639 + Fe2 0.0000234480 -0.0000848730 -0.0003959639 +------------------------------------------------------------------------------------------ + + -------------------------------------------- + !FINAL_ETOT_IS -6818.719409466637 eV + -------------------------------------------- + + +TIME STATISTICS +---------------------------------------------------------------------------- + CLASS_NAME NAME TIME/s CALLS AVG/s PER/% +---------------------------------------------------------------------------- + total 563.56 15 37.57 100.00 + Driver reading 0.11 1 0.11 0.02 + Input_Conv Convert 0.00 1 0.00 0.00 + Driver driver_line 563.45 1 563.45 99.98 + UnitCell check_tau 0.00 1 0.00 0.00 + PW_Basis_Sup setuptransform 0.06 1 0.06 0.01 + PW_Basis_Sup distributeg 0.00 1 0.00 0.00 + mymath heapsort 0.00 3 0.00 0.00 + PW_Basis_K setuptransform 0.00 1 0.00 0.00 + PW_Basis_K distributeg 0.00 1 0.00 0.00 + PW_Basis setup_struc_factor 0.00 1 0.00 0.00 + ppcell_vnl init 0.00 1 0.00 0.00 + ppcell_vl init_vloc 0.02 1 0.02 0.00 + ppcell_vnl init_vnl 0.03 1 0.03 0.01 + WF_atomic init_at_1 0.18 1 0.18 0.03 + wavefunc wfcinit 0.00 1 0.00 0.00 + Ions opt_ions 562.87 1 562.87 99.88 + ESolver_KS_PW runner 562.87 1 562.87 99.88 + H_Ewald_pw compute_ewald 0.00 1 0.00 0.00 + Charge set_rho_core 0.01 1 0.01 0.00 + PW_Basis_Sup recip2real 0.03 202 0.00 0.00 + PW_Basis_Sup gathers_scatterp 0.01 202 0.00 0.00 + Charge atomic_rho 0.00 1 0.00 0.00 + Potential init_pot 0.01 1 0.01 0.00 + Potential update_from_charge 0.07 13 0.01 0.01 + Potential cal_fixed_v 0.00 1 0.00 0.00 + PotLocal cal_fixed_v 0.00 1 0.00 0.00 + Potential cal_v_eff 0.06 13 0.00 0.01 + H_Hartree_pw v_hartree 0.00 13 0.00 0.00 + PW_Basis_Sup real2recip 0.02 247 0.00 0.00 + PW_Basis_Sup gatherp_scatters 0.02 247 0.00 0.00 + PotXC cal_v_eff 0.06 13 0.00 0.01 + XC_Functional v_xc 0.06 13 0.00 0.01 + Potential interpolate_vrs 0.00 13 0.00 0.00 + OnsiteProj init_k_stage0 0.08 1 0.08 0.01 + Charge_Mixing init_mixing 0.00 2 0.00 0.00 + ESolver_KS_PW hamilt2density 184.77 13 14.21 32.79 + HSolverPW solve 287.77 21 13.70 51.06 + pp_cell_vnl getvnl 4.21 21384 0.00 0.75 + Structure_Factor get_sk 2.26 492264 0.00 0.40 + OnsiteProj getvnl 3.45 21384 0.00 0.61 + OnsiteProj init_k 4.11 26136 0.00 0.73 + OnsiteProj init_k_stage1 1.73 26136 0.00 0.31 + OnsiteProj init_k_stage2 2.37 26136 0.00 0.42 + WF_atomic atomic_wfc 0.10 216 0.00 0.02 + DiagoDavid diag_mock 259.79 4536 0.06 46.10 + DiagoDavid first 83.93 4536 0.02 14.89 + David spsi_func 1.10 1075598 0.00 0.20 + DiagoDavid SchmidtOrth 14.54 537799 0.00 2.58 + David hpsi_func 149.60 14979 0.01 26.55 + Operator hPsi 396.41 31827 0.01 70.34 + Operator EkineticPW 2.03 31827 0.00 0.36 + Operator VeffPW 344.42 31827 0.01 61.12 + PW_Basis_K recip2real 183.20 3119822 0.00 32.51 + PW_Basis_K gathers_scatterp 160.47 3119822 0.00 28.47 + PW_Basis_K real2recip 155.75 2827790 0.00 27.64 + PW_Basis_K gatherp_scatters 136.28 2827790 0.00 24.18 + Operator NonlocalPW 42.43 31827 0.00 7.53 + Nonlocal add_nonlocal_pp 34.57 31827 0.00 6.13 + Operator OnsiteProjPW 7.38 31827 0.00 1.31 + OnsiteProj add_onsite_proj 7.35 31827 0.00 1.30 + OnsiteProj overlap 5.91 36579 0.00 1.05 + DiagoDavid cal_elem 35.38 14979 0.00 6.28 + DiagoDavid diag_zhegvx 51.18 14979 0.00 9.08 + DiagoDavid cal_grad 101.08 10443 0.01 17.94 + DiagoDavid check_update 0.01 10443 0.00 0.00 + DiagoDavid last 1.75 4536 0.00 0.31 + ElecStatePW psiToRho 18.60 13 1.43 3.30 + Charge_Mixing get_drho 0.01 13 0.00 0.00 + Charge_Mixing inner_product_recip_rho 0.00 13 0.00 0.00 + Charge mix_rho 0.01 10 0.00 0.00 + Charge Broyden_mixing 0.01 10 0.00 0.00 + Charge_Mixing inner_product_recip_hartree 0.00 48 0.00 0.00 + SpinConstrain cal_mw_from_lambda 377.05 86 4.38 66.90 + DiagoIterAssist diag_responce 266.63 16848 0.02 47.31 + DiagoIterAssist diagH_LAPACK 12.16 16848 0.00 2.16 + OnsiteProj cal_occupation 0.06 1 0.06 0.01 + ModuleIO write_istate_info 0.07 1 0.07 0.01 +---------------------------------------------------------------------------- + + + NAME-------------------------|MEMORY(MB)-------- + total 786.3 + Psi_PW 668.8 + DAV::basis 12.38 + DAV::hpsi 12.38 + DAV::spsi 12.38 + DAV::hcc 10.56 + DAV::scc 10.56 + DAV::vcc 10.56 + MTransOp 10.56 + PW_B_K::gcar 9.645 + PW_B_K::gk2 3.215 + DiagSub::temp 3.096 + VNL::tab 2.632 + VNL::vkb 2.024 + Nonlocal::becp 1.727 + Nonlocal::ps 1.727 + VNL::tab_at 1.579 + FFT::grid 1.000 + Chg::rho 1.000 + Chg::rho_save 1.000 + Pot::veff 1.000 + Pot::veff_smooth 1.000 + ------------- < 1.0 MB has been ignored ---------------- + ---------------------------------------------------------- + + Start Time : Fri Aug 23 16:06:02 2024 + Finish Time : Fri Aug 23 16:15:04 2024 + Total Time : 0 h 9 mins 2 secs diff --git a/tests/abacus.spin/STRU b/tests/abacus.spin/STRU new file mode 100644 index 00000000..6ec77f1a --- /dev/null +++ b/tests/abacus.spin/STRU @@ -0,0 +1,21 @@ +ATOMIC_SPECIES +Fe 55.845 Fe.upf + +NUMERICAL_ORBITAL +Fe_gga_10au_200.0Ry_4s2p2d1f.orb + +LATTICE_CONSTANT +1.880277359 +LATTICE_VECTORS + 2.8274254848 0.0000000000 0.0000000000 #latvec1 + 0.0000000000 2.8274254848 0.0000000000 #latvec2 + 0.0000000000 0.0000000000 2.8274254848 #latvec3 + +ATOMIC_POSITIONS +Direct + +Fe #label +1 #magnetism +2 #number of atoms + 0.0500000000 0.100000000 0.1500000000 mag 0 0 2.4 sc 1 1 1 + 0.5000000000 0.5000000000 0.5000000000 mag 0 0 2.4 sc 1 1 1 diff --git a/tests/test_abacus_spin.py b/tests/test_abacus_spin.py new file mode 100644 index 00000000..df8ef7d0 --- /dev/null +++ b/tests/test_abacus_spin.py @@ -0,0 +1,157 @@ +from __future__ import annotations + +import os +import shutil +import unittest + +import numpy as np +from context import dpdata + + +class TestABACUSSpin(unittest.TestCase): + def setUp(self): + self.dump_path = "abacus.spin/dump" + os.makedirs(self.dump_path, exist_ok=True) + + def tearDown(self): + if os.path.isdir(self.dump_path): + shutil.rmtree(self.dump_path) + + def test_scf(self): + os.system("cp abacus.spin/INPUT.scf abacus.spin/INPUT") + mysys = dpdata.LabeledSystem("abacus.spin", fmt="abacus/scf") + data = mysys.data + self.assertAlmostEqual(data["energies"][0], -6818.719409466637) + np.testing.assert_almost_equal( + data["spins"][0], + [ + [-0.0000002724, -0.0000001728, 2.4000001004], + [-0.0000003180, -0.0000002299, 2.3999994597], + ], + decimal=8, + ) + np.testing.assert_almost_equal( + data["mag_forces"][0], + [ + [-0.0000175013, -0.0000418680, -0.3669618965], + [-0.0000161517, -0.0000195198, -0.3669821632], + ], + decimal=8, + ) + + # dump to deepmd-npy + mysys.to(file_name=self.dump_path, fmt="deepmd/npy") + self.assertTrue(os.path.isfile(f"{self.dump_path}/set.000/spin.npy")) + self.assertTrue(os.path.isfile(f"{self.dump_path}/set.000/force_mag.npy")) + + sys2 = dpdata.LabeledSystem(self.dump_path, fmt="deepmd/npy") + np.testing.assert_almost_equal(data["spins"], sys2.data["spins"], decimal=8) + np.testing.assert_almost_equal( + data["mag_forces"], sys2.data["mag_forces"], decimal=8 + ) + + def test_relax(self): + os.system("cp abacus.spin/INPUT.relax abacus.spin/INPUT") + mysys = dpdata.LabeledSystem("abacus.spin", fmt="abacus/relax") + data = mysys.data + spins_ref = np.array( + [ + [ + [1.16909819, 1.16895965, 1.16895485], + [1.16827825, 1.16832716, 1.16836899], + ], + [ + [1.25007143, 1.25006167, 1.25004587], + [1.25015764, 1.2501678, 1.25018344], + ], + [ + [1.24984994, 1.24977108, 1.24978313], + [1.24996533, 1.2500441, 1.25003208], + ], + ] + ) + magforces_ref = np.array( + [ + [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]], + [ + [-0.16734626, -0.16735378, -0.16735617], + [-0.16836467, -0.16835897, -0.16835625], + ], + [ + [-0.16573406, -0.16574627, -0.1657445], + [-0.16619489, -0.16617948, -0.16618272], + ], + ] + ) + self.assertEqual(len(data["spins"]), 3) + self.assertEqual(len(data["mag_forces"]), 3) + np.testing.assert_almost_equal(data["spins"], spins_ref, decimal=8) + np.testing.assert_almost_equal(data["mag_forces"], magforces_ref, decimal=8) + + # dump to deepmd-npy + mysys.to(file_name=self.dump_path, fmt="deepmd/npy") + self.assertTrue(os.path.isfile(f"{self.dump_path}/set.000/spin.npy")) + self.assertTrue(os.path.isfile(f"{self.dump_path}/set.000/force_mag.npy")) + + sys2 = dpdata.LabeledSystem(self.dump_path, fmt="deepmd/npy") + np.testing.assert_almost_equal(data["spins"], sys2.data["spins"], decimal=8) + np.testing.assert_almost_equal( + data["mag_forces"], sys2.data["mag_forces"], decimal=8 + ) + + def test_md(self): + os.system("cp abacus.spin/INPUT.md abacus.spin/INPUT") + mysys = dpdata.LabeledSystem("abacus.spin", fmt="abacus/md") + data = mysys.data + spins_ref = np.array( + [ + [ + [1.16909819, 1.16895965, 1.16895485], + [1.16827825, 1.16832716, 1.16836899], + ], + [ + [1.2500362, 1.25007501, 1.2500655], + [1.25019078, 1.25015253, 1.25016188], + ], + [ + [1.24985138, 1.24976901, 1.2497695], + [1.24996388, 1.25004618, 1.25004561], + ], + [ + [1.24982513, 1.24985445, 1.24985336], + [1.25005073, 1.25001814, 1.25002065], + ], + ] + ) + magforces_ref = np.array( + [ + [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]], + [ + [-0.16747275, -0.16747145, -0.16746776], + [-0.16853881, -0.16853935, -0.16854119], + ], + [ + [-0.16521817, -0.16523256, -0.16523212], + [-0.16549418, -0.16547867, -0.16547913], + ], + [ + [-0.16141172, -0.16140644, -0.1614127], + [-0.15901519, -0.15905932, -0.15904824], + ], + ] + ) + self.assertEqual(len(data["spins"]), 4) + self.assertEqual(len(data["mag_forces"]), 4) + np.testing.assert_almost_equal(data["spins"], spins_ref, decimal=8) + np.testing.assert_almost_equal(data["mag_forces"], magforces_ref, decimal=8) + + # dump to deepmd-npy + mysys.to(file_name=self.dump_path, fmt="deepmd/npy") + self.assertTrue(os.path.isfile(f"{self.dump_path}/set.000/spin.npy")) + self.assertTrue(os.path.isfile(f"{self.dump_path}/set.000/force_mag.npy")) + + sys2 = dpdata.LabeledSystem(self.dump_path, fmt="deepmd/npy") + np.testing.assert_almost_equal(data["spins"], sys2.data["spins"], decimal=8) + np.testing.assert_almost_equal( + data["mag_forces"], sys2.data["mag_forces"], decimal=8 + ) diff --git a/tests/test_abacus_stru_dump.py b/tests/test_abacus_stru_dump.py index 356aa57f..084a5473 100644 --- a/tests/test_abacus_stru_dump.py +++ b/tests/test_abacus_stru_dump.py @@ -1,16 +1,23 @@ from __future__ import annotations import os +import shutil import unittest from context import dpdata from test_vasp_poscar_dump import myfilecmp +from dpdata.abacus.scf import parse_stru_pos + class TestStruDump(unittest.TestCase): def setUp(self): self.system_ch4 = dpdata.System("abacus.scf/STRU.ch4", fmt="stru") + def tearDown(self): + if os.path.isfile("STRU_tmp"): + os.remove("STRU_tmp") + def test_dump_stru(self): self.system_ch4.to( "stru", @@ -22,9 +29,157 @@ def test_dump_stru(self): ) myfilecmp(self, "abacus.scf/stru_test", "STRU_tmp") - def tearDown(self): - if os.path.isfile("STRU_tmp"): - os.remove("STRU_tmp") + def test_dumpStruLinkFile(self): + os.makedirs("abacus.scf/tmp", exist_ok=True) + self.system_ch4.to( + "stru", + "abacus.scf/tmp/STRU_tmp", + mass=[12, 1], + pp_file=["abacus.scf/C.upf", "abacus.scf/H.upf"], + numerical_orbital=["abacus.scf/C.orb", "abacus.scf/H.orb"], + numerical_descriptor="abacus.scf/jle.orb", + link_file=True, + ) + myfilecmp(self, "abacus.scf/stru_test", "abacus.scf/tmp/STRU_tmp") + + self.assertTrue(os.path.islink("abacus.scf/tmp/C.upf")) + self.assertTrue(os.path.islink("abacus.scf/tmp/H.upf")) + self.assertTrue(os.path.islink("abacus.scf/tmp/C.orb")) + self.assertTrue(os.path.islink("abacus.scf/tmp/H.orb")) + self.assertTrue(os.path.islink("abacus.scf/tmp/jle.orb")) + + if os.path.isdir("abacus.scf/tmp"): + shutil.rmtree("abacus.scf/tmp") + + def test_dump_spinconstrain(self): + self.system_ch4.to( + "stru", + "STRU_tmp", + mass=[12, 1], + pp_file={"C": "C.upf", "H": "H.upf"}, + numerical_orbital={"C": "C.orb", "H": "H.orb"}, + mag=[4, [1, 1, 1], 1, 1, 1], + sc=[True, True, [True, False, True], False, True], + move=[1, 1, 1, 0, 0], + angle1=[None, None, 100, 90, 80], + angle2=[100, 90, 80, 70, None], + lambda_=[[0.1, 0.2, 0.3], [0.4, 0.5, 0.6], [0.7, 0.8, 0.9], None, None], + ) + + assert os.path.isfile("STRU_tmp") + with open("STRU_tmp") as f: + c = f.read() + + with open("abacus.scf/stru.ref") as f: + stru_ref = f.read() + assert c == stru_ref + + def test_dump_spin(self): + sys_tmp = dpdata.System("abacus.scf/stru.ref", fmt="stru") + sys_tmp.data["spins"] = [ + [[1, 2, 3], [4, 5, 6], [1, 1, 1], [2, 2, 2], [3, 3, 3]] + ] + sys_tmp.to( + "stru", + "STRU_tmp", + mass=[12, 1], + pp_file=["C.upf", "H.upf"], + numerical_orbital=["C.orb", "H.orb"], + ) + assert os.path.isfile("STRU_tmp") + with open("STRU_tmp") as f: + c = f.read() + stru_ref = """C +0.0 +1 +5.192682633809 4.557725978258 4.436846615358 1 1 1 mag 1.000000000000 2.000000000000 3.000000000000 +H +0.0 +4 +5.416431453540 4.011298860305 3.511161492417 1 1 1 mag 4.000000000000 5.000000000000 6.000000000000 +4.131588222365 4.706745191323 4.431136645083 1 1 1 mag 1.000000000000 1.000000000000 1.000000000000 +5.630930319126 5.521640894956 4.450356541303 1 1 1 mag 2.000000000000 2.000000000000 2.000000000000 +5.499851012568 4.003388899277 5.342621842622 1 1 1 mag 3.000000000000 3.000000000000 3.000000000000 +""" + self.assertTrue(stru_ref in c) + + +class TestABACUSParseStru(unittest.TestCase): + def test_parse_stru_post(self): + pos, move, velocity, magmom, angle1, angle2, constrain, lambda1 = ( + parse_stru_pos( + "1.0 2.0 3.0 1 1 1 mag 1.0 2.0 3.0 v 1 1 1 angle1 100 angle2 90 sc 1 0 1 lambda 0.1 0.2 0.3" + ) + ) + self.assertEqual(pos, [1.0, 2.0, 3.0]) + self.assertEqual(move, [1, 1, 1]) + self.assertEqual(velocity, [1.0, 1.0, 1.0]) + self.assertEqual(magmom, [1.0, 2.0, 3.0]) + self.assertEqual(angle1, 100) + self.assertEqual(angle2, 90) + self.assertEqual(constrain, [1, 0, 1]) + self.assertEqual(lambda1, [0.1, 0.2, 0.3]) + + pos, move, velocity, magmom, angle1, angle2, constrain, lambda1 = ( + parse_stru_pos("1 2 3 mag 1 sc 1 lambda 0.1") + ) + self.assertEqual(pos, [1, 2, 3]) + self.assertEqual(move, None) + self.assertEqual(velocity, None) + self.assertEqual(magmom, 1.0) + self.assertEqual(angle1, None) + self.assertEqual(angle2, None) + self.assertEqual(constrain, 1) + self.assertEqual(lambda1, 0.1) + + def test_parse_stru_error(self): + line = "1.0 2.0 3.0 1 1" + self.assertRaises(RuntimeError, parse_stru_pos, line), line + + line = "1.0 2.0 3.0 1 1 1 mag 1.0 3.0 v 1 1 1" + self.assertRaises(RuntimeError, parse_stru_pos, line), line + + line = "1.0 2.0 3.0 1 1 1 mag 1 2 3 4" + self.assertRaises(RuntimeError, parse_stru_pos, line), line + + line = "1.0 2.0 3.0 1 1 1 v 1" + self.assertRaises(RuntimeError, parse_stru_pos, line), line + + line = "1.0 2.0 3.0 1 1 1 v 1 1" + self.assertRaises(RuntimeError, parse_stru_pos, line), line + + line = "1.0 2.0 3.0 1 1 1 v 1 1 1 1" + self.assertRaises(RuntimeError, parse_stru_pos, line), line + + line = "1.0 2.0 3.0 1 1 1 1" + self.assertRaises(RuntimeError, parse_stru_pos, line), line + + line = "1.0 2.0 3.0 1 1 1 angle1 " + self.assertRaises(RuntimeError, parse_stru_pos, line), line + + line = "1.0 2.0 3.0 1 1 1 angle1 1 2" + self.assertRaises(RuntimeError, parse_stru_pos, line), line + + line = "1.0 2.0 3.0 1 1 1 angle2" + self.assertRaises(RuntimeError, parse_stru_pos, line), line + + line = "1.0 2.0 3.0 angle2 1 2" + self.assertRaises(RuntimeError, parse_stru_pos, line), line + + line = "1.0 2.0 3.0 sc" + self.assertRaises(RuntimeError, parse_stru_pos, line), line + + line = "1.0 2.0 3.0 sc 1 2" + self.assertRaises(RuntimeError, parse_stru_pos, line), line + + line = "1.0 2.0 3.0 lambda" + self.assertRaises(RuntimeError, parse_stru_pos, line), line + + line = "1.0 2.0 3.0 lambda 1 2" + self.assertRaises(RuntimeError, parse_stru_pos, line), line + + line = "1.0 2.0 3.0 lambda 1 2 3 4" + self.assertRaises(RuntimeError, parse_stru_pos, line), line if __name__ == "__main__":