diff --git a/.github/workflows/pub-pypi.yml b/.github/workflows/pub-pypi.yml new file mode 100644 index 000000000..a276f85be --- /dev/null +++ b/.github/workflows/pub-pypi.yml @@ -0,0 +1,39 @@ +name: Publish Python distributions to PyPI + +on: push + +jobs: + build-n-publish: + if: github.repository_owner == 'deepmodeling' + name: Build and publish Python distributions to PyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + + - name: Set up Python 3.9 + uses: actions/setup-python@master + with: + python-version: 3.9 + + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + . + + - name: Publish distribution to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_API_TOKEN }} + diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e242eb6fd..a480eb458 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,16 +15,15 @@ jobs: - uses: actions/checkout@v2 # set up conda - name: Set up Python ${{ matrix.python-version }} - uses: conda-incubator/setup-miniconda@v2 + uses: actions/setup-python@v4 with: - auto-activate-base: true - activate-environment: "" + python-version: ${{ matrix.python-version }} # install rdkit and openbabel - name: Install rdkit - run: conda create -c conda-forge -n my-rdkit-env python=${{ matrix.python-version }} rdkit openbabel; + run: python -m pip install rdkit openbabel-wheel - name: Install dependencies - run: source $CONDA/bin/activate my-rdkit-env && pip install .[amber,ase,pymatgen] coverage codecov + run: python -m pip install .[amber,ase,pymatgen] coverage codecov - name: Test - run: source $CONDA/bin/activate my-rdkit-env && cd tests && coverage run --source=../dpdata -m unittest && cd .. && coverage combine tests/.coverage && coverage report + run: cd tests && coverage run --source=../dpdata -m unittest && cd .. && coverage combine tests/.coverage && coverage report - name: Run codecov - run: source $CONDA/bin/activate my-rdkit-env && codecov + run: codecov diff --git a/README.md b/README.md index 3295bff03..5d8214b27 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,7 @@ The `System` or `LabeledSystem` can be constructed from the following file forma | Gromacs | gro | True | False | System | 'gromacs/gro' | | ABACUS | STRU | False | True | LabeledSystem | 'abacus/scf' | | ABACUS | cif | True | True | LabeledSystem | 'abacus/md' | +| ABACUS | STRU | True | True | LabeledSystem | 'abacus/relax' | | ase | structure | True | True | MultiSystems | 'ase/structure' | diff --git a/docs/cli.rst b/docs/cli.rst new file mode 100644 index 000000000..ebcf19e62 --- /dev/null +++ b/docs/cli.rst @@ -0,0 +1,7 @@ +Command line interface +====================== + +.. argparse:: + :module: dpdata.cli + :func: dpdata_parser + :prog: dpdata diff --git a/docs/conf.py b/docs/conf.py index d82fa6a48..7931ff700 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -48,6 +48,7 @@ 'sphinx.ext.intersphinx', 'numpydoc', 'm2r2', + 'sphinxarg.ext', ] # Add any paths that contain templates here, relative to this directory. diff --git a/docs/index.rst b/docs/index.rst index 85e837169..64d9183af 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -10,6 +10,7 @@ Welcome to dpdata's documentation! :maxdepth: 2 :caption: Contents: + cli formats api/api diff --git a/dpdata/abacus/relax.py b/dpdata/abacus/relax.py new file mode 100644 index 000000000..3b334ab92 --- /dev/null +++ b/dpdata/abacus/relax.py @@ -0,0 +1,139 @@ +import os,sys +import numpy as np +from .scf import bohr2ang, kbar2evperang3, get_geometry_in, get_cell, get_coords + +# Read in geometries from an ABACUS RELAX(CELL-RELAX) trajectory in OUT.XXXX/runnning_relax/cell-relax.log. + +def get_log_file(fname, inlines): + suffix = "ABACUS" + calculation = "scf" + for line in inlines: + if "suffix" in line and "suffix"==line.split()[0]: + suffix = line.split()[1] + elif "calculation" in line and "calculation" == line.split()[0]: + calculation = line.split()[1] + logf = os.path.join(fname, "OUT.%s/running_%s.log"%(suffix,calculation)) + return logf + +def get_coords_from_log(loglines,natoms): + ''' + NOTICE: unit of coords and cells is Angstrom + ''' + natoms_log = 0 + for line in loglines: + if line[13:41] == "number of atom for this type": + natoms_log += int(line.split()[-1]) + + assert(natoms_log>0 and natoms_log == natoms),"ERROR: detected atom number in log file is %d" % natoms + + energy = [] + cells = [] + coords = [] + force = [] + stress = [] + + for i in range(len(loglines)): + line = loglines[i] + if line[18:41] == "lattice constant (Bohr)": + a0 = float(line.split()[-1]) + elif len(loglines[i].split()) >=2 and loglines[i].split()[1] == 'COORDINATES': + coords.append([]) + direct_coord = False + if loglines[i].split()[0] == 'DIRECT': + direct_coord = True + for k in range(2,2+natoms): + coords[-1].append(list(map(lambda x: float(x),loglines[i+k].split()[1:4]))) + elif loglines[i].split()[0] == 'CARTESIAN': + for k in range(2,2+natoms): + coords[-1].append(list(map(lambda x: float(x)*a0,loglines[i+k].split()[1:4]))) + else: + assert(False),"Unrecongnized coordinate type, %s, line:%d" % (loglines[i].split()[0],i) + + converg = True + for j in range(i): + if loglines[i-j-1][1:36] == 'Ion relaxation is not converged yet': + converg = False + break + elif loglines[i-j-1][1:29] == 'Ion relaxation is converged!': + converg = True + break + + if converg: + for j in range(i+1,len(loglines)): + if loglines[j][1:56] == "Lattice vectors: (Cartesian coordinate: in unit of a_0)": + cells.append([]) + for k in range(1,4): + cells[-1].append(list(map(lambda x:float(x)*a0,loglines[j+k].split()[0:3]))) + break + else: + cells.append(cells[-1]) + + if direct_coord: + coords[-1] = coords[-1].dot(cells[-1]) + + elif line[4:15] == "TOTAL-FORCE": + force.append([]) + for j in range(5,5+natoms): + force[-1].append(list(map(lambda x:float(x),loglines[i+j].split()[1:4]))) + elif line[1:13] == "TOTAL-STRESS": + stress.append([]) + for j in range(4,7): + stress[-1].append(list(map(lambda x:float(x),loglines[i+j].split()[0:3]))) + elif line[1:14] == "final etot is": + energy.append(float(line.split()[-2])) + + assert(len(cells) == len(coords) or len(cells)+1 == len(coords)),"ERROR: detected %d coordinates and %d cells" % (len(coords),len(cells)) + if len(cells)+1 == len(coords): del(coords[-1]) + + energy = np.array(energy) + cells = np.array(cells) + coords = np.array(coords) + stress = np.array(stress) + force = np.array(force) + + cells *= bohr2ang + coords *= bohr2ang + + virial = np.zeros([len(cells), 3, 3]) + for i in range(len(cells)): + volume = np.linalg.det(cells[i, :, :].reshape([3, 3])) + virial[i] = stress[i] * kbar2evperang3 * volume + + return energy,cells,coords,force,stress,virial + +def get_frame (fname): + if type(fname) == str: + # if the input parameter is only one string, it is assumed that it is the + # base directory containing INPUT file; + path_in = os.path.join(fname, "INPUT") + else: + raise RuntimeError('invalid input') + with open(path_in, 'r') as fp: + inlines = fp.read().split('\n') + geometry_path_in = get_geometry_in(fname, inlines) # base dir of STRU + with open(geometry_path_in, 'r') as fp: + geometry_inlines = fp.read().split('\n') + celldm, cell = get_cell(geometry_inlines) + atom_names, natoms, types, coord_tmp = get_coords(celldm, cell, geometry_inlines, inlines) + + logf = get_log_file(fname, inlines) + assert(os.path.isfile(logf)),"Error: can not find %s" % logf + with open(logf) as f1: lines = f1.readlines() + + atomnumber = 0 + for i in natoms: atomnumber += i + energy,cells,coords,force,stress,virial = get_coords_from_log(lines,atomnumber) + + data = {} + data['atom_names'] = atom_names + data['atom_numbs'] = natoms + data['atom_types'] = types + data['cells'] = cells + data['coords'] = coords + data['energies'] = energy + data['forces'] = force + data['virials'] = virial + data['stress'] = stress + data['orig'] = np.zeros(3) + + return data diff --git a/dpdata/abacus/scf.py b/dpdata/abacus/scf.py index ee5208820..e6d76b635 100644 --- a/dpdata/abacus/scf.py +++ b/dpdata/abacus/scf.py @@ -33,7 +33,7 @@ def get_block (lines, keyword, skip = 0, nlines = None): def get_geometry_in(fname, inlines): geometry_path_in = os.path.join(fname, "STRU") for line in inlines: - if "atom_file" in line and "atom_file"==line.split()[0]: + if "stru_file" in line and "stru_file"==line.split()[0]: atom_file = line.split()[1] geometry_path_in = os.path.join(fname, atom_file) break @@ -148,7 +148,6 @@ def get_frame (fname): geometry_path_in = get_geometry_in(fname, inlines) path_out = get_path_out(fname, inlines) - with open(geometry_path_in, 'r') as fp: geometry_inlines = fp.read().split('\n') with open(path_out, 'r') as fp: @@ -233,7 +232,7 @@ def make_unlabeled_stru(data, frame_idx, pp_file=None, numerical_orbital=None, n for iele in range(len(data['atom_names'])): out += data['atom_names'][iele] + " " if mass is not None: - out += "%d "%mass[iele] + out += "%.3f "%mass[iele] else: out += "1 " if pp_file is not None: @@ -280,4 +279,4 @@ def make_unlabeled_stru(data, frame_idx, pp_file=None, numerical_orbital=None, n #if __name__ == "__main__": # path = "/home/lrx/work/12_ABACUS_dpgen_interface/dpdata/dpdata/tests/abacus.scf" -# data = get_frame(path) \ No newline at end of file +# data = get_frame(path) diff --git a/dpdata/amber/sqm.py b/dpdata/amber/sqm.py index 557bbd6ce..7080e43ee 100644 --- a/dpdata/amber/sqm.py +++ b/dpdata/amber/sqm.py @@ -94,12 +94,12 @@ def make_sqm_in(data, fname=None, frame_idx=0, **kwargs): ret += " verbosity=4\n" ret += " /\n" for ii in range(len(data['atom_types'])): - ret += "{:>4s}{:>6s}{:>14s}{:>14s}{:>14s}\n".format( + ret += "{:>4s}{:>6s}{:>16s}{:>16s}{:>16s}\n".format( str(atomic_numbers[ii]), str(symbols[ii]), - f"{data['coords'][frame_idx][ii, 0]:.4f}", - f"{data['coords'][frame_idx][ii, 1]:.4f}", - f"{data['coords'][frame_idx][ii, 2]:.4f}" + f"{data['coords'][frame_idx][ii, 0]:.6f}", + f"{data['coords'][frame_idx][ii, 1]:.6f}", + f"{data['coords'][frame_idx][ii, 2]:.6f}" ) if fname is not None: with open(fname, 'w') as fp: diff --git a/dpdata/cli.py b/dpdata/cli.py index eaa7c76eb..ef6eeab77 100644 --- a/dpdata/cli.py +++ b/dpdata/cli.py @@ -5,14 +5,13 @@ from .system import System, LabeledSystem, MultiSystems -def dpdata_cli(): - """dpdata cli. +def dpdata_parser() -> argparse.ArgumentParser: + """Returns dpdata cli parser. - Examples - -------- - .. code-block:: bash - - $ dpdata -iposcar POSCAR -odeepmd/npy -O data -n + Returns + ------- + argparse.ArgumentParser + dpdata cli parser """ parser = argparse.ArgumentParser( description="dpdata: Manipulating multiple atomic simulation data formats", @@ -28,7 +27,19 @@ def dpdata_cli(): parser.add_argument("--type-map", "-t", type=str, nargs="+", help="type map") parser.add_argument('--version', action='version', version='dpdata v%s' % __version__) + return parser + +def dpdata_cli(): + """dpdata cli. + + Examples + -------- + .. code-block:: bash + + $ dpdata -iposcar POSCAR -odeepmd/npy -O data -n + """ + parser = dpdata_parser() parsed_args = parser.parse_args() convert(**vars(parsed_args)) diff --git a/dpdata/cp2k/output.py b/dpdata/cp2k/output.py index 31b29feb6..f91d86045 100644 --- a/dpdata/cp2k/output.py +++ b/dpdata/cp2k/output.py @@ -120,7 +120,22 @@ def handle_single_log_frame(self, lines): print_level_flag = 0 atomic_kinds_pattern = re.compile(r'\s+\d+\. Atomic kind:\s+(?P\S+)') atomic_kinds = [] + stress_sign = 'STRESS' + stress_flag = 0 + stress = [] + for line in lines: + if stress_flag == 3 : + if (line == '\n') : + stress_flag = 0 + else : + stress.append(line.split()[1:4]) + if stress_flag == 2 : + stress_flag = 3 + if stress_flag == 1 : + stress_flag = 2 + if (stress_sign in line): + stress_flag = 1 if force_start_pattern.match(line): force_flag=True if force_end_pattern.match(line): @@ -214,7 +229,18 @@ def handle_single_log_frame(self, lines): #atom_names=list(element_dict.keys()) atom_names=self.atomic_kinds atom_numbs=[] - + + GPa = PressureConversion("eV/angstrom^3", "GPa").value() + if stress: + stress = np.array(stress) + stress = stress.astype('float32') + stress = stress[np.newaxis, :, :] + # stress to virial conversion, default unit in cp2k is GPa + # note the stress is virial = stress * volume + virial = stress * np.linalg.det(self.cell)/GPa + virial = virial.squeeze() + else: + virial = None for ii in element_dict.keys(): atom_numbs.append(element_dict[ii][1]) #print(atom_numbs) @@ -225,6 +251,8 @@ def handle_single_log_frame(self, lines): info_dict['cells'] = np.asarray([self.cell]).astype('float32') info_dict['energies'] = np.asarray([energy]).astype('float32') info_dict['forces'] = np.asarray([forces_list]).astype('float32') + if(virial is not None ): + info_dict['virials'] = np.asarray([virial]).astype('float32') return info_dict def handle_single_xyz_frame(self, lines): diff --git a/dpdata/gaussian/gjf.py b/dpdata/gaussian/gjf.py new file mode 100644 index 000000000..588f1ed67 --- /dev/null +++ b/dpdata/gaussian/gjf.py @@ -0,0 +1,239 @@ +# The initial code of this file is based on +# https://github.com/deepmodeling/dpgen/blob/0767dce7cad29367edb2e4a55fd0d8724dbda642/dpgen/generator/lib/gaussian.py#L1-L190 +# under LGPL 3.0 license +"""Generate Gaussian input file.""" + +from typing import List, Tuple, Union +import uuid +import itertools +import warnings +import numpy as np +from scipy.sparse import csr_matrix +from scipy.sparse.csgraph import connected_components +try: + from openbabel import openbabel +except ImportError: + try: + import openbabel + except ImportError: + openbabel = None +from dpdata.periodic_table import Element + + + +def _crd2frag(symbols: List[str], crds: np.ndarray) -> Tuple[int, List[int]]: + """Detect fragments from coordinates. + + Parameters + ---------- + symbols : list[str] + element symbols; virtual elements are not supported + crds : np.ndarray + atomic coordinates, shape: (N, 3) + + Returns + ------- + frag_numb : int + number of fragments + frag_index : list[int] + frament index that each atom belongs to + + Notes + ----- + In this method, Open Babel is used to detect bond connectivity. The threshold + is the sum of covalent radii with a slight tolerance (0.45 A). Note that + this threshold has errors. + + PBC support is removed from this method as Gaussian does not support PBC calculation. + + Raises + ------ + ImportError + if Open Babel is not installed + """ + if openbabel is None: + raise ImportError("Open Babel (Python interface) should be installed to detect fragmentation!") + atomnumber = len(symbols) + # Use openbabel to connect atoms + mol = openbabel.OBMol() + mol.BeginModify() + for idx, (symbol, position) in enumerate(zip(symbols, crds.astype(np.float64))): + num = Element(symbol).Z + atom = mol.NewAtom(idx) + atom.SetAtomicNum(int(num)) + atom.SetVector(*position) + mol.ConnectTheDots() + mol.PerceiveBondOrders() + mol.EndModify() + bonds = [] + for ii in range(mol.NumBonds()): + bond = mol.GetBond(ii) + a = bond.GetBeginAtom().GetId() + b = bond.GetEndAtom().GetId() + bo = bond.GetBondOrder() + bonds.extend([[a, b, bo], [b, a, bo]]) + bonds = np.array(bonds, ndmin=2).reshape((-1, 3)) + graph = csr_matrix( + (bonds[:, 2], (bonds[:, 0], bonds[:, 1])), shape=(atomnumber, atomnumber)) + frag_numb, frag_index = connected_components(graph, 0) + return frag_numb, frag_index + + +def detect_multiplicity(symbols: np.ndarray) -> int: + """Find the minimal multiplicity of the given molecules. + + Parameters + ---------- + symbols : np.ndarray + element symbols; virtual elements are not supported + + Returns + ------- + int + spin multiplicity + """ + # currently only support charge=0 + # oxygen -> 3 + if np.count_nonzero(symbols == ["O"]) == 2 and symbols.size == 2: + return 3 + # calculates the total number of electrons, assumes they are paired as much as possible + n_total = sum([Element(s).Z for s in symbols]) + return n_total % 2 + 1 + + +def make_gaussian_input( + sys_data: dict, + keywords: Union[str, List[str]], + multiplicity: Union[str ,int] = "auto", + charge: int = 0, + fragment_guesses: bool = False, + basis_set: str = None, + keywords_high_multiplicity: str = None, + nproc: int = 1, + ) -> str: + """Make gaussian input file. + + Parameters + ---------- + sys_data : dict + system data + keywords : str or list[str] + Gaussian keywords, e.g. force b3lyp/6-31g**. If a list, + run multiple steps + multiplicity : str or int, default=auto + spin multiplicity state. It can be a number. If auto, + multiplicity will be detected automatically, with the + following rules: + fragment_guesses=True + multiplicity will +1 for each radical, and +2 + for each oxygen molecule + fragment_guesses=False + multiplicity will be 1 or 2, but +2 for each + oxygen molecule + charge : int, default=0 + molecule charge. Only used when charge is not provided + by the system + fragment_guesses : bool, default=False + initial guess generated from fragment guesses. If True, + multiplicity should be auto + basis_set : str, default=None + custom basis set + keywords_high_multiplicity : str, default=None + keywords for points with multiple raicals. multiplicity + should be auto. If not set, fallback to normal keywords + nproc : int, default=1 + Number of CPUs to use + + Returns + ------- + str + gjf output string + """ + coordinates = sys_data['coords'][0] + atom_names = sys_data['atom_names'] + atom_numbs = sys_data['atom_numbs'] + atom_types = sys_data['atom_types'] + # get atom symbols list + symbols = [atom_names[atom_type] for atom_type in atom_types] + + # assume default charge is zero and default spin multiplicity is 1 + if 'charge' in sys_data.keys(): + charge = sys_data['charge'] + + use_fragment_guesses = False + if isinstance(multiplicity, int): + mult_auto = False + elif multiplicity == 'auto': + mult_auto = True + else: + raise RuntimeError('The keyword "multiplicity" is illegal.') + + if fragment_guesses: + # Initial guess generated from fragment guesses + # New feature of Gaussian 16 + use_fragment_guesses = True + if not mult_auto: + warnings.warn("Automatically set multiplicity to auto!") + mult_auto = True + + if mult_auto: + frag_numb, frag_index = _crd2frag(symbols, coordinates) + if frag_numb == 1: + use_fragment_guesses = False + mult_frags = [] + for i in range(frag_numb): + idx = frag_index == i + mult_frags.append(detect_multiplicity(np.array(symbols)[idx])) + if use_fragment_guesses: + multiplicity = sum(mult_frags) - frag_numb + 1 - charge % 2 + chargekeywords_frag = "%d %d" % (charge, multiplicity) + \ + ''.join([' %d %d' % (charge, mult_frag) + for mult_frag in mult_frags]) + else: + multi_frags = np.array(mult_frags) + multiplicity = 1 + \ + np.count_nonzero(multi_frags == 2) % 2 + \ + np.count_nonzero(multi_frags == 3) * 2 - charge % 2 + + if keywords_high_multiplicity is not None and np.count_nonzero(multi_frags == 2) >= 2: + # at least 2 radicals + keywords = keywords_high_multiplicity + + if isinstance(keywords, str): + keywords = [keywords] + else: + keywords = keywords.copy() + + buff = [] + # keywords, e.g., force b3lyp/6-31g** + if use_fragment_guesses: + keywords[0] = '{} guess=fragment={}'.format( + keywords[0], frag_numb) + + chkkeywords = [] + if len(keywords)>1: + chkkeywords.append('%chk={}.chk'.format(str(uuid.uuid1()))) + + nprockeywords = '%nproc={:d}'.format(nproc) + # use formula as title + titlekeywords = ''.join(["{}{}".format(symbol,numb) for symbol,numb in + zip(atom_names, atom_numbs)]) + chargekeywords = '{} {}'.format(charge, multiplicity) + + buff = [*chkkeywords, nprockeywords, '#{}'.format( + keywords[0]), '', titlekeywords, '', (chargekeywords_frag if use_fragment_guesses else chargekeywords)] + + for ii, (symbol, coordinate) in enumerate(zip(symbols, coordinates)): + if use_fragment_guesses: + buff.append("%s(Fragment=%d) %f %f %f" % + (symbol, frag_index[ii] + 1, *coordinate)) + else: + buff.append("%s %f %f %f" % (symbol, *coordinate)) + if basis_set is not None: + # custom basis set + buff.extend(['', basis_set, '']) + for kw in itertools.islice(keywords, 1, None): + buff.extend(['\n--link1--', *chkkeywords, nprockeywords, + '#{}'.format(kw), '', titlekeywords, '', chargekeywords, '']) + buff.append('\n') + return '\n'.join(buff) diff --git a/dpdata/plugins/abacus.py b/dpdata/plugins/abacus.py index e4e1c291e..c219053b7 100644 --- a/dpdata/plugins/abacus.py +++ b/dpdata/plugins/abacus.py @@ -1,5 +1,6 @@ import dpdata.abacus.scf import dpdata.abacus.md +import dpdata.abacus.relax from dpdata.format import Format @Format.register("abacus/stru") @@ -51,3 +52,11 @@ class AbacusMDFormat(Format): #@Format.post("rot_lower_triangular") def from_labeled_system(self, file_name, **kwargs): return dpdata.abacus.md.get_frame(file_name) + +@Format.register("abacus/relax") +@Format.register("abacus/pw/relax") +@Format.register("abacus/lcao/relax") +class AbacusRelaxFormat(Format): + #@Format.post("rot_lower_triangular") + def from_labeled_system(self, file_name, **kwargs): + return dpdata.abacus.relax.get_frame(file_name) diff --git a/dpdata/plugins/dftbplus.py b/dpdata/plugins/dftbplus.py new file mode 100644 index 000000000..e69de29bb diff --git a/dpdata/plugins/gaussian.py b/dpdata/plugins/gaussian.py index 96e0993e3..f49dbf054 100644 --- a/dpdata/plugins/gaussian.py +++ b/dpdata/plugins/gaussian.py @@ -1,5 +1,11 @@ +import os +import tempfile +import subprocess as sp + import dpdata.gaussian.log +import dpdata.gaussian.gjf from dpdata.format import Format +from dpdata.driver import Driver @Format.register("gaussian/log") @@ -19,3 +25,81 @@ def from_labeled_system(self, file_name, md=False, **kwargs): class GaussianMDFormat(Format): def from_labeled_system(self, file_name, **kwargs): return GaussianLogFormat().from_labeled_system(file_name, md=True) + + +@Format.register("gaussian/gjf") +class GaussiaGJFFormat(Format): + """Gaussian input file""" + def to_system(self, data: dict, file_name: str, **kwargs): + """Generate Gaussian input file. + + Parameters + ---------- + data : dict + system data + file_name : str + file name + **kwargs : dict + Other parameters to make input files. See :meth:`dpdata.gaussian.gjf.make_gaussian_input` + """ + text = dpdata.gaussian.gjf.make_gaussian_input(data, **kwargs) + with open(file_name, 'w') as fp: + fp.write(text) + + +@Driver.register("gaussian") +class GaussianDriver(Driver): + """Gaussian driver. + + Note that "force" keyword must be added. If the number of atoms is large, + "Geom=PrintInputOrient" should be added. + + Parameters + ---------- + gaussian_exec : str, default=g16 + path to gaussian program + **kwargs : dict + other arguments to make input files. See :class:`SQMINFormat` + + Examples + -------- + Use B3LYP method to calculate potential energy of a methane molecule: + + >>> labeled_system = system.predict(keywords="force b3lyp/6-31g**", driver="gaussian") + >>> labeled_system['energies'][0] + -1102.714590995794 + """ + def __init__(self, gaussian_exec: str="g16", **kwargs: dict) -> None: + self.gaussian_exec = gaussian_exec + self.kwargs = kwargs + + def label(self, data: dict) -> dict: + """Label a system data. Returns new data with energy, forces, and virials. + + Parameters + ---------- + data : dict + data with coordinates and atom types + + Returns + ------- + dict + labeled data with energies and forces + """ + ori_system = dpdata.System(data=data) + labeled_system = dpdata.LabeledSystem() + with tempfile.TemporaryDirectory() as d: + for ii, ss in enumerate(ori_system): + inp_fn = os.path.join(d, "%d.gjf" % ii) + out_fn = os.path.join(d, "%d.log" % ii) + ss.to("gaussian/gjf", inp_fn, **self.kwargs) + try: + sp.check_output([*self.gaussian_exec.split(), inp_fn]) + except sp.CalledProcessError as e: + with open(out_fn) as f: + out = f.read() + raise RuntimeError( + "Run gaussian failed! Output:\n" + out + ) from e + labeled_system.append(dpdata.LabeledSystem(out_fn, fmt="gaussian/log")) + return labeled_system.data diff --git a/dpdata/qe/traj.py b/dpdata/qe/traj.py index 49d3338dd..62b10d440 100644 --- a/dpdata/qe/traj.py +++ b/dpdata/qe/traj.py @@ -198,7 +198,16 @@ def to_system_data(input_name, prefix, begin = 0, step = 1) : begin = begin, step = step, convert = length_convert) - assert(csteps == tmp_steps), "the step key between files are not consistent" + if csteps != tmp_steps: + csteps.append(None) + tmp_steps.append(None) + for int_id in range(len(csteps)): + if csteps[int_id] != tmp_steps[int_id]: + break + step_id = begin + int_id*step + raise RuntimeError(f"the step key between files are not consistent. " + f"The difference locates at step: {step_id}, " + f".pos is {csteps[int_id]}, .cel is {tmp_steps[int_id]}") except FileNotFoundError : data['cells'] = np.tile(cell, (data['coords'].shape[0], 1, 1)) return data, csteps diff --git a/dpdata/stat.py b/dpdata/stat.py new file mode 100644 index 000000000..46d0a4a36 --- /dev/null +++ b/dpdata/stat.py @@ -0,0 +1,159 @@ +from abc import ABCMeta, abstractproperty +from functools import lru_cache + +import numpy as np + +from dpdata.system import LabeledSystem, MultiSystems + + +def mae(errors: np.ndarray) -> np.float64: + """Compute the mean absolute error (MAE). + + Parameters + ---------- + errors : np.ndarray + errors between two values + + Returns + ------- + np.float64 + mean absolute error (MAE) + """ + return np.mean(np.abs(errors)) + + +def rmse(errors: np.ndarray) -> np.float64: + """Compute the root mean squared error (RMSE). + + Parameters + ---------- + errors : np.ndarray + errors between two values + + Returns + ------- + np.float64 + root mean squared error (RMSE) + """ + return np.sqrt(np.mean(np.square(errors))) + + +class ErrorsBase(metaclass=ABCMeta): + """Compute errors (deviations) between two systems. The type of system is assigned by SYSTEM_TYPE. + + Parameters + ---------- + system_1 : object + system 1 + system_2 : object + system 2 + """ + SYSTEM_TYPE = object + + def __init__(self, system_1: SYSTEM_TYPE, system_2: SYSTEM_TYPE) -> None: + assert isinstance(system_1, self.SYSTEM_TYPE), "system_1 should be %s" % self.SYSTEM_TYPE.__name__ + assert isinstance(system_2, self.SYSTEM_TYPE), "system_2 should be %s" % self.SYSTEM_TYPE.__name__ + self.system_1 = system_1 + self.system_2 = system_2 + + @abstractproperty + def e_errors(self) -> np.ndarray: + """Energy errors.""" + + @abstractproperty + def f_errors(self) -> np.ndarray: + """Force errors.""" + + @property + def e_mae(self) -> np.float64: + """Energy MAE.""" + return mae(self.e_errors) + + @property + def e_rmse(self) -> np.float64: + """Energy RMSE.""" + return rmse(self.e_errors) + + @property + def f_mae(self) -> np.float64: + """Force MAE.""" + return mae(self.f_errors) + + @property + def f_rmse(self) -> np.float64: + """Force RMSE.""" + return rmse(self.f_errors) + + +class Errors(ErrorsBase): + """Compute errors (deviations) between two LabeledSystems. + + Parameters + ---------- + system_1 : object + system 1 + system_2 : object + system 2 + + Examples + -------- + Get errors between referenced system and predicted system: + + >>> e = dpdata.stat.Errors(system_1, system_2) + >>> print("%.4f %.4f %.4f %.4f" % (e.e_mae, e.e_rmse, e.f_mae, e.f_rmse)) + """ + SYSTEM_TYPE = LabeledSystem + + @property + @lru_cache() + def e_errors(self) -> np.ndarray: + """Energy errors.""" + return self.system_1['energies'] - self.system_2['energies'] + + @property + @lru_cache() + def f_errors(self) -> np.ndarray: + """Force errors.""" + return (self.system_1['forces'] - self.system_2['forces']).ravel() + + +class MultiErrors(ErrorsBase): + """Compute errors (deviations) between two MultiSystems. + + Parameters + ---------- + system_1 : object + system 1 + system_2 : object + system 2 + + Examples + -------- + Get errors between referenced system and predicted system: + + >>> e = dpdata.stat.MultiErrors(system_1, system_2) + >>> print("%.4f %.4f %.4f %.4f" % (e.e_mae, e.e_rmse, e.f_mae, e.f_rmse)) + """ + SYSTEM_TYPE = MultiSystems + + @property + @lru_cache() + def e_errors(self) -> np.ndarray: + """Energy errors.""" + errors = [] + for nn in self.system_1.systems.keys(): + ss1 = self.system_1[nn] + ss2 = self.system_2[nn] + errors.append(Errors(ss1, ss2).e_errors.ravel()) + return np.concatenate(errors) + + @property + @lru_cache() + def f_errors(self) -> np.ndarray: + """Force errors.""" + errors = [] + for nn in self.system_1.systems.keys(): + ss1 = self.system_1[nn] + ss2 = self.system_2[nn] + errors.append(Errors(ss1, ss2).f_errors.ravel()) + return np.concatenate(errors) diff --git a/dpdata/system.py b/dpdata/system.py index 12f839e86..3c9ccec8c 100644 --- a/dpdata/system.py +++ b/dpdata/system.py @@ -195,7 +195,8 @@ def __init__ (self, - ``qe/cp/traj``: Quantum Espresso CP trajectory files. should have: file_name+'.in' and file_name+'.pos' - ``qe/pw/scf``: Quantum Espresso PW single point calculations. Both input and output files are required. If file_name is a string, it denotes the output file name. Input file name is obtained by replacing 'out' by 'in' from file_name. Or file_name is a list, with the first element being the input file name and the second element being the output filename. - ``abacus/scf``: ABACUS pw/lcao scf. The directory containing INPUT file is required. - - ``abacus/md``: ABACUS pw/lcao MD. The directory containing INPUT file is required. + - ``abacus/md``: ABACUS pw/lcao MD. The directory containing INPUT file is required. + - ``abacus/relax``: ABACUS pw/lcao relax or cell-relax. The directory containing INPUT file is required. - ``siesta/output``: siesta SCF output file - ``siesta/aimd_output``: siesta aimd output file - ``pwmat/atom.config``: pwmat atom.config @@ -1294,6 +1295,45 @@ def pick_atom_idx(self, idx, nopbc=None): new_sys.append(ss.pick_atom_idx(idx, nopbc=nopbc)) return new_sys + def correction(self, hl_sys: "MultiSystems"): + """Get energy and force correction between self (assumed low-level) and a high-level MultiSystems. + The self's coordinates will be kept, but energy and forces will be replaced by + the correction between these two systems. + + Notes + ----- + This method will not check whether coordinates and elements of two systems + are the same. The user should make sure by itself. + + Parameters + ---------- + hl_sys : MultiSystems + high-level MultiSystems + + Returns + ------- + corrected_sys : MultiSystems + Corrected MultiSystems + + Examples + -------- + Get correction between a low-level system and a high-level system: + + >>> low_level = dpdata.MultiSystems().from_deepmd_hdf5("low_level.hdf5") + >>> high_level = dpdata.MultiSystems().from_deepmd_hdf5("high_level.hdf5") + >>> corr = low_level.correction(high_lebel) + >>> corr.to_deepmd_hdf5("corr.hdf5") + """ + if not isinstance(hl_sys, MultiSystems): + raise RuntimeError("high_sys should be MultiSystems") + corrected_sys = MultiSystems(type_map=self.atom_names) + for nn in self.systems.keys(): + ll_ss = self[nn] + hl_ss = hl_sys[nn] + corrected_sys.append(ll_ss.correction(hl_ss)) + return corrected_sys + + def get_cls_name(cls: object) -> str: """Returns the fully qualified name of a class, such as `np.ndarray`. diff --git a/setup.py b/setup.py index a0ee7c336..d04124ab5 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ 'ase': ['ase'], 'amber': ['parmed'], 'pymatgen': ['pymatgen'], - 'docs': ['sphinx', 'recommonmark', 'sphinx_rtd_theme>=1.0.0rc1', 'numpydoc', 'm2r2', 'deepmodeling-sphinx'], + 'docs': ['sphinx', 'recommonmark', 'sphinx_rtd_theme>=1.0.0rc1', 'numpydoc', 'm2r2', 'deepmodeling-sphinx', 'sphinx-argparse'], }, entry_points={"console_scripts": ["dpdata = dpdata.cli:dpdata_cli"]}, ) diff --git a/tests/abacus.relax/INPUT b/tests/abacus.relax/INPUT new file mode 100644 index 000000000..46ab55eac --- /dev/null +++ b/tests/abacus.relax/INPUT @@ -0,0 +1,29 @@ +INPUT_PARAMETERS +#Parameters (1.General) +suffix abacus +calculation cell-relax +ntype 2 +nbands 6 +symmetry 1 + +#Parameters (2.Iteration) +ecutwfc 50 +scf_thr 1e-7 +scf_nmax 50 + +relax_nmax 5 + +#Parameters (3.Basis) +basis_type pw + +#Parameters (4.Smearing) +smearing_method gaussian +smearing_sigma 0.02 + +#Parameters (5.Mixing) +mixing_type pulay +mixing_beta 0.4 + +#Parameters (6.Deepks) +cal_force 1 +cal_stress 1 diff --git a/tests/abacus.relax/KPT b/tests/abacus.relax/KPT new file mode 100644 index 000000000..c289c0158 --- /dev/null +++ b/tests/abacus.relax/KPT @@ -0,0 +1,4 @@ +K_POINTS +0 +Gamma +1 1 1 0 0 0 diff --git a/tests/abacus.relax/OUT.abacus/INPUT b/tests/abacus.relax/OUT.abacus/INPUT new file mode 100644 index 000000000..88e098762 --- /dev/null +++ b/tests/abacus.relax/OUT.abacus/INPUT @@ -0,0 +1,250 @@ +INPUT_PARAMETERS +#Parameters (1.General) +suffix abacus #the name of main output directory +latname test #the name of lattice name +stru_file STRU #the filename of file containing atom positions +kpoint_file KPT #the name of file containing k points +pseudo_dir #the directory containing pseudo files +orbital_dir #the directory containing orbital files +pseudo_type auto #the type pseudo files +pseudo_rcut 15 #cut-off radius for radial integration +pseudo_mesh 0 #0: use our own mesh to do radial renormalization; 1: use mesh as in QE +lmaxmax 2 #maximum of l channels used +dft_functional default #exchange correlation functional +calculation cell-relax #test; scf; relax; nscf; ienvelope; istate; sto-scf; sto-md +ntype 2 #atom species number +nspin 1 #1: single spin; 2: up and down spin; 4: noncollinear spin +kspacing 0 #unit in 1/bohr, should be > 0, default is 0 which means read KPT file +nbands 6 #number of bands +nbands_sto 256 #number of stochastic bands +nbands_istate 5 #number of bands around Fermi level for istate calulation +nche_sto 100 #number of orders for Chebyshev expansion in stochastic DFT +symmetry 1 #turn symmetry on or off +init_vel 0 #read velocity from STRU or not +symmetry_prec 1e-05 #accuracy for symmetry +nelec 0 #input number of electrons +tot_magnetization 0 #total magnetization of the system +out_mul 0 # mulliken charge or not +noncolin 0 #using non-collinear-spin +lspinorb 0 #consider the spin-orbit interaction +kpar 1 #devide all processors into kpar groups and k points will be distributed among each group +bndpar 1 #devide all processors into bndpar groups and bands will be distributed among each group + +#Parameters (2.PW) +ecutwfc 50 ##energy cutoff for wave functions +pw_diag_nmax 50 #max iteration number for cg +diago_cg_prec 1 #diago_cg_prec +pw_diag_thr 0.01 #threshold for eigenvalues is cg electron iterations +scf_thr 1e-07 #charge density error +init_wfc atomic #start wave functions are from 'atomic', 'atomic+random', 'random' or 'file' +init_chg atomic #start charge is from 'atomic' or file +chg_extrap atomic #atomic; first-order; second-order; dm:coefficients of SIA +out_chg 0 #>0 output charge density for selected electron steps +out_pot 0 #output realspace potential +out_wfc_pw 0 #output wave functions +out_wfc_r 0 #output wave functions in realspace +out_dos 0 #output energy and dos +out_band 0 #output energy and band structure +out_proj_band 0 #output projected band structure +restart_save 0 #print to disk every step for restart +restart_load 0 #restart from disk +read_file_dir auto #directory of files for reading +nx 0 #number of points along x axis for FFT grid +ny 0 #number of points along y axis for FFT grid +nz 0 #number of points along z axis for FFT grid +cell_factor 1.2 #used in the construction of the pseudopotential tables + +#Parameters (3.Stochastic DFT) +method_sto 1 #1: slow and save memory, 2: fast and waste memory +nbands_sto 256 #number of stochstic orbitals +nche_sto 100 #Chebyshev expansion orders +emin_sto 0 #trial energy to guess the lower bound of eigen energies of the Hamitonian operator +emax_sto 0 #trial energy to guess the upper bound of eigen energies of the Hamitonian operator +seed_sto 0 #the random seed to generate stochastic orbitals +initsto_freq 1000 #frequency to generate new stochastic orbitals when running md + +#Parameters (4.Relaxation) +ks_solver cg #cg; dav; lapack; genelpa; hpseps; scalapack_gvx; cusolver +scf_nmax 50 ##number of electron iterations +out_force 0 #output the out_force or not +relax_nmax 5 #number of ion iteration steps +out_stru 0 #output the structure files after each ion step +force_thr 0.001 #force threshold, unit: Ry/Bohr +force_thr_ev 0.0257112 #force threshold, unit: eV/Angstrom +force_thr_ev2 0 #force invalid threshold, unit: eV/Angstrom +relax_cg_thr 0.5 #threshold for switching from cg to bfgs, unit: eV/Angstrom +stress_thr 0.01 #stress threshold +press1 0 #target pressure, unit: KBar +press2 0 #target pressure, unit: KBar +press3 0 #target pressure, unit: KBar +relax_bfgs_w1 0.01 #wolfe condition 1 for bfgs +relax_bfgs_w2 0.5 #wolfe condition 2 for bfgs +relax_bfgs_rmax 0.8 #maximal trust radius, unit: Bohr +relax_bfgs_rmin 1e-05 #minimal trust radius, unit: Bohr +relax_bfgs_init 0.5 #initial trust radius, unit: Bohr +cal_stress 1 #calculate the stress or not +fixed_axes None #which axes are fixed +relax_method cg #bfgs; sd; cg; cg_bfgs; +out_level ie #ie(for electrons); i(for ions); +out_dm 0 #>0 output density matrix +deepks_out_labels 0 #>0 compute descriptor for deepks +deepks_scf 0 #>0 add V_delta to Hamiltonian +deepks_bandgap 0 #>0 for bandgap label +deepks_out_unittest 0 #if set 1, prints intermediate quantities that shall be used for making unit test +deepks_model #file dir of traced pytorch model: 'model.ptg +deepks_descriptor_lmax2 #lmax used in generating descriptor +deepks_descriptor_rcut0 #rcut used in generating descriptor +deepks_descriptor_ecut0 #ecut used in generating descriptor + +#Parameters (5.LCAO) +basis_type pw #PW; LCAO in pw; LCAO +search_radius -1 #input search radius (Bohr) +search_pbc 1 #input periodic boundary condition +lcao_ecut 0 #energy cutoff for LCAO +lcao_dk 0.01 #delta k for 1D integration in LCAO +lcao_dr 0.01 #delta r for 1D integration in LCAO +lcao_rmax 30 #max R for 1D two-center integration table +out_mat_hs 0 #output H and S matrix +out_mat_hs2 0 #output H(R) and S(R) matrix +out_mat_r 0 #output r(R) matrix +out_wfc_lcao 0 #ouput LCAO wave functions +bx 1 #division of an element grid in FFT grid along x +by 1 #division of an element grid in FFT grid along y +bz 1 #division of an element grid in FFT grid along z + +#Parameters (6.Smearing) +smearing_method gaussian #type of smearing_method: gauss; fd; fixed; mp; mp2; mv +smearing_sigma 0.02 #energy range for smearing + +#Parameters (7.Charge Mixing) +mixing_type pulay #plain; kerker; pulay; pulay-kerker; broyden +mixing_beta 0.4 #mixing parameter: 0 means no new charge +mixing_ndim 8 #mixing dimension in pulay +mixing_gg0 0 #mixing parameter in kerker + +#Parameters (8.DOS) +dos_emin_ev -15 #minimal range for dos +dos_emax_ev 15 #maximal range for dos +dos_edelta_ev 0.01 #delta energy for dos +dos_scale 0.01 #scale dos range by +dos_sigma 0.07 #gauss b coefficeinet(default=0.07) + +#Parameters (9.Molecular dynamics) +md_type 1 #choose ensemble +md_nstep 10 #md steps +md_ensolver FP #choose potential +md_dt 1 #time step +md_mnhc 4 #number of Nose-Hoover chains +md_tfirst -1 #temperature first +md_tlast -1 #temperature last +md_dumpfreq 1 #The period to dump MD information +md_restartfreq 5 #The period to output MD restart information +md_seed -1 #random seed for MD +md_restart 0 #whether restart +lj_rcut 8.5 #cutoff radius of LJ potential +lj_epsilon 0.01032 #the value of epsilon for LJ potential +lj_sigma 3.405 #the value of sigma for LJ potential +msst_direction 2 #the direction of shock wave +msst_vel 0 #the velocity of shock wave +msst_vis 0 #artificial viscosity +msst_tscale 0.01 #reduction in initial temperature +msst_qmass -1 #mass of thermostat +md_tfreq 0 #oscillation frequency, used to determine qmass of NHC +md_damp 1 #damping parameter (time units) used to add force in Langevin method + +#Parameters (10.Electric field and dipole correction) +efield_flag 0 #add electric field +dip_cor_flag 0 #dipole correction +efield_dir 2 #the direction of the electric field or dipole correction +efield_pos_max 0.5 #position of the maximum of the saw-like potential along crystal axis efield_dir +efield_pos_dec 0.1 #zone in the unit cell where the saw-like potential decreases +efield_amp 0 #amplitude of the electric field + +#Parameters (11.Test) +out_alllog 0 #output information for each processor, when parallel +nurse 0 #for coders +colour 0 #for coders, make their live colourful +t_in_h 1 #calculate the kinetic energy or not +vl_in_h 1 #calculate the local potential or not +vnl_in_h 1 #calculate the nonlocal potential or not +vh_in_h 1 #calculate the hartree potential or not +vion_in_h 1 #calculate the local ionic potential or not +test_force 0 #test the force +test_stress 0 #test the force + +#Parameters (13.vdW Correction) +vdw_method none #the method of calculating vdw (none ; d2 ; d3_0 ; d3_bj +vdw_s6 default #scale parameter of d2/d3_0/d3_bj +vdw_s8 default #scale parameter of d3_0/d3_bj +vdw_a1 default #damping parameter of d3_0/d3_bj +vdw_a2 default #damping parameter of d3_bj +vdw_d 20 #damping parameter of d2 +vdw_abc 0 #third-order term? +vdw_C6_file default #filename of C6 +vdw_C6_unit Jnm6/mol #unit of C6, Jnm6/mol or eVA6 +vdw_R0_file default #filename of R0 +vdw_R0_unit A #unit of R0, A or Bohr +vdw_model radius #expression model of periodic structure, radius or period +vdw_radius default #radius cutoff for periodic structure +vdw_radius_unit Bohr #unit of radius cutoff for periodic structure +vdw_cn_thr 40 #radius cutoff for cn +vdw_cn_thr_unit Bohr #unit of cn_thr, Bohr or Angstrom +vdw_period 3 3 3 #periods of periodic structure + +#Parameters (14.exx) +dft_functional default #no, hf, pbe0, hse or opt_orb +exx_hybrid_alpha 0.25 # +exx_hse_omega 0.11 # +exx_separate_loop 1 #0 or 1 +exx_hybrid_step 100 # +exx_lambda 0.3 # +exx_pca_threshold 0 # +exx_c_threshold 0 # +exx_v_threshold 0 # +exx_dm_threshold 0 # +exx_schwarz_threshold0 # +exx_cauchy_threshold0 # +exx_ccp_threshold 1e-08 # +exx_ccp_rmesh_times 10 # +exx_distribute_type htime #htime or kmeans1 or kmeans2 +exx_opt_orb_lmax 0 # +exx_opt_orb_ecut 0 # +exx_opt_orb_tolerence0 # + +#Parameters (16.tddft) +tddft 0 #calculate tddft or not +td_scf_thr 1e-09 #threshold for electronic iteration of tddft +td_dt 0.02 #time of ion step +td_force_dt 0.02 #time of force change +td_val_elec_01 1 #td_val_elec_01 +td_val_elec_02 1 #td_val_elec_02 +td_val_elec_03 1 #td_val_elec_03 +td_vext 0 #add extern potential or not +td_vext_dire 1 #extern potential direction +td_timescale 0.5 #extern potential td_timescale +td_vexttype 1 #extern potential type +td_vextout 0 #output extern potential or not +td_dipoleout 0 #output dipole or not +ocp 0 #change occupation or not +ocp_set none #set occupation + +#Parameters (17.berry_wannier) +berry_phase 0 #calculate berry phase or not +gdir 3 #calculate the polarization in the direction of the lattice vector +towannier90 0 #use wannier90 code interface or not +nnkpfile seedname.nnkp #the wannier90 code nnkp file name +wannier_spin up #calculate spin in wannier90 code interface + +#Parameters (18.implicit_solvation) +imp_sol 0 #calculate implicit solvation correction or not +eb_k 80 #the relative permittivity of the bulk solvent +tau 1.0798e-05 #the effective surface tension parameter +sigma_k 0.6 # the width of the diffuse cavity +nc_k 0.00037 # the cut-off charge density + +#Parameters (19.compensating_charge) +comp_chg 0 # add compensating charge +comp_q 0 # total charge of compensating charge +comp_l 1 # total length of compensating charge +comp_center 0 # center of compensating charge on dim +comp_dim 2 # dimension of compensating charge(x, y or z) diff --git a/tests/abacus.relax/OUT.abacus/STRU_ION_D b/tests/abacus.relax/OUT.abacus/STRU_ION_D new file mode 100644 index 000000000..80feeb742 --- /dev/null +++ b/tests/abacus.relax/OUT.abacus/STRU_ION_D @@ -0,0 +1,25 @@ +ATOMIC_SPECIES +H 1.008 ../potential/H_ONCV_PBE-1.0.upf +O 15.9994 ../potential/O_ONCV_PBE-1.0.upf + +LATTICE_CONSTANT +1 + +LATTICE_VECTORS +28 0 0 #latvec1 +0 28 0 #latvec2 +0 0 28 #latvec3 + +ATOMIC_POSITIONS +Direct + +H #label +0 #magnetism +2 #number of atoms +0.569506832635 0.670672815952 0.298608009885 m 1 1 1 +0.492739894831 0.735763306214 0.271083990138 m 1 1 1 + +O #label +0 #magnetism +1 #number of atoms +0.517665952098 0.703037854903 0.321935083854 m 1 1 1 diff --git a/tests/abacus.relax/OUT.abacus/STRU_READIN_ADJUST.cif b/tests/abacus.relax/OUT.abacus/STRU_READIN_ADJUST.cif new file mode 100644 index 000000000..488d7efbd --- /dev/null +++ b/tests/abacus.relax/OUT.abacus/STRU_READIN_ADJUST.cif @@ -0,0 +1,22 @@ +data_test + +_audit_creation_method generated by ABACUS + +_cell_length_a 14.817 +_cell_length_b 14.817 +_cell_length_c 14.817 +_cell_angle_alpha 90 +_cell_angle_beta 90 +_cell_angle_gamma 90 + +_symmetry_space_group_name_H-M +_symmetry_Int_Tables_number + +loop_ +_atom_site_label +_atom_site_fract_x +_atom_site_fract_y +_atom_site_fract_z +H 0.569758 0.6702 0.29983 +H 0.491826 0.736268 0.271857 +O 0.518329 0.703007 0.31994 diff --git a/tests/abacus.relax/OUT.abacus/running_cell-relax.log b/tests/abacus.relax/OUT.abacus/running_cell-relax.log new file mode 100644 index 000000000..3fe32f482 --- /dev/null +++ b/tests/abacus.relax/OUT.abacus/running_cell-relax.log @@ -0,0 +1,1187 @@ + + WELCOME TO ABACUS + + 'Atomic-orbital Based Ab-initio Computation at UStc' + + Website: http://abacus.ustc.edu.cn/ + + Version: Parallel, in development + Processor Number is 2 + Start Time is Mon Jul 25 11:30:20 2022 + + ------------------------------------------------------------------------------------ + + READING GENERAL INFORMATION + global_out_dir = OUT.abacus/ + global_in_card = INPUT + pseudo_dir = + orbital_dir = + pseudo_type = auto + DRANK = 1 + DSIZE = 2 + 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 = 2 + atom label for species 1 = H + atom label for species 2 = O + lattice constant (Bohr) = 1 + lattice constant (Angstrom) = 0.529177 + + READING ATOM TYPE 1 + atom label = H + L=0, number of zeta = 1 + L=1, number of zeta = 1 + L=2, number of zeta = 1 + number of atom for this type = 2 + start magnetization = FALSE + start magnetization = FALSE + + READING ATOM TYPE 2 + atom label = O + L=0, number of zeta = 1 + L=1, number of zeta = 1 + L=2, number of zeta = 1 + number of atom for this type = 1 + start magnetization = FALSE + + TOTAL ATOM NUMBER = 3 + + CARTESIAN COORDINATES ( UNIT = 1 Bohr ). + atom x y z mag vx vy vz + tauc_H1 15.9532129411 18.7655861467 8.39524747132 0 0 0 0 + tauc_H2 13.7711312041 20.6154930027 7.61198952454 0 0 0 0 + tauc_O1 14.5132108826 19.6841922084 8.95832135273 0 0 0 0 + + + Volume (Bohr^3) = 21952 + Volume (A^3) = 3252.94689686 + + Lattice vectors: (Cartesian coordinate: in unit of a_0) + +28 +0 +0 + +0 +28 +0 + +0 +0 +28 + Reciprocal vectors: (Cartesian coordinate: in unit of 2 pi/a_0) + +0.0357142857143 -0 +0 + +0 +0.0357142857143 -0 + +0 -0 +0.0357142857143 + + + + + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + | | + | 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 ../potential/H_ONCV_PBE-1.0.upf + pseudopotential type = NC + exchange-correlation functional = PBE + nonlocal core correction = 0 + valence electrons = 1 + lmax = 0 + number of zeta = 0 + number of projectors = 2 + L of projector = 0 + L of projector = 0 + PAO radial cut off (Bohr) = 15 + + Read in pseudopotential file is ../potential/O_ONCV_PBE-1.0.upf + pseudopotential type = NC + exchange-correlation functional = PBE + nonlocal core correction = 0 + valence electrons = 6 + lmax = 1 + number of zeta = 0 + number of projectors = 4 + L of projector = 0 + L of projector = 0 + L of projector = 1 + L of projector = 1 + initial pseudo atomic orbital number = 0 + NLOCAL = 27 + + + + + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + | | + | 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) = 200 + [fft grid for charge/potential] = 128, 128, 128 + [fft grid division] = 1, 1, 1 + [big fft grid for charge/potential] = 128, 128, 128 + nbxx = 1048576 + nrxx = 1048576 + + SETUP PLANE WAVES FOR CHARGE/POTENTIAL + number of plane waves = 1048171 + number of sticks = 12469 + + PARALLEL PW FOR CHARGE/POTENTIAL + PROC COLUMNS(POT) PW + 1 6235 524087 + 2 6234 524084 + --------------- sum ------------------- + 2 12469 1048171 + number of |g| = 3312 + max |g| = 5.06505102041 + min |g| = 0 + + SETUP THE ELECTRONS NUMBER + electron number of element H = 1 + total electron number of element H = 2 + electron number of element O = 6 + total electron number of element O = 6 + occupied bands = 4 + NBANDS = 6 + DONE : SETUP UNITCELL Time : 0.128108929377 (SEC) + + + + + + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + | | + | Doing symmetry analysis: | + | We calculate the norm of 3 vectors and the angles between them, | + | the type of Bravais lattice is given. We can judge if the unticell | + | is a primitive cell. Finally we give the point group operation for | + | this unitcell. We we use the point group operations to do symmetry | + | analysis on given k-point mesh and the charge density. | + | | + <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + + + + LATTICE VECTORS: (CARTESIAN COORDINATE: IN UNIT OF A0) + +28 +0 +0 + +0 +28 +0 + +0 +0 +28 + right hand lattice = 1 + NORM_A = 28 + NORM_B = 28 + NORM_C = 28 + ALPHA (DEGREE) = 90 + BETA (DEGREE) = 90 + GAMMA (DEGREE) = 90 + BRAVAIS TYPE = 1 + BRAVAIS LATTICE NAME = 01. Cubic P (simple) + IBRAV = 1 + BRAVAIS = SIMPLE CUBIC + LATTICE CONSTANT A = 122.049170419 + ibrav = 1 + ROTATION MATRICES = 48 + PURE POINT GROUP OPERATIONS = 1 + SPACE GROUP OPERATIONS = 1 + POINT GROUP = C_1 +Warning : If the optimal symmetric configuration is not the input configuration, +you have to manually change configurations, ABACUS would only calculate the input structure! + DONE : SYMMETRY Time : 0.155216244515 (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 = 1 + Input type of k points = Monkhorst-Pack(Gamma) + nkstot = 1 + nkstot_ibz = 1 + IBZ DirectX DirectY DirectZ Weight ibz2bz + 1 0 0 0 1 0 + nkstot now = 1 + + KPOINTS DIRECT_X DIRECT_Y DIRECT_Z WEIGHT + 1 0 0 0 1 + + k-point number in this process = 1 + minimum distributed K point number = 1 + + KPOINTS CARTESIAN_X CARTESIAN_Y CARTESIAN_Z WEIGHT + 1 0 0 0 2 + + KPOINTS DIRECT_X DIRECT_Y DIRECT_Z WEIGHT + 1 0 0 0 2 + DONE : INIT K-POINTS Time : 0.155574926175 (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) = 50 + [fft grid for wave functions] = 128, 128, 128 + number of plane waves = 131155 + number of sticks = 3125 + + PARALLEL PW FOR WAVE FUNCTIONS + PROC COLUMNS(POT) PW + 1 1562 65576 + 2 1563 65579 + --------------- sum ------------------- + 2 3125 131155 + DONE : INIT PLANEWAVE Time : 0.174154018052 (SEC) + + DONE : INIT CHARGE Time : 0.259490167722 (SEC) + + npwx = 65576 + + SETUP NONLOCAL PSEUDOPOTENTIALS IN PLANE WAVE BASIS + H non-local projectors: + projector 1 L=0 + projector 2 L=0 + O non-local projectors: + projector 1 L=0 + projector 2 L=0 + projector 3 L=1 + projector 4 L=1 + TOTAL NUMBER OF NONLOCAL PROJECTORS = 12 + DONE : LOCAL POTENTIAL Time : 0.320586761925 (SEC) + + + Init Non-Local PseudoPotential table : + Init Non-Local-Pseudopotential done. + DONE : NON-LOCAL POTENTIAL Time : 0.331188020762 (SEC) + + init_chg = atomic + DONE : INIT POTENTIAL Time : 0.953154 (SEC) + + + Make real space PAO into reciprocal space. + max mesh points in Pseudopotential = 601 + dq(describe PAO in reciprocal space) = 0.01 + max q = 854 + + number of pseudo atomic orbitals for H is 0 + + number of pseudo atomic orbitals for O is 0 + DONE : INIT BASIS Time : 0.953302 (SEC) + + + ------------------------------------------- + RELAX CELL : 1 + RELAX IONS : 1 (in total: 1) + ------------------------------------------- + + PW ALGORITHM --------------- ION= 1 ELEC= 1-------------------------------- + + Density error is 0.417176464796 + Error Threshold = 0.01 + + Energy Rydberg eV + E_KohnSham -34.1543953066 -464.694387914 + E_Harris -34.3635778924 -467.540463003 + E_Fermi -0.520811172492 -7.08599952795 + + PW ALGORITHM --------------- ION= 1 ELEC= 2-------------------------------- + + Density error is 0.0243970602606 + Error Threshold = 0.00521470580995 + + Energy Rydberg eV + E_KohnSham -34.2350427506 -465.791652681 + E_Harris -34.2396178942 -465.853900704 + E_Fermi -0.445620982249 -6.06298450694 + + PW ALGORITHM --------------- ION= 1 ELEC= 3-------------------------------- + + Density error is 0.0106666914925 + Error Threshold = 0.000304963253257 + + Energy Rydberg eV + E_KohnSham -34.2334330467 -465.769751537 + E_Harris -34.2371193473 -465.819906229 + E_Fermi -0.461726538377 -6.28211183974 + + PW ALGORITHM --------------- ION= 1 ELEC= 4-------------------------------- + + Density error is 0.000502675170383 + Error Threshold = 0.000133333643656 + + Energy Rydberg eV + E_KohnSham -34.2339527078 -465.776821889 + E_Harris -34.2341613373 -465.779660439 + E_Fermi -0.200209037333 -2.72398369882 + + PW ALGORITHM --------------- ION= 1 ELEC= 5-------------------------------- + + Density error is 0.00013515778285 + Error Threshold = 6.28343962979e-06 + + Energy Rydberg eV + E_KohnSham -34.2339755848 -465.777133147 + E_Harris -34.2340600257 -465.778282024 + E_Fermi -0.1998556995 -2.71917629098 + + PW ALGORITHM --------------- ION= 1 ELEC= 6-------------------------------- + + Density error is 4.49530417282e-06 + Error Threshold = 1.68947228562e-06 + + Energy Rydberg eV + E_KohnSham -34.2340060994 -465.777548319 + E_Harris -34.2340025802 -465.777500437 + E_Fermi -0.198059680486 -2.69474019867 + + PW ALGORITHM --------------- ION= 1 ELEC= 7-------------------------------- + + Density error is 8.77501268413e-06 + Error Threshold = 5.61913021602e-08 + + Energy Rydberg eV + E_KohnSham -34.2340033243 -465.777510561 + E_Harris -34.2340088507 -465.777585752 + E_Fermi -0.197734942978 -2.69032191821 + + PW ALGORITHM --------------- ION= 1 ELEC= 8-------------------------------- + + Density error is 8.67497506757e-08 + Error Threshold = 5.61913021602e-08 + + Energy Rydberg eV + E_KohnSham -34.2340048296 -465.777531042 + E_Harris -34.234005046 -465.777533987 + E_band -8.10804363451 -110.315593062 + E_one_elec -69.5144554731 -945.792687802 + E_Hartree +36.17757886 +492.221212341 + E_xc -8.44392246259 -114.885458961 + E_Ewald +7.5467942461 +102.679403381 + E_demet -3.01469596081e-24 -4.10170428046e-23 + E_descf +0 +0 + E_efield +0 +0 + E_exx +0 +0 + E_Fermi -0.197510647395 -2.68727022024 + + charge density convergence is achieved + final etot is -465.777531042 eV + + STATE ENERGY(eV) AND OCCUPATIONS NSPIN == 1 + 1/1 kpoint (Cartesian) = 0 0 0 (65576 pws) + 1 -25.4315 2.00000 + 2 -13.5818 2.00000 + 3 -8.97266 2.00000 + 4 -7.17178 2.00000 + 5 -0.769414 0.00000 + 6 0.0954287 0.00000 + + + + + ><><><><><><><><><><><><><><><><><><><><><>< + + TOTAL-FORCE (eV/Angstrom) + + ><><><><><><><><><><><><><><><><><><><><><>< + + atom x y z + H1 +0.40678204 -0.13991970 -0.61593726 + H2 +0.05888465 +0.16630779 -0.76223540 + O1 -0.46566669 -0.02638809 +1.37817266 + + + ><><><><><><><><><><><><><><><><><><><><><>< + + TOTAL-STRESS (KBAR) + + ><><><><><><><><><><><><><><><><><><><><><>< + + -2.153904 -0.330883 -0.070536 + -0.330883 -2.338728 -0.128010 + -0.070536 -0.128010 -1.978256 + TOTAL-PRESSURE: -2.156963 KBAR + + Ion relaxation is not converged yet (threshold is +0.025711) + + CARTESIAN COORDINATES ( UNIT = +1.000000 Bohr ). + atom x y z mag vx vy vz + tauc_H1 +16.065287158181 +18.727036287001 +8.225548029745 +0.000000000000 +0.000000000000 +0.000000000000 +0.000000000000 + tauc_H2 +13.787354759370 +20.661313156171 +7.401982872047 +0.000000000000 +0.000000000000 +0.000000000000 +0.000000000000 + tauc_O1 +14.384913110258 +19.676921914754 +9.338027446795 +0.000000000000 +0.000000000000 +0.000000000000 +0.000000000000 + + Setup the structure factor in plane wave basis. + Setup the extrapolated charge. + NEW-OLD atomic charge density approx. for the potential ! + Setup the Vl+Vh+Vxc according to new structure factor and new charge. + Setup the new wave functions? + + ------------------------------------------- + RELAX CELL : 1 + RELAX IONS : 2 (in total: 2) + ------------------------------------------- + + PW ALGORITHM --------------- ION= +2 ELEC= +1-------------------------------- + + Density error is +4.306406951178 + Error Threshold = +0.010000000000 + + Energy Rydberg eV + E_KohnSham -33.984845752223 -462.387547881332 + E_Harris -36.146219524498 -491.794546692019 + E_Fermi -0.197995181756 -2.693862648432 + + PW ALGORITHM --------------- ION= 2 ELEC= 2-------------------------------- + + Density error is 0.524139822667 + Error Threshold = 0.010000000000 + + Energy Rydberg eV + E_KohnSham -34.028968257734 -462.987865366314 + E_Harris -34.358907885553 -467.476924300648 + E_Fermi -0.181612940365 -2.470970819494 + + PW ALGORITHM --------------- ION= 2 ELEC= 3-------------------------------- + + Density error is 0.008603629609 + Error Threshold = 0.006551747783 + + Energy Rydberg eV + E_KohnSham -34.126866845044 -464.319843979885 + E_Harris -34.126456524090 -464.314261276898 + E_Fermi -0.297352672177 -4.045690657129 + + PW ALGORITHM --------------- ION= 2 ELEC= 4-------------------------------- + + Density error is 0.002218320093 + Error Threshold = 0.000107545370 + + Energy Rydberg eV + E_KohnSham -34.129390206695 -464.354176076454 + E_Harris -34.129193594956 -464.351501036512 + E_Fermi -0.416104088025 -5.661386558240 + + PW ALGORITHM --------------- ION= 2 ELEC= 5-------------------------------- + + Density error is 0.001468898398 + Error Threshold = 0.000027729001 + + Energy Rydberg eV + E_KohnSham -34.129256085952 -464.352351270125 + E_Harris -34.130075919228 -464.363505674089 + E_Fermi -0.418170511223 -5.689501688208 + + PW ALGORITHM --------------- ION= 2 ELEC= 6-------------------------------- + + Density error is 0.000129882152 + Error Threshold = 0.000018361230 + + Energy Rydberg eV + E_KohnSham -34.129606602018 -464.357120285860 + E_Harris -34.129674949307 -464.358050198437 + E_Fermi -0.300798600818 -4.092574921552 + + PW ALGORITHM --------------- ION= 2 ELEC= 7-------------------------------- + + Density error is 0.000010859629 + Error Threshold = 0.000001623527 + + Energy Rydberg eV + E_KohnSham -34.129637781039 -464.357544498211 + E_Harris -34.129643192740 -464.357618128180 + E_Fermi -0.318223545585 -4.329653457719 + + PW ALGORITHM --------------- ION= 2 ELEC= 8-------------------------------- + + Density error is 0.000000556298 + Error Threshold = 0.000000135745 + + Energy Rydberg eV + E_KohnSham -34.129640373324 -464.357579768059 + E_Harris -34.129641983060 -464.357601669637 + E_Fermi -0.318727582976 -4.336511238241 + + PW ALGORITHM --------------- ION= 2 ELEC= 9-------------------------------- + + Density error is 0.000000121833 + Error Threshold = 0.000000006954 + + Energy Rydberg eV + E_KohnSham -34.129640005864 -464.357574768506 + E_Harris -34.129640436568 -464.357580628526 + E_Fermi -0.318641075078 -4.335334237908 + + PW ALGORITHM --------------- ION= 2 ELEC= 10-------------------------------- + + Density error is 0.000000186810 + Error Threshold = 0.000000001523 + + Energy Rydberg eV + E_KohnSham -34.129640196409 -464.357577360995 + E_Harris -34.129640113063 -464.357576227022 + E_Fermi -0.318550723465 -4.334104941148 + + PW ALGORITHM --------------- ION= 2 ELEC= 11-------------------------------- + + Density error is 0.000000001485 + Error Threshold = 0.000000001523 + + Energy Rydberg eV + E_KohnSham -34.129640061126 -464.357575520378 + E_Harris -34.129640228306 -464.357577794985 + E_band -7.520787696202 -102.325566116640 + E_one_elec -64.823282231884 -881.966001415785 + E_Hartree +33.884562763382 +461.023127820625 + E_xc -8.077485864562 -109.899833272499 + E_Ewald +4.886565271938 +66.485131347281 + E_demet -0.000000000000 -0.000000000000 + E_descf +0.000000000000 +0.000000000000 + E_efield +0.000000000000 +0.000000000000 + E_exx +0.000000000000 +0.000000000000 + E_Fermi -0.318592256747 -4.334670030437 + + charge density convergence is achieved + final etot is -464.357575520378 eV + + STATE ENERGY(eV) AND OCCUPATIONS NSPIN == 1 + 1/1 kpoint (Cartesian) = 0.00000 0.00000 0.00000 (65576 pws) + 1 -23.732691 2.000000 + 2 -10.717782 2.000000 + 3 -9.827251 2.000000 + 4 -6.885060 2.000000 + 5 -1.826406 0.000000 + 6 -0.276841 0.000000 + + + + + ><><><><><><><><><><><><><><><><><><><><><>< + + TOTAL-FORCE (eV/Angstrom) + + ><><><><><><><><><><><><><><><><><><><><><>< + + atom x y z + H1 -3.43125048 +1.80114652 +2.82460187 + H2 +0.90733216 -1.89495640 +4.43921704 + O1 +2.52391832 +0.09380988 -7.26381891 + + + ><><><><><><><><><><><><><><><><><><><><><>< + + TOTAL-STRESS (KBAR) + + ><><><><><><><><><><><><><><><><><><><><><>< + + -4.009216 +0.908593 +0.503260 + +0.908593 -3.391991 +0.372926 + +0.503260 +0.372926 -5.317856 + TOTAL-PRESSURE: -4.239688 KBAR + + Ion relaxation is not converged yet (threshold is +0.025711) + + CARTESIAN COORDINATES ( UNIT = +1.000000 Bohr ). + atom x y z mag vx vy vz + tauc_H1 +15.970368922751 +18.759685051002 +8.369270394915 +0.000000000000 +0.000000000000 +0.000000000000 +0.000000000000 + tauc_H2 +13.773614656790 +20.622507013014 +7.579842342394 +0.000000000000 +0.000000000000 +0.000000000000 +0.000000000000 + tauc_O1 +14.493571448267 +19.683079293910 +9.016445611278 +0.000000000000 +0.000000000000 +0.000000000000 +0.000000000000 + + Setup the structure factor in plane wave basis. + Setup the extrapolated charge. + NEW-OLD atomic charge density approx. for the potential ! + Setup the Vl+Vh+Vxc according to new structure factor and new charge. + Setup the new wave functions? + + ------------------------------------------- + RELAX CELL : 1 + RELAX IONS : 3 (in total: 3) + ------------------------------------------- + + PW ALGORITHM --------------- ION= +3 ELEC= +1-------------------------------- + + Density error is +2.863901623074 + Error Threshold = +0.010000000000 + + Energy Rydberg eV + E_KohnSham -34.163066102874 -464.812360149745 + E_Harris -35.594866834916 -484.293008506088 + E_Fermi -0.455725359897 -6.200461617704 + + PW ALGORITHM --------------- ION= 3 ELEC= 2-------------------------------- + + Density error is 0.410367630415 + Error Threshold = 0.010000000000 + + Energy Rydberg eV + E_KohnSham -34.147651136624 -464.602628774257 + E_Harris -34.409877454265 -468.170400859739 + E_Fermi -0.502269645612 -6.833729112759 + + PW ALGORITHM --------------- ION= 3 ELEC= 3-------------------------------- + + Density error is 0.016431897145 + Error Threshold = 0.005129595380 + + Energy Rydberg eV + E_KohnSham -34.231884315653 -465.748679969711 + E_Harris -34.237205015345 -465.821071802865 + E_Fermi -0.163677941108 -2.226952635976 + + PW ALGORITHM --------------- ION= 3 ELEC= 4-------------------------------- + + Density error is 0.003339586249 + Error Threshold = 0.000205398714 + + Energy Rydberg eV + E_KohnSham -34.234286271013 -465.781360248946 + E_Harris -34.234645115958 -465.786242584902 + E_Fermi -0.419282058198 -5.704625060666 + + PW ALGORITHM --------------- ION= 3 ELEC= 5-------------------------------- + + Density error is 0.007193242746 + Error Threshold = 0.000041744828 + + Energy Rydberg eV + E_KohnSham -34.233965842505 -465.777000595434 + E_Harris -34.237258750651 -465.821802909220 + E_Fermi -0.445575876230 -6.062370808069 + + PW ALGORITHM --------------- ION= 3 ELEC= 6-------------------------------- + + Density error is 0.000071123739 + Error Threshold = 0.000041744828 + + Energy Rydberg eV + E_KohnSham -34.235105030292 -465.792500040429 + E_Harris -34.235135970645 -465.792921005526 + E_Fermi -0.195917059478 -2.665588344306 + + PW ALGORITHM --------------- ION= 3 ELEC= 7-------------------------------- + + Density error is 0.000003025816 + Error Threshold = 0.000000889047 + + Energy Rydberg eV + E_KohnSham -34.235144953777 -465.793043227315 + E_Harris -34.235146413266 -465.793063084684 + E_Fermi -0.195891623194 -2.665242265913 + + PW ALGORITHM --------------- ION= 3 ELEC= 8-------------------------------- + + Density error is 0.000014047622 + Error Threshold = 0.000000037823 + + Energy Rydberg eV + E_KohnSham -34.235144028617 -465.793030639864 + E_Harris -34.235149064326 -465.793099154201 + E_Fermi -0.195695384814 -2.662572305769 + + PW ALGORITHM --------------- ION= 3 ELEC= 9-------------------------------- + + Density error is 0.000000380301 + Error Threshold = 0.000000037823 + + Energy Rydberg eV + E_KohnSham -34.235146948037 -465.793070360619 + E_Harris -34.235147173255 -465.793073424855 + E_Fermi -0.195885679726 -2.665161400881 + + PW ALGORITHM --------------- ION= 3 ELEC= 10-------------------------------- + + Density error is 0.000000003456 + Error Threshold = 0.000000004754 + + Energy Rydberg eV + E_KohnSham -34.235147175798 -465.793073459458 + E_Harris -34.235147030585 -465.793071483737 + E_band -8.005203857309 -108.916386110984 + E_one_elec -68.764358752319 -935.587098347715 + E_Hartree +35.812701320327 +487.256798728570 + E_xc -8.382702179786 -114.052514282117 + E_Ewald +7.099212435981 +96.589740441803 + E_demet -0.000000000000 -0.000000000000 + E_descf +0.000000000000 +0.000000000000 + E_efield +0.000000000000 +0.000000000000 + E_exx +0.000000000000 +0.000000000000 + E_Fermi -0.195843647331 -2.664589520805 + + charge density convergence is achieved + final etot is -465.793073459458 eV + + STATE ENERGY(eV) AND OCCUPATIONS NSPIN == 1 + 1/1 kpoint (Cartesian) = 0.00000 0.00000 0.00000 (65576 pws) + 1 -25.151687 2.000000 + 2 -13.061167 2.000000 + 3 -9.128130 2.000000 + 4 -7.117209 2.000000 + 5 -0.875259 0.000000 + 6 0.081372 0.000000 + + + + + ><><><><><><><><><><><><><><><><><><><><><>< + + TOTAL-FORCE (eV/Angstrom) + + ><><><><><><><><><><><><><><><><><><><><><>< + + atom x y z + H1 -0.74519674 +0.51685204 +0.05757714 + H2 +0.52845057 -0.57175572 +0.56392399 + O1 +0.21674617 +0.05490368 -0.62150113 + + + ><><><><><><><><><><><><><><><><><><><><><>< + + TOTAL-STRESS (KBAR) + + ><><><><><><><><><><><><><><><><><><><><><>< + + -2.676771 +0.070442 -0.080953 + +0.070442 -2.674219 +0.037379 + -0.080953 +0.037379 -2.531715 + TOTAL-PRESSURE: -2.627568 KBAR + + Ion relaxation is not converged yet (threshold is +0.025711) + + CARTESIAN COORDINATES ( UNIT = +1.000000 Bohr ). + atom x y z mag vx vy vz + tauc_H1 +15.963906084978 +18.761908055509 +8.379056231391 +0.000000000000 +0.000000000000 +0.000000000000 +0.000000000000 + tauc_H2 +13.772679114178 +20.619864761958 +7.591952522256 +0.000000000000 +0.000000000000 +0.000000000000 +0.000000000000 + tauc_O1 +14.500969828653 +19.683498540459 +8.994549594941 +0.000000000000 +0.000000000000 +0.000000000000 +0.000000000000 + + Setup the structure factor in plane wave basis. + Setup the extrapolated charge. + NEW-OLD atomic charge density approx. for the potential ! + Setup the Vl+Vh+Vxc according to new structure factor and new charge. + Setup the new wave functions? + + ------------------------------------------- + RELAX CELL : 1 + RELAX IONS : 4 (in total: 4) + ------------------------------------------- + + PW ALGORITHM --------------- ION= +4 ELEC= +1-------------------------------- + Notice: Threshold on eigenvalues was too large. + hsover_error=+0.080000 > DRHO=+0.009754 + Origin diag_ethr = +0.010000 + New diag_ethr = +0.000122 + + Density error is +0.013008603075 + Error Threshold = +0.000121928257 + + Energy Rydberg eV + E_KohnSham -34.235665065186 -465.800119706069 + E_Harris -34.242123145811 -465.887986400714 + E_Fermi -0.201851572452 -2.746331535609 + + PW ALGORITHM --------------- ION= 4 ELEC= 2-------------------------------- + + Density error is 0.002090692286 + Error Threshold = 0.000162607538 + + Energy Rydberg eV + E_KohnSham -34.235132150914 -465.792869035430 + E_Harris -34.236530970810 -465.811900956494 + E_Fermi -0.198476768045 -2.700414966033 + + PW ALGORITHM --------------- ION= 4 ELEC= 3-------------------------------- + + Density error is 0.000052460392 + Error Threshold = 0.000026133654 + + Energy Rydberg eV + E_KohnSham -34.235682052400 -465.800350828976 + E_Harris -34.235704411445 -465.800655039388 + E_Fermi -0.196153271944 -2.668802179785 + + PW ALGORITHM --------------- ION= 4 ELEC= 4-------------------------------- + + Density error is 0.000009658088 + Error Threshold = 0.000000655755 + + Energy Rydberg eV + E_KohnSham -34.235696222774 -465.800543626804 + E_Harris -34.235698393982 -465.800573167609 + E_Fermi -0.196616103423 -2.675099325104 + + PW ALGORITHM --------------- ION= 4 ELEC= 5-------------------------------- + + Density error is 0.000000187065 + Error Threshold = 0.000000120726 + + Energy Rydberg eV + E_KohnSham -34.235697732989 -465.800564174335 + E_Harris -34.235697255523 -465.800557678071 + E_Fermi -0.196471698719 -2.673134598311 + + PW ALGORITHM --------------- ION= 4 ELEC= 6-------------------------------- + + Density error is 0.000000075160 + Error Threshold = 0.000000002338 + + Energy Rydberg eV + E_KohnSham -34.235698022205 -465.800568109314 + E_Harris -34.235697872683 -465.800566074967 + E_band -8.042398038358 -109.422438905691 + E_one_elec -69.045489549154 -939.412079067952 + E_Hartree +35.948698866316 +489.107140268040 + E_xc -8.405372202565 -114.360955765699 + E_Ewald +7.266464863199 +98.865326456297 + E_demet -0.000000000000 -0.000000000000 + E_descf +0.000000000000 +0.000000000000 + E_efield +0.000000000000 +0.000000000000 + E_exx +0.000000000000 +0.000000000000 + E_Fermi -0.196459651857 -2.672970692356 + + charge density convergence is achieved + final etot is -465.800568109314 eV + + STATE ENERGY(eV) AND OCCUPATIONS NSPIN == 1 + 1/1 kpoint (Cartesian) = 0.00000 0.00000 0.00000 (65576 pws) + 1 -25.255180 2.000000 + 2 -13.252315 2.000000 + 3 -9.068312 2.000000 + 4 -7.135412 2.000000 + 5 -0.833001 0.000000 + 6 0.086578 0.000000 + + + + + ><><><><><><><><><><><><><><><><><><><><><>< + + TOTAL-FORCE (eV/Angstrom) + + ><><><><><><><><><><><><><><><><><><><><><>< + + atom x y z + H1 -0.34425976 +0.29101536 -0.19310908 + H2 +0.37384222 -0.31991297 +0.09092313 + O1 -0.02958246 +0.02889761 +0.10218595 + + + ><><><><><><><><><><><><><><><><><><><><><>< + + TOTAL-STRESS (KBAR) + + ><><><><><><><><><><><><><><><><><><><><><>< + + -2.495529 -0.069759 -0.084163 + -0.069759 -2.561022 -0.020268 + -0.084163 -0.020268 -2.324147 + TOTAL-PRESSURE: -2.460232 KBAR + + Ion relaxation is not converged yet (threshold is +0.025711) + + CARTESIAN COORDINATES ( UNIT = +1.000000 Bohr ). + atom x y z mag vx vy vz + tauc_H1 +15.946191313792 +18.778838846668 +8.361024276793 +0.000000000000 +0.000000000000 +0.000000000000 +0.000000000000 + tauc_H2 +13.796717055281 +20.601372573983 +7.590351723874 +0.000000000000 +0.000000000000 +0.000000000000 +0.000000000000 + tauc_O1 +14.494646658736 +19.685059937275 +9.014182347920 +0.000000000000 +0.000000000000 +0.000000000000 +0.000000000000 + + Setup the structure factor in plane wave basis. + Setup the extrapolated charge. + NEW-OLD atomic charge density approx. for the potential ! + Setup the Vl+Vh+Vxc according to new structure factor and new charge. + Setup the new wave functions? + + ------------------------------------------- + RELAX CELL : 1 + RELAX IONS : 5 (in total: 5) + ------------------------------------------- + + PW ALGORITHM --------------- ION= +5 ELEC= +1-------------------------------- + Notice: Threshold on eigenvalues was too large. + hsover_error=+0.080000 > DRHO=+0.005280 + Origin diag_ethr = +0.010000 + New diag_ethr = +0.000066 + + Density error is +0.008353549675 + Error Threshold = +0.000065997708 + + Energy Rydberg eV + E_KohnSham -34.236235736125 -465.807884082530 + E_Harris -34.240337321619 -465.863689016079 + E_Fermi -0.438351093885 -5.964072601368 + + PW ALGORITHM --------------- ION= 5 ELEC= 2-------------------------------- + + Density error is 0.001090032164 + Error Threshold = 0.000104419371 + + Energy Rydberg eV + E_KohnSham -34.236307152675 -465.808855754541 + E_Harris -34.236930505462 -465.817336904304 + E_Fermi -0.196029016571 -2.667111598704 + + PW ALGORITHM --------------- ION= 5 ELEC= 3-------------------------------- + + Density error is 0.000082249260 + Error Threshold = 0.000013625402 + + Energy Rydberg eV + E_KohnSham -34.236527086358 -465.811848105802 + E_Harris -34.236560493475 -465.812302632946 + E_Fermi -0.196758447273 -2.677036012549 + + PW ALGORITHM --------------- ION= 5 ELEC= 4-------------------------------- + + Density error is 0.000130293705 + Error Threshold = 0.000001028116 + + Energy Rydberg eV + E_KohnSham -34.236562121478 -465.812324783072 + E_Harris -34.236605870085 -465.812920013399 + E_Fermi -0.197596470944 -2.688437909528 + + PW ALGORITHM --------------- ION= 5 ELEC= 5-------------------------------- + + Density error is 0.000024525955 + Error Threshold = 0.000001028116 + + Energy Rydberg eV + E_KohnSham -34.236557021747 -465.812255397668 + E_Harris -34.236571054853 -465.812446327870 + E_Fermi -0.197329109008 -2.684800263772 + + PW ALGORITHM --------------- ION= 5 ELEC= 6-------------------------------- + + Density error is 0.000001304759 + Error Threshold = 0.000000306574 + + Energy Rydberg eV + E_KohnSham -34.236563844352 -465.812348223977 + E_Harris -34.236563957567 -465.812349764348 + E_Fermi -0.197072028110 -2.681302498717 + + PW ALGORITHM --------------- ION= 5 ELEC= 7-------------------------------- + + Density error is 0.000000346081 + Error Threshold = 0.000000016309 + + Energy Rydberg eV + E_KohnSham -34.236564300744 -465.812354433499 + E_Harris -34.236564193956 -465.812352980576 + E_Fermi -0.197125544263 -2.682030623327 + + PW ALGORITHM --------------- ION= 5 ELEC= 8-------------------------------- + + Density error is 0.000000130954 + Error Threshold = 0.000000004326 + + Energy Rydberg eV + E_KohnSham -34.236564259962 -465.812353878642 + E_Harris -34.236564316674 -465.812354650242 + E_Fermi -0.197131965268 -2.682117985583 + + PW ALGORITHM --------------- ION= 5 ELEC= 9-------------------------------- + + Density error is 0.000000001123 + Error Threshold = 0.000000001637 + + Energy Rydberg eV + E_KohnSham -34.236564293143 -465.812354330090 + E_Harris -34.236564293813 -465.812354339209 + E_band -8.062071986763 -109.690116706159 + E_one_elec -69.117794401277 -940.395837049864 + E_Hartree +35.979373791465 +489.524494035791 + E_xc -8.410666291229 -114.432985537248 + E_Ewald +7.312522607898 +99.491974221231 + E_demet -0.000000000000 -0.000000000000 + E_descf +0.000000000000 +0.000000000000 + E_efield +0.000000000000 +0.000000000000 + E_exx +0.000000000000 +0.000000000000 + E_Fermi -0.197145167314 -2.682297608633 + + charge density convergence is achieved + final etot is -465.812354330090 eV + + STATE ENERGY(eV) AND OCCUPATIONS NSPIN == 1 + 1/1 kpoint (Cartesian) = 0.00000 0.00000 0.00000 (65576 pws) + 1 -25.330615 2.000000 + 2 -13.155666 2.000000 + 3 -9.203788 2.000000 + 4 -7.154990 2.000000 + 5 -0.831095 0.000000 + 6 0.086695 0.000000 + + + + + ><><><><><><><><><><><><><><><><><><><><><>< + + TOTAL-FORCE (eV/Angstrom) + + ><><><><><><><><><><><><><><><><><><><><><>< + + atom x y z + H1 -0.18807867 +0.13569889 -0.06941882 + H2 +0.14926844 -0.14376688 +0.04694486 + O1 +0.03881023 +0.00806799 +0.02247396 + + + ><><><><><><><><><><><><><><><><><><><><><>< + + TOTAL-STRESS (KBAR) + + ><><><><><><><><><><><><><><><><><><><><><>< + + -2.392469 -0.160549 -0.032796 + -0.160549 -2.480798 -0.059783 + -0.032796 -0.059783 -2.315957 + TOTAL-PRESSURE: -2.396408 KBAR + + + -------------------------------------------- + !FINAL_ETOT_IS -465.8123543300895335 eV + -------------------------------------------- + + + + + + + |CLASS_NAME---------|NAME---------------|TIME(Sec)-----|CALLS----|AVG------|PER%------- + total +84.59445 19 +4.45 +100.00% + Run_pw plane_wave_line +84.58434 1 +84.58 +99.99% + PW_Basis setup_struc_factor +0.37204 9 +0.04 +0.44% + Potential init_pot +2.60817 5 +0.52 +3.08% + Potential set_local_pot +0.17850 5 +0.04 +0.21% + PW_Basis recip2real +6.88976 294 +0.02 +8.14% + PW_Basis gathers_scatterp +2.80189 294 +0.01 +3.31% + Charge atomic_rho +0.93431 9 +0.10 +1.10% + Potential v_of_rho +21.19138 49 +0.43 +25.05% + XC_Functional v_xc +19.67060 54 +0.36 +23.25% + PW_Basis real2recip +9.16010 446 +0.02 +10.83% + PW_Basis gatherp_scatters +3.68783 446 +0.01 +4.36% + H_Hartree_pw v_hartree +3.16563 49 +0.06 +3.74% + Potential set_vr_eff +0.12252 49 +0.00 +0.14% + Cell_PW opt_cells_pw +83.63640 1 +83.64 +98.87% + Ions opt_ions_pw +83.63639 1 +83.64 +98.87% + ESolver_KS_PW Run +73.96240 5 +14.79 +87.43% + Symmetry rho_symmetry +3.36747 51 +0.07 +3.98% + HSolverPW solve +43.08348 46 +0.94 +50.93% + pp_cell_vnl getvnl +1.24764 56 +0.02 +1.47% + WF_igk get_sk +0.31200 231 +0.00 +0.37% + DiagoIterAssist diagH_subspace +6.55659 45 +0.15 +7.75% + HamiltPW h_psi +34.80823 1083 +0.03 +41.15% + Operator EkineticPW +0.20066 1083 +0.00 +0.24% + Operator VeffPW +31.49160 1083 +0.03 +37.23% + PW_Basis_K recip2real +17.21913 1493 +0.01 +20.35% + PW_Basis_K gathers_scatterp +4.88147 1493 +0.00 +5.77% + PW_Basis_K real2recip +11.93248 1308 +0.01 +14.11% + PW_Basis_K gatherp_scatters +2.55499 1308 +0.00 +3.02% + Operator NonlocalPW +3.11107 1083 +0.00 +3.68% + NonlocalPW add_nonlocal_pp +1.47037 1083 +0.00 +1.74% + DiagoCG diag_once +31.41731 46 +0.68 +37.14% + ElecStatePW psiToRho +3.97135 46 +0.09 +4.69% + Charge rho_mpi +1.34662 46 +0.03 +1.59% + Charge mix_rho +3.23741 39 +0.08 +3.83% + Forces cal_force_loc +0.29882 5 +0.06 +0.35% + Forces cal_force_ew +0.22785 5 +0.05 +0.27% + Forces cal_force_nl +0.20171 5 +0.04 +0.24% + Stress_PW cal_stress +3.22335 5 +0.64 +3.81% + Stress_Func stress_har +0.17289 5 +0.03 +0.20% + Stress_Func stress_ew +0.28902 5 +0.06 +0.34% + Stress_Func stress_gga +0.80316 5 +0.16 +0.95% + Stress_Func stress_loc +0.48018 5 +0.10 +0.57% + Stress_Func stres_nl +1.42753 5 +0.29 +1.69% + ---------------------------------------------------------------------------------------- + + CLASS_NAME---------|NAME---------------|MEMORY(MB)-------- + +418.2583 + Charge_Pulay Rrho +64.0000 + Charge_Pulay dRrho +56.0000 + Charge_Pulay drho +56.0000 + PW_Basis struc_fac +15.9939 + Charge rho +8.0000 + Charge rho_save +8.0000 + Charge rho_core +8.0000 + Potential vltot +8.0000 + Potential vr +8.0000 + Potential vr_eff +8.0000 + Potential vr_eff1 +8.0000 + Potential vnew +8.0000 + Charge_Pulay rho_save2 +8.0000 + wavefunc psi +6.0037 + Charge rhog +3.9985 + Charge rhog_save +3.9985 + Charge kin_r +3.9985 + Charge kin_r_save +3.9985 + Charge rhog_core +3.9985 + ---------------------------------------------------------- + + Start Time : Mon Jul 25 11:30:20 2022 + Finish Time : Mon Jul 25 11:31:45 2022 + Total Time : 0 h 1 mins 25 secs diff --git a/tests/abacus.relax/STRU b/tests/abacus.relax/STRU new file mode 100644 index 000000000..c1ae18bf0 --- /dev/null +++ b/tests/abacus.relax/STRU @@ -0,0 +1,29 @@ +ATOMIC_SPECIES +H 1.008 ../potential/H_ONCV_PBE-1.0.upf +O 15.9994 ../potential/O_ONCV_PBE-1.0.upf + +NUMERICAL_ORBITAL +../potential/H_gga_8au_100Ry_2s1p.orb +../potential/O_gga_7au_100Ry_2s2p1d.orb + + +LATTICE_CONSTANT +1 + +LATTICE_VECTORS +28 0 0 +0 28 0 +0 0 28 + +ATOMIC_POSITIONS +Cartesian + +H +0 +2 +-12.046787058887078 18.76558614676448 8.395247471328744 1 1 1 +-14.228868795885418 20.61549300274637 7.611989524516571 1 1 1 +O +0 +1 +-13.486789117423204 19.684192208418636 8.958321352749174 1 1 1 diff --git a/tests/abacus.relax/coord.ref b/tests/abacus.relax/coord.ref new file mode 100644 index 000000000..9181ed3f6 --- /dev/null +++ b/tests/abacus.relax/coord.ref @@ -0,0 +1,15 @@ + 8.44207672911 9.93032053807 4.44257364171 + 7.28736880156 10.90924908856 4.02809138602 + 7.68006045610 10.41642593172 4.74053950781 + 8.50138385072 9.90992083083 4.35277256453 + 7.29595393729 10.93349606958 3.91696065138 + 7.61216819877 10.41257865801 4.94147131963 + 8.45115528363 9.92719781271 4.42882716487 + 7.28868298813 10.91296074297 4.01107982983 + 7.66966771502 10.41583700273 4.77129754083 + 8.44773529717 9.92837417603 4.43400560653 + 7.28818792030 10.91156252393 4.01748826104 + 7.67358276932 10.41605885845 4.75971066798 + 8.43836104396 9.93733356488 4.42446350709 + 7.30090825093 10.90177687947 4.01664115501 + 7.67023669189 10.41688511407 4.77009987344 diff --git a/tests/abacus.relax/force.ref b/tests/abacus.relax/force.ref new file mode 100644 index 000000000..1b68d00be --- /dev/null +++ b/tests/abacus.relax/force.ref @@ -0,0 +1,15 @@ + 0.40678204000 -0.13991970000 -0.61593726000 + 0.05888465000 0.16630779000 -0.76223540000 + -0.46566669000 -0.02638809000 1.37817266000 + -3.43125048000 1.80114652000 2.82460187000 + 0.90733216000 -1.89495640000 4.43921704000 + 2.52391832000 0.09380988000 -7.26381891000 + -0.74519674000 0.51685204000 0.05757714000 + 0.52845057000 -0.57175572000 0.56392399000 + 0.21674617000 0.05490368000 -0.62150113000 + -0.34425976000 0.29101536000 -0.19310908000 + 0.37384222000 -0.31991297000 0.09092313000 + -0.02958246000 0.02889761000 0.10218595000 + -0.18807867000 0.13569889000 -0.06941882000 + 0.14926844000 -0.14376688000 0.04694486000 + 0.03881023000 0.00806799000 0.02247396000 diff --git a/tests/abacus.relax/stress.ref b/tests/abacus.relax/stress.ref new file mode 100644 index 000000000..7ba6e6954 --- /dev/null +++ b/tests/abacus.relax/stress.ref @@ -0,0 +1,15 @@ + -2.15390400000 -0.33088300000 -0.07053600000 + -0.33088300000 -2.33872800000 -0.12801000000 + -0.07053600000 -0.12801000000 -1.97825600000 + -4.00921600000 0.90859300000 0.50326000000 + 0.90859300000 -3.39199100000 0.37292600000 + 0.50326000000 0.37292600000 -5.31785600000 + -2.67677100000 0.07044200000 -0.08095300000 + 0.07044200000 -2.67421900000 0.03737900000 + -0.08095300000 0.03737900000 -2.53171500000 + -2.49552900000 -0.06975900000 -0.08416300000 + -0.06975900000 -2.56102200000 -0.02026800000 + -0.08416300000 -0.02026800000 -2.32414700000 + -2.39246900000 -0.16054900000 -0.03279600000 + -0.16054900000 -2.48079800000 -0.05978300000 + -0.03279600000 -0.05978300000 -2.31595700000 diff --git a/tests/abacus.relax/virial.ref b/tests/abacus.relax/virial.ref new file mode 100644 index 000000000..cb442e805 --- /dev/null +++ b/tests/abacus.relax/virial.ref @@ -0,0 +1,15 @@ + -4.37314061483 -0.67180240440 -0.14321151101 + -0.67180240440 -4.74839473061 -0.25990282302 + -0.14321151101 -0.25990282302 -4.01651682718 + -8.14004028185 1.84474561106 1.02178497548 + 1.84474561106 -6.88686849889 0.75716366046 + 1.02178497548 0.75716366046 -10.79701419257 + -5.43473431346 0.14302065978 -0.16436148138 + 0.14302065978 -5.42955290573 0.07589178675 + -0.16436148138 0.07589178675 -5.14022244802 + -5.06675284757 -0.14163394290 -0.17087884770 + -0.14163394290 -5.19972539337 -0.04115077273 + -0.17087884770 -0.04115077273 -4.71879045702 + -4.85750681257 -0.32596780199 -0.06658677434 + -0.32596780199 -5.03684402415 -0.12137934902 + -0.06658677434 -0.12137934902 -4.70216203642 diff --git a/tests/abacus.scf/INPUT b/tests/abacus.scf/INPUT index c353aef1f..0281c22df 100644 --- a/tests/abacus.scf/INPUT +++ b/tests/abacus.scf/INPUT @@ -1,18 +1,18 @@ INPUT_PARAMETERS #Parameters (General) -suffix ch4 -atom_file STRU.ch4 #the filename of file containing atom positions -kpoint_file KPT.ch4 #the name of file containing k points -pseudo_dir ./ -ntype 2 -nbands 8 +suffix ch4 +stru_file STRU.ch4 #the filename of file containing atom positions +kpoint_file KPT.ch4 #the name of file containing k points +pseudo_dir ./ +ntype 2 +nbands 8 #Parameters (Accuracy) -ecutwfc 100 -symmetry 1 -niter 50 -smearing gauss #type of smearing: gauss; fd; fixed; mp; mp2; mv -sigma 0.01 -mixing_beta 0.5 -mixing_type plain -force 1 -stress 1 +ecutwfc 100 +symmetry 1 +scf_nmax 50 +smearing_method gauss #type of smearing: gauss; fd; fixed; mp; mp2; mv +smearing_sigma 0.01 +mixing_type plain +mixing_beta 0.5 +cal_force 1 +cal_stress 1 diff --git a/tests/abacus.scf/stru_test b/tests/abacus.scf/stru_test index 7e7323a1a..22d619c93 100644 --- a/tests/abacus.scf/stru_test +++ b/tests/abacus.scf/stru_test @@ -1,6 +1,6 @@ ATOMIC_SPECIES -C 12 C.upf -H 1 H.upf +C 12.000 C.upf +H 1.000 H.upf NUMERICAL_ORBITAL C.orb diff --git a/tests/amber/sqm.in b/tests/amber/sqm.in index 8f4120085..c2e18f074 100644 --- a/tests/amber/sqm.in +++ b/tests/amber/sqm.in @@ -5,8 +5,8 @@ Run semi-emperical minimization maxcyc=0 verbosity=4 / - 6 C -0.0221 0.0032 0.0165 - 1 H -0.6690 0.8894 -0.1009 - 1 H -0.3778 -0.8578 -0.5883 - 1 H 0.0964 -0.3151 1.0638 - 1 H 0.9725 0.2803 -0.3911 + 6 C -0.022100 0.003200 0.016500 + 1 H -0.669000 0.889400 -0.100900 + 1 H -0.377800 -0.857800 -0.588300 + 1 H 0.096400 -0.315100 1.063800 + 1 H 0.972500 0.280300 -0.391100 diff --git a/tests/context.py b/tests/context.py index 95257e195..6c828a1bd 100644 --- a/tests/context.py +++ b/tests/context.py @@ -3,4 +3,6 @@ import dpdata import dpdata.md.water import dpdata.md.msd +import dpdata.gaussian.gjf import dpdata.system +import dpdata.stat diff --git a/tests/cp2k/aimd_stress/DPGEN-pos-1.xyz b/tests/cp2k/aimd_stress/DPGEN-pos-1.xyz new file mode 100644 index 000000000..6527ded0d --- /dev/null +++ b/tests/cp2k/aimd_stress/DPGEN-pos-1.xyz @@ -0,0 +1,7 @@ + 5 + i = 0, time = 0.000, E = -8.07218972206 + H 5.70191 3.8096 4.38845 + H 4.44601 4.65681 5.38195 + H 4.49216 4.90991 3.57756 + H 5.83825 5.62228 4.61068 + C 5.11666 4.75533 4.46123 diff --git a/tests/cp2k/aimd_stress/cp2k.log b/tests/cp2k/aimd_stress/cp2k.log new file mode 100644 index 000000000..1347d0112 --- /dev/null +++ b/tests/cp2k/aimd_stress/cp2k.log @@ -0,0 +1,1992 @@ + DBCSR| CPU Multiplication driver XSMM + DBCSR| Multrec recursion limit 512 + DBCSR| Multiplication stack size 1000 + DBCSR| Maximum elements for images UNLIMITED + DBCSR| Multiplicative factor virtual images 1 + DBCSR| Use multiplication densification T + DBCSR| Multiplication size stacks 3 + DBCSR| Number of 3D layers SINGLE + DBCSR| Use MPI memory allocation T + DBCSR| Use RMA algorithm F + DBCSR| Use Communication thread T + DBCSR| Communication thread load 87 + + + **** **** ****** ** PROGRAM STARTED AT 2022-07-05 23:37:43.696 + ***** ** *** *** ** PROGRAM STARTED ON iZ8vbd1b1rzkp9d3orslghZ + ** **** ****** PROGRAM STARTED BY root + ***** ** ** ** ** PROGRAM PROCESS ID 3252 + **** ** ******* ** PROGRAM STARTED IN /root/aimd_stress_2 + + CP2K| version string: CP2K version 7.1 + CP2K| source code revision number: git:e635599 + CP2K| cp2kflags: libint fftw3 libxc parallel mpi3 scalapack xsmm + CP2K| is freely available from https://www.cp2k.org/ + CP2K| Program compiled at Tue 14 Dec 2021 05:21:44 PM CST + CP2K| Program compiled on iZ8vbih924xsqspysxyrdrZ + CP2K| Program compiled for local + CP2K| Data directory path /root/cp2k-7.1/data + CP2K| Input file name input_2.inp + + GLOBAL| Force Environment number 1 + GLOBAL| Basis set file name BASIS_MOLOPT + GLOBAL| Potential file name GTH_POTENTIALS + GLOBAL| MM Potential file name MM_POTENTIAL + GLOBAL| Coordinate file name __STD_INPUT__ + GLOBAL| Method name CP2K + GLOBAL| Project name DPGEN + GLOBAL| Preferred FFT library FFTW3 + GLOBAL| Preferred diagonalization lib. SL + GLOBAL| Run type MD + GLOBAL| All-to-all communication in single precision F + GLOBAL| FFTs using library dependent lengths F + GLOBAL| Global print level MEDIUM + GLOBAL| MPI I/O enabled T + GLOBAL| Total number of message passing processes 2 + GLOBAL| Number of threads for this process 1 + GLOBAL| This output is from process 0 + GLOBAL| CPU model name Intel(R) Xeon(R) Platinum 8269CY CPU @ 2.50GHz + GLOBAL| CPUID 1003 + + MEMORY| system memory details [Kb] + MEMORY| rank 0 min max average + MEMORY| MemTotal 7877092 7877092 7877092 7877092 + MEMORY| MemFree 6431572 6431572 6431572 6431572 + MEMORY| Buffers 42376 42376 42376 42376 + MEMORY| Cached 830288 830288 830288 830288 + MEMORY| Slab 142328 142328 142328 142328 + MEMORY| SReclaimable 71016 71016 71016 71016 + MEMORY| MemLikelyFree 7375252 7375252 7375252 7375252 + + + *** Fundamental physical constants (SI units) *** + + *** Literature: B. J. Mohr and B. N. Taylor, + *** CODATA recommended values of the fundamental physical + *** constants: 2006, Web Version 5.1 + *** http://physics.nist.gov/constants + + Speed of light in vacuum [m/s] 2.99792458000000E+08 + Magnetic constant or permeability of vacuum [N/A**2] 1.25663706143592E-06 + Electric constant or permittivity of vacuum [F/m] 8.85418781762039E-12 + Planck constant (h) [J*s] 6.62606896000000E-34 + Planck constant (h-bar) [J*s] 1.05457162825177E-34 + Elementary charge [C] 1.60217648700000E-19 + Electron mass [kg] 9.10938215000000E-31 + Electron g factor [ ] -2.00231930436220E+00 + Proton mass [kg] 1.67262163700000E-27 + Fine-structure constant 7.29735253760000E-03 + Rydberg constant [1/m] 1.09737315685270E+07 + Avogadro constant [1/mol] 6.02214179000000E+23 + Boltzmann constant [J/K] 1.38065040000000E-23 + Atomic mass unit [kg] 1.66053878200000E-27 + Bohr radius [m] 5.29177208590000E-11 + + *** Conversion factors *** + + [u] -> [a.u.] 1.82288848426455E+03 + [Angstrom] -> [Bohr] = [a.u.] 1.88972613288564E+00 + [a.u.] = [Bohr] -> [Angstrom] 5.29177208590000E-01 + [a.u.] -> [s] 2.41888432650478E-17 + [a.u.] -> [fs] 2.41888432650478E-02 + [a.u.] -> [J] 4.35974393937059E-18 + [a.u.] -> [N] 8.23872205491840E-08 + [a.u.] -> [K] 3.15774647902944E+05 + [a.u.] -> [kJ/mol] 2.62549961709828E+03 + [a.u.] -> [kcal/mol] 6.27509468713739E+02 + [a.u.] -> [Pa] 2.94210107994716E+13 + [a.u.] -> [bar] 2.94210107994716E+08 + [a.u.] -> [atm] 2.90362800883016E+08 + [a.u.] -> [eV] 2.72113838565563E+01 + [a.u.] -> [Hz] 6.57968392072181E+15 + [a.u.] -> [1/cm] (wave numbers) 2.19474631370540E+05 + [a.u./Bohr**2] -> [1/cm] 5.14048714338585E+03 + + + CELL_TOP| Volume [angstrom^3]: 1000.000 + CELL_TOP| Vector a [angstrom 10.000 0.000 0.000 |a| = 10.000 + CELL_TOP| Vector b [angstrom 0.000 10.000 0.000 |b| = 10.000 + CELL_TOP| Vector c [angstrom 0.000 0.000 10.000 |c| = 10.000 + CELL_TOP| Angle (b,c), alpha [degree]: 90.000 + CELL_TOP| Angle (a,c), beta [degree]: 90.000 + CELL_TOP| Angle (a,b), gamma [degree]: 90.000 + CELL_TOP| Numerically orthorhombic: YES + + GENERATE| Preliminary Number of Bonds generated: 0 + GENERATE| Achieved consistency in connectivity generation. + + CELL| Volume [angstrom^3]: 1000.000 + CELL| Vector a [angstrom]: 10.000 0.000 0.000 |a| = 10.000 + CELL| Vector b [angstrom]: 0.000 10.000 0.000 |b| = 10.000 + CELL| Vector c [angstrom]: 0.000 0.000 10.000 |c| = 10.000 + CELL| Angle (b,c), alpha [degree]: 90.000 + CELL| Angle (a,c), beta [degree]: 90.000 + CELL| Angle (a,b), gamma [degree]: 90.000 + CELL| Numerically orthorhombic: YES + + CELL_REF| Volume [angstrom^3]: 1000.000 + CELL_REF| Vector a [angstrom 10.000 0.000 0.000 |a| = 10.000 + CELL_REF| Vector b [angstrom 0.000 10.000 0.000 |b| = 10.000 + CELL_REF| Vector c [angstrom 0.000 0.000 10.000 |c| = 10.000 + CELL_REF| Angle (b,c), alpha [degree]: 90.000 + CELL_REF| Angle (a,c), beta [degree]: 90.000 + CELL_REF| Angle (a,b), gamma [degree]: 90.000 + CELL_REF| Numerically orthorhombic: YES + + ******************************************************************************* + ******************************************************************************* + ** ** + ** ##### ## ## ** + ** ## ## ## ## ## ** + ** ## ## ## ###### ** + ** ## ## ## ## ## ##### ## ## #### ## ##### ##### ** + ** ## ## ## ## ## ## ## ## ## ## ## ## ## ## ** + ** ## ## ## ## ## ## ## #### ### ## ###### ###### ** + ** ## ### ## ## ## ## ## ## ## ## ## ## ** + ** ####### ##### ## ##### ## ## #### ## ##### ## ** + ** ## ## ** + ** ** + ** ... make the atoms dance ** + ** ** + ** Copyright (C) by CP2K developers group (2000 - 2019) ** + ** ** + ******************************************************************************* + + DFT| Spin unrestricted (spin-polarized) Kohn-Sham calculation UKS + DFT| Multiplicity 1 + DFT| Number of spin states 2 + DFT| Charge 0 + DFT| Self-interaction correction (SIC) NO + DFT| Cutoffs: density 1.000000E-10 + DFT| gradient 1.000000E-10 + DFT| tau 1.000000E-10 + DFT| cutoff_smoothing_range 0.000000E+00 + DFT| XC density smoothing NONE + DFT| XC derivatives PW + FUNCTIONAL| ROUTINE=NEW + FUNCTIONAL| PBE: + FUNCTIONAL| J.P.Perdew, K.Burke, M.Ernzerhof, Phys. Rev. Letter, vol. 77, n 18, + FUNCTIONAL| pp. 3865-3868, (1996){spin polarized} + vdW POTENTIAL| Pair Potential + vdW POTENTIAL| DFT-D3 (Version 3.1) + vdW POTENTIAL| Potential Form: S. Grimme et al, JCP 132: 154104 (2010) + vdW POTENTIAL| Zero Damping + vdW POTENTIAL| Cutoff Radius [Bohr]: 20.00 + vdW POTENTIAL| s6 Scaling Factor: 1.0000 + vdW POTENTIAL| sr6 Scaling Factor: 1.2170 + vdW POTENTIAL| s8 Scaling Factor: 0.7220 + vdW POTENTIAL| Cutoff for CN calculation: 0.1000E-05 + + QS| Method: GPW + QS| Density plane wave grid type NON-SPHERICAL FULLSPACE + QS| Number of grid levels: 5 + QS| Density cutoff [a.u.]: 400.0 + QS| Multi grid cutoff [a.u.]: 1) grid level 400.0 + QS| 2) grid level 133.3 + QS| 3) grid level 44.4 + QS| 4) grid level 14.8 + QS| 5) grid level 4.9 + QS| Grid level progression factor: 3.0 + QS| Relative density cutoff [a.u.]: 30.0 + QS| Consistent realspace mapping and integration + QS| Interaction thresholds: eps_pgf_orb: 3.2E-07 + QS| eps_filter_matrix: 0.0E+00 + QS| eps_core_charge: 1.0E-15 + QS| eps_rho_gspace: 1.0E-13 + QS| eps_rho_rspace: 1.0E-13 + QS| eps_gvg_rspace: 3.2E-07 + QS| eps_ppl: 1.0E-02 + QS| eps_ppnl: 3.2E-09 + + + ATOMIC KIND INFORMATION + + 1. Atomic kind: H Number of atoms: 4 + + Orbital Basis Set DZVP-MOLOPT-SR-GTH + + Number of orbital shell sets: 1 + Number of orbital shells: 3 + Number of primitive Cartesian functions: 5 + Number of Cartesian basis functions: 5 + Number of spherical basis functions: 5 + Norm type: 2 + + Normalised Cartesian orbitals: + + Set Shell Orbital Exponent Coefficient + + 1 1 2s 10.068468 -0.133023 + 2.680223 -0.177618 + 0.791502 -0.258419 + 0.239116 -0.107525 + 0.082193 -0.014019 + + 1 2 3s 10.068468 0.344673 + 2.680223 1.819821 + 0.791502 -0.999069 + 0.239116 0.017430 + 0.082193 0.082660 + + 1 3 3px 10.068468 0.155326 + 2.680223 0.367157 + 0.791502 0.311480 + 0.239116 0.080105 + 0.082193 0.033440 + 1 3 3py 10.068468 0.155326 + 2.680223 0.367157 + 0.791502 0.311480 + 0.239116 0.080105 + 0.082193 0.033440 + 1 3 3pz 10.068468 0.155326 + 2.680223 0.367157 + 0.791502 0.311480 + 0.239116 0.080105 + 0.082193 0.033440 + + GTH Potential information for GTH-PBE-q1 + + Description: Goedecker-Teter-Hutter pseudopotential + Goedecker et al., PRB 54, 1703 (1996) + Hartwigsen et al., PRB 58, 3641 (1998) + Krack, TCA 114, 145 (2005) + + Gaussian exponent of the core charge distribution: 12.500000 + Electronic configuration (s p d ...): 1 + + Parameters of the local part of the GTH pseudopotential: + + rloc C1 C2 C3 C4 + 0.200000 -4.178900 0.724463 + + 2. Atomic kind: C Number of atoms: 1 + + Orbital Basis Set DZVP-MOLOPT-SR-GTH + + Number of orbital shell sets: 1 + Number of orbital shells: 5 + Number of primitive Cartesian functions: 5 + Number of Cartesian basis functions: 14 + Number of spherical basis functions: 13 + Norm type: 2 + + Normalised Cartesian orbitals: + + Set Shell Orbital Exponent Coefficient + + 1 1 2s 5.605331 0.322515 + 2.113016 0.213043 + 0.769911 -0.209686 + 0.348157 -0.219794 + 0.128212 -0.022789 + + 1 2 3s 5.605331 0.552234 + 2.113016 0.082072 + 0.769911 0.007843 + 0.348157 0.136893 + 0.128212 0.074283 + + 1 3 3px 5.605331 -0.703879 + 2.113016 -0.642521 + 0.769911 -0.374851 + 0.348157 -0.139743 + 0.128212 -0.027849 + 1 3 3py 5.605331 -0.703879 + 2.113016 -0.642521 + 0.769911 -0.374851 + 0.348157 -0.139743 + 0.128212 -0.027849 + 1 3 3pz 5.605331 -0.703879 + 2.113016 -0.642521 + 0.769911 -0.374851 + 0.348157 -0.139743 + 0.128212 -0.027849 + + 1 4 4px 5.605331 -0.480376 + 2.113016 -0.552894 + 0.769911 -0.316145 + 0.348157 0.210505 + 0.128212 0.076095 + 1 4 4py 5.605331 -0.480376 + 2.113016 -0.552894 + 0.769911 -0.316145 + 0.348157 0.210505 + 0.128212 0.076095 + 1 4 4pz 5.605331 -0.480376 + 2.113016 -0.552894 + 0.769911 -0.316145 + 0.348157 0.210505 + 0.128212 0.076095 + + 1 5 4dx2 5.605331 0.640026 + 2.113016 0.274300 + 0.769911 0.446711 + 0.348157 0.028674 + 0.128212 0.029790 + 1 5 4dxy 5.605331 1.108557 + 2.113016 0.475102 + 0.769911 0.773726 + 0.348157 0.049666 + 0.128212 0.051599 + 1 5 4dxz 5.605331 1.108557 + 2.113016 0.475102 + 0.769911 0.773726 + 0.348157 0.049666 + 0.128212 0.051599 + 1 5 4dy2 5.605331 0.640026 + 2.113016 0.274300 + 0.769911 0.446711 + 0.348157 0.028674 + 0.128212 0.029790 + 1 5 4dyz 5.605331 1.108557 + 2.113016 0.475102 + 0.769911 0.773726 + 0.348157 0.049666 + 0.128212 0.051599 + 1 5 4dz2 5.605331 0.640026 + 2.113016 0.274300 + 0.769911 0.446711 + 0.348157 0.028674 + 0.128212 0.029790 + + GTH Potential information for GTH-PBE-q4 + + Description: Goedecker-Teter-Hutter pseudopotential + Goedecker et al., PRB 54, 1703 (1996) + Hartwigsen et al., PRB 58, 3641 (1998) + Krack, TCA 114, 145 (2005) + + Gaussian exponent of the core charge distribution: 4.364419 + Electronic configuration (s p d ...): 2 2 + + Parameters of the local part of the GTH pseudopotential: + + rloc C1 C2 C3 C4 + 0.338471 -8.803674 1.339211 + + Parameters of the non-local part of the GTH pseudopotential: + + l r(l) h(i,j,l) + + 0 0.302576 9.622487 + 1 0.291507 + + + MOLECULE KIND INFORMATION + + + All atoms are their own molecule, skipping detailed information + + + TOTAL NUMBERS AND MAXIMUM NUMBERS + + Total number of - Atomic kinds: 2 + - Atoms: 5 + - Shell sets: 5 + - Shells: 17 + - Primitive Cartesian functions: 25 + - Cartesian basis functions: 34 + - Spherical basis functions: 33 + + Maximum angular momentum of- Orbital basis functions: 2 + - Local part of the GTH pseudopotential: 2 + - Non-local part of the GTH pseudopotential: 0 + + + MODULE QUICKSTEP: ATOMIC COORDINATES IN angstrom + + Atom Kind Element X Y Z Z(eff) Mass + + 1 1 H 1 5.701910 3.809600 4.388450 1.00 1.0079 + 2 1 H 1 4.446010 4.656810 5.381950 1.00 1.0079 + 3 1 H 1 4.492160 4.909910 3.577560 1.00 1.0079 + 4 1 H 1 5.838250 5.622280 4.610680 1.00 1.0079 + 5 2 C 6 5.116660 4.755330 4.461230 4.00 12.0107 + + + + + SCF PARAMETERS Density guess: RESTART + -------------------------------------------------------- + max_scf: 50 + max_scf_history: 0 + max_diis: 4 + -------------------------------------------------------- + eps_scf: 1.00E-06 + eps_scf_history: 0.00E+00 + eps_diis: 1.00E-01 + eps_eigval: 1.00E-05 + -------------------------------------------------------- + level_shift [a.u.]: 0.00 + -------------------------------------------------------- + Outer loop SCF in use + No variables optimised in outer loop + eps_scf 1.00E-06 + max_scf 15 + No outer loop optimization + step_size 5.00E-01 + + PW_GRID| Information for grid number 1 + PW_GRID| Grid distributed over 2 processors + PW_GRID| Real space group dimensions 2 1 + PW_GRID| the grid is blocked: NO + PW_GRID| Cutoff [a.u.] 400.0 + PW_GRID| spherical cutoff: NO + PW_GRID| Bounds 1 -90 89 Points: 180 + PW_GRID| Bounds 2 -90 89 Points: 180 + PW_GRID| Bounds 3 -90 89 Points: 180 + PW_GRID| Volume element (a.u.^3) 0.1157E-02 Volume (a.u.^3) 6748.3346 + PW_GRID| Grid span FULLSPACE + PW_GRID| Distribution Average Max Min + PW_GRID| G-Vectors 2916000.0 2916000 2916000 + PW_GRID| G-Rays 16200.0 16200 16200 + PW_GRID| Real Space Points 2916000.0 2916000 2916000 + + PW_GRID| Information for grid number 2 + PW_GRID| Number of the reference grid 1 + PW_GRID| Grid distributed over 2 processors + PW_GRID| Real space group dimensions 2 1 + PW_GRID| the grid is blocked: NO + PW_GRID| Cutoff [a.u.] 133.3 + PW_GRID| spherical cutoff: NO + PW_GRID| Bounds 1 -50 49 Points: 100 + PW_GRID| Bounds 2 -50 49 Points: 100 + PW_GRID| Bounds 3 -50 49 Points: 100 + PW_GRID| Volume element (a.u.^3) 0.6748E-02 Volume (a.u.^3) 6748.3346 + PW_GRID| Grid span FULLSPACE + PW_GRID| Distribution Average Max Min + PW_GRID| G-Vectors 500000.0 500100 499900 + PW_GRID| G-Rays 5000.0 5001 4999 + PW_GRID| Real Space Points 500000.0 500000 500000 + + PW_GRID| Information for grid number 3 + PW_GRID| Number of the reference grid 1 + PW_GRID| Grid distributed over 2 processors + PW_GRID| Real space group dimensions 2 1 + PW_GRID| the grid is blocked: NO + PW_GRID| Cutoff [a.u.] 44.4 + PW_GRID| spherical cutoff: NO + PW_GRID| Bounds 1 -30 29 Points: 60 + PW_GRID| Bounds 2 -30 29 Points: 60 + PW_GRID| Bounds 3 -30 29 Points: 60 + PW_GRID| Volume element (a.u.^3) 0.3124E-01 Volume (a.u.^3) 6748.3346 + PW_GRID| Grid span FULLSPACE + PW_GRID| Distribution Average Max Min + PW_GRID| G-Vectors 108000.0 108060 107940 + PW_GRID| G-Rays 1800.0 1801 1799 + PW_GRID| Real Space Points 108000.0 108000 108000 + + PW_GRID| Information for grid number 4 + PW_GRID| Number of the reference grid 1 + PW_GRID| Grid distributed over 2 processors + PW_GRID| Real space group dimensions 2 1 + PW_GRID| the grid is blocked: NO + PW_GRID| Cutoff [a.u.] 14.8 + PW_GRID| spherical cutoff: NO + PW_GRID| Bounds 1 -18 17 Points: 36 + PW_GRID| Bounds 2 -18 17 Points: 36 + PW_GRID| Bounds 3 -18 17 Points: 36 + PW_GRID| Volume element (a.u.^3) 0.1446 Volume (a.u.^3) 6748.3346 + PW_GRID| Grid span FULLSPACE + PW_GRID| Distribution Average Max Min + PW_GRID| G-Vectors 23328.0 23364 23292 + PW_GRID| G-Rays 648.0 649 647 + PW_GRID| Real Space Points 23328.0 23328 23328 + + PW_GRID| Information for grid number 5 + PW_GRID| Number of the reference grid 1 + PW_GRID| Grid distributed over 2 processors + PW_GRID| Real space group dimensions 2 1 + PW_GRID| the grid is blocked: NO + PW_GRID| Cutoff [a.u.] 4.9 + PW_GRID| spherical cutoff: NO + PW_GRID| Bounds 1 -10 9 Points: 20 + PW_GRID| Bounds 2 -10 9 Points: 20 + PW_GRID| Bounds 3 -10 9 Points: 20 + PW_GRID| Volume element (a.u.^3) 0.8435 Volume (a.u.^3) 6748.3346 + PW_GRID| Grid span FULLSPACE + PW_GRID| Distribution Average Max Min + PW_GRID| G-Vectors 4000.0 4020 3980 + PW_GRID| G-Rays 200.0 201 199 + PW_GRID| Real Space Points 4000.0 4000 4000 + + POISSON| Solver PERIODIC + POISSON| Periodicity XYZ + + RS_GRID| Information for grid number 1 + RS_GRID| Bounds 1 -90 89 Points: 180 + RS_GRID| Bounds 2 -90 89 Points: 180 + RS_GRID| Bounds 3 -90 89 Points: 180 + RS_GRID| Real space fully replicated + RS_GRID| Group size 1 + + RS_GRID| Information for grid number 2 + RS_GRID| Bounds 1 -50 49 Points: 100 + RS_GRID| Bounds 2 -50 49 Points: 100 + RS_GRID| Bounds 3 -50 49 Points: 100 + RS_GRID| Real space fully replicated + RS_GRID| Group size 1 + + RS_GRID| Information for grid number 3 + RS_GRID| Bounds 1 -30 29 Points: 60 + RS_GRID| Bounds 2 -30 29 Points: 60 + RS_GRID| Bounds 3 -30 29 Points: 60 + RS_GRID| Real space fully replicated + RS_GRID| Group size 1 + + RS_GRID| Information for grid number 4 + RS_GRID| Bounds 1 -18 17 Points: 36 + RS_GRID| Bounds 2 -18 17 Points: 36 + RS_GRID| Bounds 3 -18 17 Points: 36 + RS_GRID| Real space fully replicated + RS_GRID| Group size 1 + + RS_GRID| Information for grid number 5 + RS_GRID| Bounds 1 -10 9 Points: 20 + RS_GRID| Bounds 2 -10 9 Points: 20 + RS_GRID| Bounds 3 -10 9 Points: 20 + RS_GRID| Real space fully replicated + RS_GRID| Group size 1 + + MD| Molecular Dynamics Protocol + MD| Ensemble Type NVT + MD| Number of Time Steps 1000 + MD| Time Step [fs] 0.50 + MD| Temperature [K] 330.00 + MD| Temperature tolerance [K] 0.00 + MD| Print MD information every 1 step(s) + MD| File type Print frequency[steps] File names + MD| Coordinates 1 DPGEN-pos-1.xyz + MD| Velocities 1 DPGEN-vel-1.xyz + MD| Energies 1 DPGEN-1.ener + MD| Dump 1 DPGEN-1.restart + + ROT| Rotational Analysis Info + ROT| Principal axes and moments of inertia in atomic units: + ROT| 1 2 3 + ROT| EIGENVALUES 0.216483222E+05 0.220861047E+05 0.223771949E+05 + ROT| X -0.742121006 0.567492132 -0.356663837 + ROT| Y -0.632198167 -0.415866256 0.653743631 + ROT| Z 0.222669912 0.710639105 0.667390570 + ROT| Number of Rotovibrational vectors: 6 + + Calculation of degrees of freedom + Number of atoms: 5 + Number of Intramolecular constraints: 0 + Number of Intermolecular constraints: 0 + Invariants(translation + rotations): 3 + Degrees of freedom: 12 + + + Restraints Information + Number of Intramolecular restraints: 0 + Number of Intermolecular restraints: 0 + + THERMOSTAT| Thermostat Info for PARTICLES + THERMOSTAT| Type of thermostat Nose-Hoover-Chains + THERMOSTAT| Nose-Hoover-Chain length 3 + THERMOSTAT| Nose-Hoover-Chain time constant [ fs] 1000.00 + THERMOSTAT| Order of Yoshida integrator 3 + THERMOSTAT| Number of multiple time steps 2 + THERMOSTAT| Initial Potential Energy 0.000000 + THERMOSTAT| Initial Kinetic Energy 0.000523 + THERMOSTAT| End of Thermostat Info for PARTICLES + + ************************** Velocities initialization ************************** + Initial Temperature 330.00 K + COM velocity: -0.000000000000 0.000000000000 0.000000000000 + ******************************************************************************* + + + Spin 1 + + Number of electrons: 4 + Number of occupied orbitals: 4 + Number of molecular orbitals: 4 + + Spin 2 + + Number of electrons: 4 + Number of occupied orbitals: 4 + Number of molecular orbitals: 4 + + Number of orbital functions: 33 + Number of independent orbital functions: 33 + + Extrapolation method: initial_guess + + *** WARNING in qs_initial_guess.F:280 :: User requested to restart the *** + *** wavefunction from the file named: DPGEN-RESTART.wfn. This file does *** + *** not exist. Please check the existence of the file or change properly *** + *** the value of the keyword WFN_RESTART_FILE_NAME. Calculation continues *** + *** using ATOMIC GUESS. *** + + + Atomic guess: The first density matrix is obtained in terms of atomic orbitals + and electronic configurations assigned to each atomic kind + + Guess for atomic kind: H + + Electronic structure + Total number of core electrons 0.00 + Total number of valence electrons 1.00 + Total number of electrons 1.00 + Multiplicity not specified + S 1.00 + + + ******************************************************************************* + Iteration Convergence Energy [au] + ******************************************************************************* + 1 0.250972E-02 -0.375256815885 + 2 0.570752E-04 -0.375258666164 + 3 0.832405E-09 -0.375258667122 + + Energy components [Hartree] Total Energy :: -0.375258667122 + Band Energy :: -0.076317618391 + Kinetic Energy :: 0.771356566341 + Potential Energy :: -1.146615233463 + Virial (-V/T) :: 1.486491829455 + Core Energy :: -0.456090715790 + XC Energy :: -0.314218627334 + Coulomb Energy :: 0.395050676003 + Total Pseudopotential Energy :: -1.238482237174 + Local Pseudopotential Energy :: -1.238482237174 + Nonlocal Pseudopotential Energy :: 0.000000000000 + Confinement :: 0.110349550431 + + Orbital energies State L Occupation Energy[a.u.] Energy[eV] + + 1 0 1.000 -0.076318 -2.076708 + + + Total Electron Density at R=0: 0.425022 + + Guess for atomic kind: C + + Electronic structure + Total number of core electrons 2.00 + Total number of valence electrons 4.00 + Total number of electrons 6.00 + Multiplicity not specified + S [ 2.00] 2.00 + P 2.00 + + + ******************************************************************************* + Iteration Convergence Energy [au] + ******************************************************************************* + 1 0.261814E-01 -5.246264729087 + 2 0.905236E-02 -5.246529568708 + 3 0.681743E-04 -5.246565167452 + 4 0.792828E-08 -5.246565169473 + + Energy components [Hartree] Total Energy :: -5.246565169473 + Band Energy :: -1.058732595430 + Kinetic Energy :: 3.518928170589 + Potential Energy :: -8.765493340062 + Virial (-V/T) :: 2.490955460053 + Core Energy :: -8.429377169956 + XC Energy :: -1.450183342358 + Coulomb Energy :: 4.632995342842 + Total Pseudopotential Energy :: -11.978048809389 + Local Pseudopotential Energy :: -12.816738187351 + Nonlocal Pseudopotential Energy :: 0.838689377962 + Confinement :: 0.297434688432 + + Orbital energies State L Occupation Energy[a.u.] Energy[eV] + + 1 0 2.000 -0.410911 -11.181458 + + 1 1 2.000 -0.118455 -3.223332 + + + Total Electron Density at R=0: 0.001337 + + Spin 1 + Re-scaling the density matrix to get the right number of electrons for spin 1 + # Electrons Trace(P) Scaling factor + 4 4.000 1.000 + + Spin 2 + Re-scaling the density matrix to get the right number of electrons for spin 2 + # Electrons Trace(P) Scaling factor + 4 4.000 1.000 + + + SCF WAVEFUNCTION OPTIMIZATION + + ----------------------------------- OT --------------------------------------- + Minimizer : CG : conjugate gradient + Preconditioner : FULL_SINGLE_INVERSE : inversion of + H + eS - 2*(Sc)(c^T*H*c+const)(Sc)^T + Precond_solver : DEFAULT + Line search : 2PNT : 2 energies, one gradient + stepsize : 0.08000000 energy_gap : 0.10000000 + eps_taylor : 0.10000E-15 max_taylor : 4 + ----------------------------------- OT --------------------------------------- + + Step Update method Time Convergence Total energy Change + ------------------------------------------------------------------------------ + 1 OT CG 0.80E-01 5.8 0.16309387 -6.6209144114 -6.62E+00 + 2 OT LS 0.32E+00 3.7 -7.2198029370 + 3 OT CG 0.32E+00 6.8 0.12107594 -7.8257382804 -1.20E+00 + 4 OT LS 0.11E+00 3.7 -7.3032128668 + 5 OT CG 0.11E+00 6.7 0.04314211 -8.0196676671 -1.94E-01 + 6 OT LS 0.18E+00 3.6 -8.0486136263 + 7 OT CG 0.18E+00 6.8 0.02792014 -8.0537532003 -3.41E-02 + 8 OT LS 0.11E+00 3.6 -8.0610511224 + 9 OT CG 0.11E+00 6.8 0.01112340 -8.0654899121 -1.17E-02 + 10 OT LS 0.22E+00 3.6 -8.0682611398 + 11 OT CG 0.22E+00 6.8 0.00902394 -8.0691557190 -3.67E-03 + 12 OT LS 0.24E+00 3.7 -8.0717170193 + 13 OT CG 0.24E+00 6.8 0.00333590 -8.0717260734 -2.57E-03 + 14 OT LS 0.21E+00 3.7 -8.0720288152 + 15 OT CG 0.21E+00 6.8 0.00203883 -8.0720345928 -3.09E-04 + 16 OT LS 0.17E+00 3.7 -8.0721190578 + 17 OT CG 0.17E+00 6.8 0.00127595 -8.0721256454 -9.11E-05 + 18 OT LS 0.21E+00 3.7 -8.0721682500 + 19 OT CG 0.21E+00 6.8 0.00063018 -8.0721699192 -4.43E-05 + 20 OT LS 0.30E+00 3.7 -8.0721841084 + 21 OT CG 0.30E+00 6.8 0.00035028 -8.0721856651 -1.57E-05 + 22 OT LS 0.16E+00 3.7 -8.0721861293 + 23 OT CG 0.16E+00 6.8 0.00019721 -8.0721882207 -2.56E-06 + 24 OT LS 0.19E+00 3.7 -8.0721891785 + 25 OT CG 0.19E+00 6.8 0.00012454 -8.0721892116 -9.91E-07 + 26 OT LS 0.20E+00 3.7 -8.0721896125 + 27 OT CG 0.20E+00 6.8 0.00004540 -8.0721896126 -4.01E-07 + 28 OT LS 0.26E+00 3.7 -8.0721896790 + 29 OT CG 0.26E+00 6.8 0.00003391 -8.0721896833 -7.08E-08 + 30 OT LS 0.19E+00 3.7 -8.0721897082 + 31 OT CG 0.19E+00 6.8 0.00001930 -8.0721897122 -2.88E-08 + 32 OT LS 0.14E+00 3.7 -8.0721897178 + 33 OT CG 0.14E+00 6.8 0.00000727 -8.0721897189 -6.70E-09 + 34 OT LS 0.40E+00 3.7 -8.0721897205 + 35 OT CG 0.40E+00 6.8 0.00000384 -8.0721897217 -2.80E-09 + 36 OT LS 0.13E+00 3.7 -8.0721897207 + 37 OT CG 0.13E+00 6.8 0.00000169 -8.0721897219 -2.44E-10 + 38 OT LS 0.22E+00 3.7 -8.0721897220 + 39 OT CG 0.22E+00 6.9 0.00000135 -8.0721897220 -8.42E-11 + 40 OT LS 0.22E+00 3.7 -8.0721897221 + 41 OT CG 0.22E+00 6.8 0.00000045 -8.0721897221 -5.22E-11 + + *** SCF run converged in 41 steps *** + + + Electronic density on regular grids: -8.0000000000 0.0000000000 + Core density on regular grids: 8.0000000000 -0.0000000000 + Total charge density on r-space grids: -0.0000000000 + Total charge density g-space grids: -0.0000000000 + + Overlap energy of the core charge distribution: 0.00000060488486 + Self energy of the core charge distribution: -18.97690376224277 + Core Hamiltonian energy: 6.07548672859658 + Hartree energy: 7.96826798812964 + Exchange-correlation energy: -3.13893926220274 + Dispersion energy: -0.00010201921799 + + Total energy: -8.07218972205243 + + outer SCF iter = 1 RMS gradient = 0.45E-06 energy = -8.0721897221 + outer SCF loop converged in 1 iterations or 41 steps + + + Integrated absolute spin density : 0.0000000000 + Ideal and single determinant S**2 : 0.000000 0.000000 + + !-----------------------------------------------------------------------------! + Mulliken Population Analysis + + # Atom Element Kind Atomic population (alpha,beta) Net charge Spin moment + 1 H 1 0.453691 0.453691 0.092619 0.000000 + 2 H 1 0.448827 0.448827 0.102345 -0.000000 + 3 H 1 0.457921 0.457921 0.084159 0.000000 + 4 H 1 0.450156 0.450156 0.099689 -0.000000 + 5 C 2 2.189406 2.189406 -0.378812 0.000000 + # Total charge and spin 4.000000 4.000000 0.000000 0.000000 + + !-----------------------------------------------------------------------------! + + !-----------------------------------------------------------------------------! + Hirshfeld Charges + + #Atom Element Kind Ref Charge Population Spin moment Net charge + 1 H 1 1.000 0.275 0.275 0.000 0.450 + 2 H 1 1.000 0.275 0.275 -0.000 0.449 + 3 H 1 1.000 0.274 0.274 0.000 0.452 + 4 H 1 1.000 0.275 0.275 -0.000 0.451 + 5 C 2 4.000 2.897 2.897 0.000 -1.793 + + Total Charge 0.009 + !-----------------------------------------------------------------------------! + + ENERGY| Total FORCE_EVAL ( QS ) energy (a.u.): -8.072189722059207 + + + ATOMIC FORCES in [a.u.] + + # Atom Kind Element X Y Z + 1 1 H -0.00533566 0.00916476 -0.00265874 + 2 1 H 0.01488177 0.00488935 -0.02060262 + 3 1 H 0.00049369 0.00023015 -0.00246459 + 4 1 H -0.01659385 -0.01755977 -0.00363980 + 5 2 C 0.00654935 0.00328103 0.02935690 + SUM OF ATOMIC FORCES -0.00000470 0.00000552 -0.00000885 0.00001144 + + STRESS TENSOR [GPa] + + X Y Z + X -0.20920635 -0.08840301 0.09206018 + Y -0.08840301 -0.20055441 0.00829966 + Z 0.09206018 0.00829966 -0.14127562 + + 1/3 Trace(stress tensor): -1.83678792E-01 + + Det(stress tensor) : -3.24442210E-03 + + + EIGENVECTORS AND EIGENVALUES OF THE STRESS TENSOR + + -0.32466960 -0.16626336 -0.06010342 + + 0.73585722 -0.23462705 0.63518840 + 0.55049298 0.75351613 -0.35940356 + -0.39429891 0.61413646 0.68364083 + + ============================================================================== + Stress Tensor Components (GPW/GAPW) + 1/3 Trace Determinant + Kinetic Energy Stress 0.88428302 0.45035401 + Basis Overlap Stress 0.30664081 0.01935491 + ES + XC Stress -13.86819442 -2661.98970254 + vdW correction (ff) Stress 0.00010142 -0.00000000 + Local Pseudopotential/Core Stress -0.15860983 -0.00299890 + Nonlocal Pseudopotential Stress 0.13961618 0.00136543 + Exact Exchange Stress -0.00000000 -0.00000000 + Sum of Parts Stress -12.69616283 -2046.49137977 + Total Stress -0.04213064 -0.00003915 + ============================================================================== + + MD_ENERGIES| Initialization proceeding + + + ******************************** GO CP2K GO! ********************************** + INITIAL POTENTIAL ENERGY[hartree] = -0.807218972206E+01 + INITIAL KINETIC ENERGY[hartree] = 0.627029437971E-02 + INITIAL TEMPERATURE[K] = 330.000 + INITIAL PRESSURE[bar] = -0.165454206941E+04 + INITIAL VOLUME[bohr^3] = 0.674833458309E+04 + INITIAL CELL LNTHS[bohr] = 0.1889726E+02 0.1889726E+02 0.1889726E+02 + INITIAL CELL ANGLS[deg] = 0.9000000E+02 0.9000000E+02 0.9000000E+02 + ******************************** GO CP2K GO! ********************************** + + Spin 1 + + Number of electrons: 4 + Number of occupied orbitals: 4 + Number of molecular orbitals: 4 + + Spin 2 + + Number of electrons: 4 + Number of occupied orbitals: 4 + Number of molecular orbitals: 4 + + Number of orbital functions: 33 + Number of independent orbital functions: 33 + + Parameters for the always stable predictor-corrector (ASPC) method: + + ASPC order: 0 + + B(1) = 1.000000 + + Parameters for the always stable predictor-corrector (ASPC) method: + + ASPC order: 0 + + B(1) = 1.000000 + + Extrapolation method: ASPC + + + SCF WAVEFUNCTION OPTIMIZATION + + ----------------------------------- OT --------------------------------------- + Minimizer : CG : conjugate gradient + Preconditioner : FULL_SINGLE_INVERSE : inversion of + H + eS - 2*(Sc)(c^T*H*c+const)(Sc)^T + Precond_solver : DEFAULT + Line search : 2PNT : 2 energies, one gradient + stepsize : 0.08000000 energy_gap : 0.10000000 + eps_taylor : 0.10000E-15 max_taylor : 4 + ----------------------------------- OT --------------------------------------- + + Step Update method Time Convergence Total energy Change + ------------------------------------------------------------------------------ + 1 OT CG 0.80E-01 6.0 0.00089623 -8.0720302895 -8.07E+00 + 2 OT LS 0.32E+00 3.7 -8.0720459055 + 3 OT CG 0.32E+00 7.2 0.00036808 -8.0720765754 -4.63E-05 + 4 OT LS 0.58E+00 3.7 -8.0720848600 + 5 OT CG 0.58E+00 7.2 0.00008180 -8.0720869359 -1.04E-05 + 6 OT LS 0.35E+00 3.7 -8.0720871157 + 7 OT CG 0.35E+00 7.2 0.00002705 -8.0720872463 -3.10E-07 + 8 OT LS 0.43E+00 3.7 -8.0720872867 + 9 OT CG 0.43E+00 7.3 0.00000497 -8.0720872882 -4.19E-08 + 10 OT LS 0.47E+00 3.7 -8.0720872897 + 11 OT CG 0.47E+00 7.2 0.00000090 -8.0720872897 -1.52E-09 + + *** SCF run converged in 11 steps *** + + + Electronic density on regular grids: -8.0000000000 0.0000000000 + Core density on regular grids: 8.0000000000 -0.0000000000 + Total charge density on r-space grids: -0.0000000000 + Total charge density g-space grids: -0.0000000000 + + Overlap energy of the core charge distribution: 0.00000072319341 + Self energy of the core charge distribution: -18.97690376224277 + Core Hamiltonian energy: 6.08867770219830 + Hartree energy: 7.95938995450466 + Exchange-correlation energy: -3.14315180438736 + Dispersion energy: -0.00010010297816 + + Total energy: -8.07208728971193 + + outer SCF iter = 1 RMS gradient = 0.90E-06 energy = -8.0720872897 + outer SCF loop converged in 1 iterations or 11 steps + + + Integrated absolute spin density : 0.0000000000 + Ideal and single determinant S**2 : 0.000000 0.000000 + + !-----------------------------------------------------------------------------! + Mulliken Population Analysis + + # Atom Element Kind Atomic population (alpha,beta) Net charge Spin moment + 1 H 1 0.452813 0.452813 0.094373 0.000000 + 2 H 1 0.450045 0.450045 0.099911 -0.000000 + 3 H 1 0.459962 0.459962 0.080075 0.000000 + 4 H 1 0.449329 0.449329 0.101342 0.000000 + 5 C 2 2.187851 2.187851 -0.375701 -0.000000 + # Total charge and spin 4.000000 4.000000 0.000000 0.000000 + + !-----------------------------------------------------------------------------! + + !-----------------------------------------------------------------------------! + Hirshfeld Charges + + #Atom Element Kind Ref Charge Population Spin moment Net charge + 1 H 1 1.000 0.275 0.275 0.000 0.450 + 2 H 1 1.000 0.275 0.275 -0.000 0.450 + 3 H 1 1.000 0.274 0.274 0.000 0.452 + 4 H 1 1.000 0.275 0.275 -0.000 0.451 + 5 C 2 4.000 2.897 2.897 0.000 -1.793 + + Total Charge 0.009 + !-----------------------------------------------------------------------------! + + ENERGY| Total FORCE_EVAL ( QS ) energy (a.u.): -8.072087289768190 + + + ATOMIC FORCES in [a.u.] + + # Atom Kind Element X Y Z + 1 1 H -0.00629045 0.01003105 -0.00121353 + 2 1 H 0.01360681 0.00493613 -0.01681934 + 3 1 H -0.00477713 0.00281191 -0.01003648 + 4 1 H -0.01940913 -0.01861480 -0.00347912 + 5 2 C 0.01686665 0.00084228 0.03153953 + SUM OF ATOMIC FORCES -0.00000324 0.00000657 -0.00000893 0.00001156 + + STRESS TENSOR [GPa] + + X Y Z + X -0.19993442 -0.10575316 0.11681854 + Y -0.10575316 -0.21120119 -0.01292632 + Z 0.11681854 -0.01292632 -0.05637062 + + 1/3 Trace(stress tensor): -1.55835409E-01 + + Det(stress tensor) : 1.48506701E-03 + + + EIGENVECTORS AND EIGENVALUES OF THE STRESS TENSOR + + -0.33259904 -0.16240108 0.02749389 + + 0.73785411 0.40653054 0.53879888 + 0.61259237 -0.73849242 -0.28170823 + -0.28337589 -0.53792366 0.79393718 + + ============================================================================== + Stress Tensor Components (GPW/GAPW) + 1/3 Trace Determinant + Kinetic Energy Stress 0.88406855 0.44347174 + Basis Overlap Stress 0.30613857 0.01897587 + ES + XC Stress -13.84490052 -2648.41953015 + vdW correction (ff) Stress 0.00009764 -0.00000000 + Local Pseudopotential/Core Stress -0.15864544 -0.00299735 + Nonlocal Pseudopotential Stress 0.13859814 0.00133305 + Exact Exchange Stress -0.00000000 -0.00000000 + Sum of Parts Stress -12.67464307 -2036.10773449 + Total Stress -0.03574417 0.00001792 + ============================================================================== + + Centre of mass motion (COM): x = -0.0000000028 + y = 0.0000000043 + z = -0.0000000063 + + ******************************************************************************* + ENSEMBLE TYPE = NVT + STEP NUMBER = 1 + TIME [fs] = 0.500000 + CONSERVED QUANTITY [hartree] = -0.806539374325E+01 + + INSTANTANEOUS AVERAGES + CPU TIME [s] = 295.13 295.13 + ENERGY DRIFT PER ATOM [K] = 0.199562966393E+00 0.000000000000E+00 + POTENTIAL ENERGY[hartree] = -0.807208728977E+01 -0.807208728977E+01 + KINETIC ENERGY [hartree] = 0.616925279965E-02 0.616925279965E-02 + TEMPERATURE [K] = 324.682 324.682 + PRESSURE [bar] = -0.137904500423E+04 -0.137904500423E+04 + ******************************************************************************* + + + Spin 1 + + Number of electrons: 4 + Number of occupied orbitals: 4 + Number of molecular orbitals: 4 + + Spin 2 + + Number of electrons: 4 + Number of occupied orbitals: 4 + Number of molecular orbitals: 4 + + Number of orbital functions: 33 + Number of independent orbital functions: 33 + + Parameters for the always stable predictor-corrector (ASPC) method: + + ASPC order: 0 + + B(1) = 2.000000 + B(2) = -1.000000 + + Parameters for the always stable predictor-corrector (ASPC) method: + + ASPC order: 0 + + B(1) = 2.000000 + B(2) = -1.000000 + + Extrapolation method: ASPC + + + SCF WAVEFUNCTION OPTIMIZATION + + ----------------------------------- OT --------------------------------------- + Minimizer : CG : conjugate gradient + Preconditioner : FULL_SINGLE_INVERSE : inversion of + H + eS - 2*(Sc)(c^T*H*c+const)(Sc)^T + Precond_solver : DEFAULT + Line search : 2PNT : 2 energies, one gradient + stepsize : 0.08000000 energy_gap : 0.10000000 + eps_taylor : 0.10000E-15 max_taylor : 4 + ----------------------------------- OT --------------------------------------- + + Step Update method Time Convergence Total energy Change + ------------------------------------------------------------------------------ + 1 OT CG 0.80E-01 6.0 0.00021041 -8.0719292191 -8.07E+00 + 2 OT LS 0.32E+00 3.7 -8.0719300731 + 3 OT CG 0.32E+00 7.2 0.00008134 -8.0719316621 -2.44E-06 + 4 OT LS 0.53E+00 3.7 -8.0719320538 + 5 OT CG 0.53E+00 7.2 0.00002174 -8.0719321291 -4.67E-07 + 6 OT LS 0.32E+00 3.7 -8.0719321399 + 7 OT CG 0.32E+00 7.2 0.00000564 -8.0719321490 -1.99E-08 + 8 OT LS 0.51E+00 3.7 -8.0719321508 + 9 OT CG 0.51E+00 7.2 0.00000080 -8.0719321511 -2.13E-09 + + *** SCF run converged in 9 steps *** + + + Electronic density on regular grids: -8.0000000000 0.0000000000 + Core density on regular grids: 8.0000000000 -0.0000000000 + Total charge density on r-space grids: -0.0000000000 + Total charge density g-space grids: -0.0000000000 + + Overlap energy of the core charge distribution: 0.00000088971393 + Self energy of the core charge distribution: -18.97690376224277 + Core Hamiltonian energy: 6.10699476517380 + Hartree energy: 7.94707489628505 + Exchange-correlation energy: -3.14900153941365 + Dispersion energy: -0.00009740063876 + + Total energy: -8.07193215112240 + + outer SCF iter = 1 RMS gradient = 0.80E-06 energy = -8.0719321511 + outer SCF loop converged in 1 iterations or 9 steps + + + Integrated absolute spin density : 0.0000000000 + Ideal and single determinant S**2 : 0.000000 0.000000 + + !-----------------------------------------------------------------------------! + Mulliken Population Analysis + + # Atom Element Kind Atomic population (alpha,beta) Net charge Spin moment + 1 H 1 0.452079 0.452079 0.095842 0.000000 + 2 H 1 0.451671 0.451671 0.096658 0.000000 + 3 H 1 0.461590 0.461590 0.076820 0.000000 + 4 H 1 0.448962 0.448962 0.102075 0.000000 + 5 C 2 2.185698 2.185698 -0.371396 -0.000000 + # Total charge and spin 4.000000 4.000000 0.000000 0.000000 + + !-----------------------------------------------------------------------------! + + !-----------------------------------------------------------------------------! + Hirshfeld Charges + + #Atom Element Kind Ref Charge Population Spin moment Net charge + 1 H 1 1.000 0.275 0.275 0.000 0.449 + 2 H 1 1.000 0.275 0.275 0.000 0.451 + 3 H 1 1.000 0.274 0.274 0.000 0.451 + 4 H 1 1.000 0.274 0.274 0.000 0.451 + 5 C 2 4.000 2.897 2.897 0.000 -1.793 + + Total Charge 0.009 + !-----------------------------------------------------------------------------! + + ENERGY| Total FORCE_EVAL ( QS ) energy (a.u.): -8.071932151161576 + + + ATOMIC FORCES in [a.u.] + + # Atom Kind Element X Y Z + 1 1 H -0.00677949 0.01010313 0.00020196 + 2 1 H 0.01119260 0.00474772 -0.01170907 + 3 1 H -0.00948857 0.00514666 -0.01706629 + 4 1 H -0.02107859 -0.01833621 -0.00311106 + 5 2 C 0.02615231 -0.00165392 0.03167591 + SUM OF ATOMIC FORCES -0.00000173 0.00000737 -0.00000856 0.00001143 + + STRESS TENSOR [GPa] + + X Y Z + X -0.17902126 -0.11538205 0.13046427 + Y -0.11538205 -0.20621239 -0.03196494 + Z 0.13046427 -0.03196494 0.03372442 + + 1/3 Trace(stress tensor): -1.17169743E-01 + + Det(stress tensor) : 5.45120430E-03 + + + EIGENVECTORS AND EIGENVALUES OF THE STRESS TENSOR + + -0.32201603 -0.14568866 0.11619547 + + 0.72106150 0.50722777 0.47200667 + 0.66185889 -0.70576653 -0.25265869 + -0.20497101 -0.49458426 0.84461429 + + ============================================================================== + Stress Tensor Components (GPW/GAPW) + 1/3 Trace Determinant + Kinetic Energy Stress 0.88548913 0.43810388 + Basis Overlap Stress 0.30518535 0.01850431 + ES + XC Stress -13.81937888 -2633.59483644 + vdW correction (ff) Stress 0.00009313 -0.00000000 + Local Pseudopotential/Core Stress -0.15930746 -0.00302200 + Nonlocal Pseudopotential Stress 0.13808387 0.00131217 + Exact Exchange Stress -0.00000000 -0.00000000 + Sum of Parts Stress -12.64983486 -2024.17738065 + Total Stress -0.02687537 0.00006578 + ============================================================================== + + Centre of mass motion (COM): x = -0.0000000046 + y = 0.0000000092 + z = -0.0000000125 + + ******************************************************************************* + ENSEMBLE TYPE = NVT + STEP NUMBER = 2 + TIME [fs] = 1.000000 + CONSERVED QUANTITY [hartree] = -0.806538959252E+01 + + INSTANTANEOUS AVERAGES + CPU TIME [s] = 59.09 177.11 + ENERGY DRIFT PER ATOM [K] = 0.461701872753E+00 0.230850936376E+00 + POTENTIAL ENERGY[hartree] = -0.807193215116E+01 -0.807200972046E+01 + KINETIC ENERGY [hartree] = 0.601653173593E-02 0.609289226779E-02 + TEMPERATURE [K] = 316.645 320.663 + PRESSURE [bar] = -0.996827173891E+03 -0.118793608906E+04 + ******************************************************************************* + + + Spin 1 + + Number of electrons: 4 + Number of occupied orbitals: 4 + Number of molecular orbitals: 4 + + Spin 2 + + Number of electrons: 4 + Number of occupied orbitals: 4 + Number of molecular orbitals: 4 + + Number of orbital functions: 33 + Number of independent orbital functions: 33 + + Parameters for the always stable predictor-corrector (ASPC) method: + + ASPC order: 1 + + B(1) = 2.500000 + B(2) = -2.000000 + B(3) = 0.500000 + + Parameters for the always stable predictor-corrector (ASPC) method: + + ASPC order: 1 + + B(1) = 2.500000 + B(2) = -2.000000 + B(3) = 0.500000 + + Extrapolation method: ASPC + + + SCF WAVEFUNCTION OPTIMIZATION + + ----------------------------------- OT --------------------------------------- + Minimizer : CG : conjugate gradient + Preconditioner : FULL_SINGLE_INVERSE : inversion of + H + eS - 2*(Sc)(c^T*H*c+const)(Sc)^T + Precond_solver : DEFAULT + Line search : 2PNT : 2 energies, one gradient + stepsize : 0.08000000 energy_gap : 0.10000000 + eps_taylor : 0.10000E-15 max_taylor : 4 + ----------------------------------- OT --------------------------------------- + + Step Update method Time Convergence Total energy Change + ------------------------------------------------------------------------------ + 1 OT CG 0.80E-01 6.0 0.00012339 -8.0717897104 -8.07E+00 + 2 OT LS 0.32E+00 3.7 -8.0717900073 + 3 OT CG 0.32E+00 7.2 0.00005028 -8.0717906029 -8.93E-07 + 4 OT LS 0.57E+00 3.7 -8.0717907568 + 5 OT CG 0.57E+00 7.3 0.00000810 -8.0717907942 -1.91E-07 + 6 OT LS 0.45E+00 3.7 -8.0717907977 + 7 OT CG 0.45E+00 7.6 0.00000280 -8.0717907980 -3.85E-09 + 8 OT LS 0.35E+00 3.7 -8.0717907984 + 9 OT CG 0.35E+00 7.3 0.00000060 -8.0717907984 -3.62E-10 + + *** SCF run converged in 9 steps *** + + + Electronic density on regular grids: -8.0000000000 0.0000000000 + Core density on regular grids: 8.0000000000 -0.0000000000 + Total charge density on r-space grids: -0.0000000000 + Total charge density g-space grids: -0.0000000000 + + Overlap energy of the core charge distribution: 0.00000107929964 + Self energy of the core charge distribution: -18.97690376224277 + Core Hamiltonian energy: 6.12876853474300 + Hartree energy: 7.93241152261040 + Exchange-correlation energy: -3.15597403322292 + Dispersion energy: -0.00009413959363 + + Total energy: -8.07179079840628 + + outer SCF iter = 1 RMS gradient = 0.60E-06 energy = -8.0717907984 + outer SCF loop converged in 1 iterations or 9 steps + + + Integrated absolute spin density : 0.0000000000 + Ideal and single determinant S**2 : 0.000000 0.000000 + + !-----------------------------------------------------------------------------! + Mulliken Population Analysis + + # Atom Element Kind Atomic population (alpha,beta) Net charge Spin moment + 1 H 1 0.451517 0.451517 0.096966 -0.000000 + 2 H 1 0.453645 0.453645 0.092710 0.000000 + 3 H 1 0.462604 0.462604 0.074792 -0.000000 + 4 H 1 0.449097 0.449097 0.101806 0.000000 + 5 C 2 2.183137 2.183137 -0.366274 -0.000000 + # Total charge and spin 4.000000 4.000000 0.000000 -0.000000 + + !-----------------------------------------------------------------------------! + + !-----------------------------------------------------------------------------! + Hirshfeld Charges + + #Atom Element Kind Ref Charge Population Spin moment Net charge + 1 H 1 1.000 0.276 0.276 -0.000 0.449 + 2 H 1 1.000 0.274 0.274 0.000 0.451 + 3 H 1 1.000 0.275 0.275 -0.000 0.451 + 4 H 1 1.000 0.274 0.274 0.000 0.451 + 5 C 2 4.000 2.897 2.897 -0.000 -1.793 + + Total Charge 0.009 + !-----------------------------------------------------------------------------! + + ENERGY| Total FORCE_EVAL ( QS ) energy (a.u.): -8.071790798426767 + + + ATOMIC FORCES in [a.u.] + + # Atom Kind Element X Y Z + 1 1 H -0.00679123 0.00934884 0.00154463 + 2 1 H 0.00767768 0.00432893 -0.00545304 + 3 1 H -0.01303178 0.00708745 -0.02256959 + 4 1 H -0.02152791 -0.01672425 -0.00253265 + 5 2 C 0.03367283 -0.00403308 0.02900321 + SUM OF ATOMIC FORCES -0.00000040 0.00000789 -0.00000744 0.00001085 + + STRESS TENSOR [GPa] + + X Y Z + X -0.14818496 -0.11661027 0.12973363 + Y -0.11661027 -0.18566070 -0.04761087 + Z 0.12973363 -0.04761087 0.12018049 + + 1/3 Trace(stress tensor): -7.12217238E-02 + + Det(stress tensor) : 6.57347783E-03 + + + EIGENVECTORS AND EIGENVALUES OF THE STRESS TENSOR + + -0.29172514 -0.11607147 0.19413144 + + 0.69667709 0.58594254 0.41389899 + 0.70397579 -0.66942316 -0.23725667 + -0.13805479 -0.45666615 0.87886114 + + ============================================================================== + Stress Tensor Components (GPW/GAPW) + 1/3 Trace Determinant + Kinetic Energy Stress 0.88846385 0.43414515 + Basis Overlap Stress 0.30387681 0.01797464 + ES + XC Stress -13.79401212 -2618.89897910 + vdW correction (ff) Stress 0.00008815 -0.00000000 + Local Pseudopotential/Core Stress -0.16055756 -0.00306904 + Nonlocal Pseudopotential Stress 0.13814120 0.00130489 + Exact Exchange Stress -0.00000000 -0.00000000 + Sum of Parts Stress -12.62399967 -2011.80021019 + Total Stress -0.01633622 0.00007933 + ============================================================================== + + Centre of mass motion (COM): x = -0.0000000053 + y = 0.0000000146 + z = -0.0000000181 + + ******************************************************************************* + ENSEMBLE TYPE = NVT + STEP NUMBER = 3 + TIME [fs] = 1.500000 + CONSERVED QUANTITY [hartree] = -0.806538670524E+01 + + INSTANTANEOUS AVERAGES + CPU TIME [s] = 59.58 137.93 + ENERGY DRIFT PER ATOM [K] = 0.644048024676E+00 0.368583299143E+00 + POTENTIAL ENERGY[hartree] = -0.807179079843E+01 -0.807193674645E+01 + KINETIC ENERGY [hartree] = 0.587637473442E-02 0.602071975667E-02 + TEMPERATURE [K] = 309.268 316.865 + PRESSURE [bar] = -0.541420643965E+03 -0.972430940694E+03 + ******************************************************************************* + + + Spin 1 + + Number of electrons: 4 + Number of occupied orbitals: 4 + Number of molecular orbitals: 4 + + Spin 2 + + Number of electrons: 4 + Number of occupied orbitals: 4 + Number of molecular orbitals: 4 + + Number of orbital functions: 33 + Number of independent orbital functions: 33 + + Parameters for the always stable predictor-corrector (ASPC) method: + + ASPC order: 2 + + B(1) = 2.800000 + B(2) = -2.800000 + B(3) = 1.200000 + B(4) = -0.200000 + + Parameters for the always stable predictor-corrector (ASPC) method: + + ASPC order: 2 + + B(1) = 2.800000 + B(2) = -2.800000 + B(3) = 1.200000 + B(4) = -0.200000 + + Extrapolation method: ASPC + + + SCF WAVEFUNCTION OPTIMIZATION + + ----------------------------------- OT --------------------------------------- + Minimizer : CG : conjugate gradient + Preconditioner : FULL_SINGLE_INVERSE : inversion of + H + eS - 2*(Sc)(c^T*H*c+const)(Sc)^T + Precond_solver : DEFAULT + Line search : 2PNT : 2 energies, one gradient + stepsize : 0.08000000 energy_gap : 0.10000000 + eps_taylor : 0.10000E-15 max_taylor : 4 + ----------------------------------- OT --------------------------------------- + + Step Update method Time Convergence Total energy Change + ------------------------------------------------------------------------------ + 1 OT CG 0.80E-01 6.0 0.00009987 -8.0717079417 -8.07E+00 + 2 OT LS 0.32E+00 3.7 -8.0717081362 + 3 OT CG 0.32E+00 7.2 0.00004033 -8.0717085262 -5.84E-07 + 4 OT LS 0.57E+00 3.7 -8.0717086252 + 5 OT CG 0.57E+00 7.2 0.00000610 -8.0717086493 -1.23E-07 + 6 OT LS 0.50E+00 3.7 -8.0717086517 + 7 OT CG 0.50E+00 7.2 0.00000144 -8.0717086517 -2.45E-09 + 8 OT LS 0.38E+00 3.7 -8.0717086518 + 9 OT CG 0.38E+00 7.3 0.00000045 -8.0717086518 -1.04E-10 + + *** SCF run converged in 9 steps *** + + + Electronic density on regular grids: -8.0000000000 0.0000000000 + Core density on regular grids: 8.0000000000 -0.0000000000 + Total charge density on r-space grids: -0.0000000000 + Total charge density g-space grids: -0.0000000000 + + Overlap energy of the core charge distribution: 0.00000125847873 + Self energy of the core charge distribution: -18.97690376224277 + Core Hamiltonian energy: 6.15217757979457 + Hartree energy: 7.91660095475947 + Exchange-correlation energy: -3.16349409182858 + Dispersion energy: -0.00009059079067 + + Total energy: -8.07170865182925 + + outer SCF iter = 1 RMS gradient = 0.45E-06 energy = -8.0717086518 + outer SCF loop converged in 1 iterations or 9 steps + + + Integrated absolute spin density : 0.0000000000 + Ideal and single determinant S**2 : 0.000000 0.000000 + + !-----------------------------------------------------------------------------! + Mulliken Population Analysis + + # Atom Element Kind Atomic population (alpha,beta) Net charge Spin moment + 1 H 1 0.451154 0.451154 0.097691 -0.000000 + 2 H 1 0.455861 0.455861 0.088278 0.000000 + 3 H 1 0.462856 0.462856 0.074287 0.000000 + 4 H 1 0.449755 0.449755 0.100491 -0.000000 + 5 C 2 2.180373 2.180373 -0.360747 -0.000000 + # Total charge and spin 4.000000 4.000000 0.000000 0.000000 + + !-----------------------------------------------------------------------------! + + !-----------------------------------------------------------------------------! + Hirshfeld Charges + + #Atom Element Kind Ref Charge Population Spin moment Net charge + 1 H 1 1.000 0.276 0.276 -0.000 0.449 + 2 H 1 1.000 0.274 0.274 0.000 0.452 + 3 H 1 1.000 0.275 0.275 0.000 0.450 + 4 H 1 1.000 0.274 0.274 -0.000 0.452 + 5 C 2 4.000 2.897 2.897 0.000 -1.793 + + Total Charge 0.009 + !-----------------------------------------------------------------------------! + + ENERGY| Total FORCE_EVAL ( QS ) energy (a.u.): -8.071708651839092 + + + ATOMIC FORCES in [a.u.] + + # Atom Kind Element X Y Z + 1 1 H -0.00634389 0.00778557 0.00277275 + 2 1 H 0.00321251 0.00370659 0.00162416 + 3 1 H -0.01492511 0.00854274 -0.02565037 + 4 1 H -0.02069741 -0.01379307 -0.00174622 + 5 2 C 0.03875448 -0.00623366 0.02299424 + SUM OF ATOMIC FORCES 0.00000059 0.00000818 -0.00000545 0.00000985 + + STRESS TENSOR [GPa] + + X Y Z + X -0.10935324 -0.10924270 0.11298241 + Y -0.10924270 -0.15024316 -0.05897775 + Z 0.11298241 -0.05897775 0.19386955 + + 1/3 Trace(stress tensor): -2.19089509E-02 + + Det(stress tensor) : 4.62565716E-03 + + + EIGENVECTORS AND EIGENVALUES OF THE STRESS TENSOR + + -0.24289066 -0.07540270 0.25256650 + + 0.66761483 0.65589029 0.35227597 + 0.74095410 -0.63151371 -0.22842387 + -0.07264611 -0.41351948 0.90759252 + + ============================================================================== + Stress Tensor Components (GPW/GAPW) + 1/3 Trace Determinant + Kinetic Energy Stress 0.89277597 0.43134742 + Basis Overlap Stress 0.30232203 0.01742148 + ES + XC Stress -13.77103069 -2605.60987462 + vdW correction (ff) Stress 0.00008301 -0.00000000 + Local Pseudopotential/Core Stress -0.16231382 -0.00313305 + Nonlocal Pseudopotential Stress 0.13879012 0.00131219 + Exact Exchange Stress -0.00000000 -0.00000000 + Sum of Parts Stress -12.59937338 -2000.04720795 + Total Stress -0.00502528 0.00005582 + ============================================================================== + + Centre of mass motion (COM): x = -0.0000000052 + y = 0.0000000203 + z = -0.0000000227 + + ******************************************************************************* + ENSEMBLE TYPE = NVT + STEP NUMBER = 4 + TIME [fs] = 2.000000 + CONSERVED QUANTITY [hartree] = -0.806538756167E+01 + + INSTANTANEOUS AVERAGES + CPU TIME [s] = 59.09 118.22 + ENERGY DRIFT PER ATOM [K] = 0.589960350717E+00 0.423927562036E+00 + POTENTIAL ENERGY[hartree] = -0.807170865184E+01 -0.807187972280E+01 + KINETIC ENERGY [hartree] = 0.579171218691E-02 0.596346786423E-02 + TEMPERATURE [K] = 304.813 313.852 + PRESSURE [bar] = -0.507536282150E+02 -0.742011612574E+03 + ******************************************************************************* + + + Spin 1 + + Number of electrons: 4 + Number of occupied orbitals: 4 + Number of molecular orbitals: 4 + + Spin 2 + + Number of electrons: 4 + Number of occupied orbitals: 4 + Number of molecular orbitals: 4 + + Number of orbital functions: 33 + Number of independent orbital functions: 33 + + Parameters for the always stable predictor-corrector (ASPC) method: + + ASPC order: 3 + + B(1) = 3.000000 + B(2) = -3.428571 + B(3) = 1.928571 + B(4) = -0.571429 + B(5) = 0.071429 + + Parameters for the always stable predictor-corrector (ASPC) method: + + ASPC order: 3 + + B(1) = 3.000000 + B(2) = -3.428571 + B(3) = 1.928571 + B(4) = -0.571429 + B(5) = 0.071429 + + Extrapolation method: ASPC + + + SCF WAVEFUNCTION OPTIMIZATION + + ----------------------------------- OT --------------------------------------- + Minimizer : CG : conjugate gradient + Preconditioner : FULL_SINGLE_INVERSE : inversion of + H + eS - 2*(Sc)(c^T*H*c+const)(Sc)^T + Precond_solver : DEFAULT + Line search : 2PNT : 2 energies, one gradient + stepsize : 0.08000000 energy_gap : 0.10000000 + eps_taylor : 0.10000E-15 max_taylor : 4 + ----------------------------------- OT --------------------------------------- + + Step Update method Time Convergence Total energy Change + ------------------------------------------------------------------------------ + 1 OT CG 0.80E-01 6.0 0.00008550 -8.0716734880 -8.07E+00 + 2 OT LS 0.32E+00 3.7 -8.0716736302 + 3 OT CG 0.32E+00 7.2 0.00003410 -8.0716739109 -4.23E-07 + 4 OT LS 0.57E+00 3.7 -8.0716739813 + 5 OT CG 0.57E+00 7.2 0.00000620 -8.0716739977 -8.69E-08 + 6 OT LS 0.39E+00 3.7 -8.0716739993 + 7 OT CG 0.39E+00 7.2 0.00000222 -8.0716739997 -1.98E-09 + 8 OT LS 0.39E+00 3.7 -8.0716740000 + 9 OT CG 0.39E+00 7.2 0.00000042 -8.0716740000 -2.51E-10 + + *** SCF run converged in 9 steps *** + + + Electronic density on regular grids: -8.0000000000 0.0000000000 + Core density on regular grids: 8.0000000000 -0.0000000000 + Total charge density on r-space grids: -0.0000000000 + Total charge density g-space grids: -0.0000000000 + + Overlap energy of the core charge distribution: 0.00000140576241 + Self energy of the core charge distribution: -18.97690376224277 + Core Hamiltonian energy: 6.17539939040593 + Hartree energy: 7.90088986183626 + Exchange-correlation energy: -3.17097385434427 + Dispersion energy: -0.00008704138175 + + Total energy: -8.07167399996420 + + outer SCF iter = 1 RMS gradient = 0.42E-06 energy = -8.0716740000 + outer SCF loop converged in 1 iterations or 9 steps + + + Integrated absolute spin density : 0.0000000000 + Ideal and single determinant S**2 : 0.000000 0.000000 + + !-----------------------------------------------------------------------------! + Mulliken Population Analysis + + # Atom Element Kind Atomic population (alpha,beta) Net charge Spin moment + 1 H 1 0.451009 0.451009 0.097981 -0.000000 + 2 H 1 0.458168 0.458168 0.083664 0.000000 + 3 H 1 0.462297 0.462297 0.075406 -0.000000 + 4 H 1 0.450927 0.450927 0.098145 -0.000000 + 5 C 2 2.177599 2.177599 -0.355197 0.000000 + # Total charge and spin 4.000000 4.000000 0.000000 -0.000000 + + !-----------------------------------------------------------------------------! + + !-----------------------------------------------------------------------------! + Hirshfeld Charges + + #Atom Element Kind Ref Charge Population Spin moment Net charge + 1 H 1 1.000 0.276 0.276 -0.000 0.448 + 2 H 1 1.000 0.274 0.274 0.000 0.452 + 3 H 1 1.000 0.275 0.275 -0.000 0.450 + 4 H 1 1.000 0.274 0.274 0.000 0.452 + 5 C 2 4.000 2.897 2.897 0.000 -1.794 + + Total Charge 0.009 + !-----------------------------------------------------------------------------! + + ENERGY| Total FORCE_EVAL ( QS ) energy (a.u.): -8.071673999974598 + + + ATOMIC FORCES in [a.u.] + + # Atom Kind Element X Y Z + 1 1 H -0.00548291 0.00547809 0.00384892 + 2 1 H -0.00188710 0.00293851 0.00901234 + 3 1 H -0.01496202 0.00949688 -0.02576096 + 4 1 H -0.01855003 -0.00957821 -0.00076125 + 5 2 C 0.04088326 -0.00832688 0.01365835 + SUM OF ATOMIC FORCES 0.00000119 0.00000839 -0.00000261 0.00000887 + + STRESS TENSOR [GPa] + + X Y Z + X -0.06453397 -0.09368442 0.08124742 + Y -0.09368442 -0.10129148 -0.06558003 + Z 0.08124742 -0.06558003 0.24685428 + + 1/3 Trace(stress tensor): 2.70096077E-02 + + Det(stress tensor) : 1.39156260E-03 + + + EIGENVECTORS AND EIGENVALUES OF THE STRESS TENSOR + + -0.17838552 -0.02721581 0.28663015 + + 0.63653822 0.72011263 0.27614653 + 0.77124051 -0.59557661 -0.22466994 + -0.00267875 -0.35598639 0.93448730 + + ============================================================================== + Stress Tensor Components (GPW/GAPW) + 1/3 Trace Determinant + Kinetic Energy Stress 0.89808782 0.42935556 + Basis Overlap Stress 0.30064467 0.01687745 + ES + XC Stress -13.75223766 -2594.74559376 + vdW correction (ff) Stress 0.00007798 -0.00000000 + Local Pseudopotential/Core Stress -0.16445351 -0.00320720 + Nonlocal Pseudopotential Stress 0.13999780 0.00133371 + Exact Exchange Stress -0.00000000 -0.00000000 + Sum of Parts Stress -12.57788290 -1989.82635409 + Total Stress 0.00619523 0.00001679 + ============================================================================== + + Centre of mass motion (COM): x = -0.0000000046 + y = 0.0000000261 + z = -0.0000000255 + + ******************************************************************************* + ENSEMBLE TYPE = NVT + STEP NUMBER = 5 + TIME [fs] = 2.500000 + CONSERVED QUANTITY [hartree] = -0.806539275296E+01 + + INSTANTANEOUS AVERAGES + CPU TIME [s] = 59.16 106.41 + ENERGY DRIFT PER ATOM [K] = 0.262104991279E+00 0.391563047885E+00 + POTENTIAL ENERGY[hartree] = -0.807167399997E+01 -0.807183857823E+01 + KINETIC ENERGY [hartree] = 0.575022752687E-02 0.592081979676E-02 + TEMPERATURE [K] = 302.629 311.607 + PRESSURE [bar] = 0.437226207820E+03 -0.506164048495E+03 + ******************************************************************************* + + + Spin 1 + + Number of electrons: 4 + Number of occupied orbitals: 4 + Number of molecular orbitals: 4 + + Spin 2 + + Number of electrons: 4 + Number of occupied orbitals: 4 + Number of molecular orbitals: 4 + + Number of orbital functions: 33 + Number of independent orbital functions: 33 + + Parameters for the always stable predictor-corrector (ASPC) method: + + ASPC order: 3 + + B(1) = 3.000000 + B(2) = -3.428571 + B(3) = 1.928571 + B(4) = -0.571429 + B(5) = 0.071429 + + Parameters for the always stable predictor-corrector (ASPC) method: + + ASPC order: 3 + + B(1) = 3.000000 + B(2) = -3.428571 + B(3) = 1.928571 + B(4) = -0.571429 + B(5) = 0.071429 + + Extrapolation method: ASPC + + + SCF WAVEFUNCTION OPTIMIZATION + + ----------------------------------- OT --------------------------------------- + Minimizer : CG : conjugate gradient + Preconditioner : FULL_SINGLE_INVERSE : inversion of + H + eS - 2*(Sc)(c^T*H*c+const)(Sc)^T + Precond_solver : DEFAULT + Line search : 2PNT : 2 energies, one gradient + stepsize : 0.08000000 energy_gap : 0.10000000 + eps_taylor : 0.10000E-15 max_taylor : 4 + ----------------------------------- OT --------------------------------------- + + Step Update method Time Convergence Total energy Change + ------------------------------------------------------------------------------ + 1 OT CG 0.80E-01 6.0 0.00008079 -8.0716102991 -8.07E+00 + 2 OT LS 0.32E+00 3.7 -8.0716104254 + 3 OT CG 0.32E+00 7.3 0.00003132 -8.0716106658 -3.67E-07 + 4 OT LS 0.55E+00 3.7 -8.0716107246 + 5 OT CG 0.55E+00 7.2 0.00000733 -8.0716107372 -7.14E-08 + 6 OT LS 0.34E+00 3.7 -8.0716107386 + 7 OT CG 0.34E+00 7.2 0.00000221 -8.0716107396 -2.39E-09 + 8 OT LS 0.45E+00 3.7 -8.0716107398 + 9 OT CG 0.45E+00 7.3 0.00000038 -8.0716107398 -2.92E-10 + + *** SCF run converged in 9 steps *** + + + Electronic density on regular grids: -8.0000000000 0.0000000000 + Core density on regular grids: 8.0000000000 -0.0000000000 + Total charge density on r-space grids: -0.0000000000 + Total charge density g-space grids: -0.0000000000 + + Overlap energy of the core charge distribution: 0.00000152630999 + Self energy of the core charge distribution: -18.97690376224277 + Core Hamiltonian energy: 6.19682807684245 + Hartree energy: 7.88642027462534 + Exchange-correlation energy: -3.17787308713513 + Dispersion energy: -0.00008376824955 + + Total energy: -8.07161073984968 + + outer SCF iter = 1 RMS gradient = 0.38E-06 energy = -8.0716107398 + outer SCF loop converged in 1 iterations or 9 steps + + + Integrated absolute spin density : 0.0000000000 + Ideal and single determinant S**2 : 0.000000 0.000000 + + !-----------------------------------------------------------------------------! + Mulliken Population Analysis + + # Atom Element Kind Atomic population (alpha,beta) Net charge Spin moment + 1 H 1 0.451091 0.451091 0.097817 -0.000000 + 2 H 1 0.460373 0.460373 0.079253 -0.000000 + 3 H 1 0.460976 0.460976 0.078047 -0.000000 + 4 H 1 0.452575 0.452575 0.094850 0.000000 + 5 C 2 2.174984 2.174984 -0.349967 0.000000 + # Total charge and spin 4.000000 4.000000 0.000000 -0.000000 + + !-----------------------------------------------------------------------------! + + !-----------------------------------------------------------------------------! + Hirshfeld Charges + + #Atom Element Kind Ref Charge Population Spin moment Net charge + 1 H 1 1.000 0.276 0.276 -0.000 0.448 + 2 H 1 1.000 0.274 0.274 -0.000 0.452 + 3 H 1 1.000 0.275 0.275 -0.000 0.450 + 4 H 1 1.000 0.274 0.274 0.000 0.452 + 5 C 2 4.000 2.897 2.897 0.000 -1.794 + + Total Charge 0.008 + !-----------------------------------------------------------------------------! + + ENERGY| Total FORCE_EVAL ( QS ) energy (a.u.): -8.071610739858430 + + + ATOMIC FORCES in [a.u.] + + # Atom Kind Element X Y Z + 1 1 H -0.00428043 0.00254224 0.00474594 + 2 1 H -0.00710461 0.00211933 0.01600959 + 3 1 H -0.01327808 0.01000580 -0.02287865 + 4 1 H -0.01510172 -0.00416799 0.00040262 + 5 2 C 0.03976626 -0.01049068 0.00172139 + SUM OF ATOMIC FORCES 0.00000142 0.00000870 0.00000088 0.00000886 + + STRESS TENSOR [GPa] + + X Y Z + X -0.01608144 -0.07103506 0.03869385 + Y -0.07103506 -0.04095203 -0.06731724 + Z 0.03869385 -0.06731724 0.27368354 + + 1/3 Trace(stress tensor): 7.22166908E-02 + + Det(stress tensor) : -6.96514772E-04 + + + EIGENVECTORS AND EIGENVALUES OF THE STRESS TENSOR + + -0.10272077 0.02286886 0.29650199 + + 0.61101232 0.77308379 0.17030972 + 0.78776161 -0.57257672 -0.22712894 + 0.07807433 -0.27294204 0.95885716 + + ============================================================================== + Stress Tensor Components (GPW/GAPW) + 1/3 Trace Determinant + Kinetic Energy Stress 0.90397791 0.42776680 + Basis Overlap Stress 0.29897585 0.01637037 + ES + XC Stress -13.73889554 -2587.00681303 + vdW correction (ff) Stress 0.00007331 -0.00000000 + Local Pseudopotential/Core Stress -0.16682045 -0.00328370 + Nonlocal Pseudopotential Stress 0.14168323 0.00136771 + Exact Exchange Stress -0.00000000 -0.00000000 + Sum of Parts Stress -12.56100570 -1981.82203486 + Total Stress 0.01656443 -0.00000841 + ============================================================================== + + Centre of mass motion (COM): x = -0.0000000037 + y = 0.0000000322 + z = -0.0000000261 + + ******************************************************************************* + ENSEMBLE TYPE = NVT + STEP NUMBER = 6 + TIME [fs] = 3.000000 + CONSERVED QUANTITY [hartree] = -0.806539985659E+01 + + INSTANTANEOUS AVERAGES + CPU TIME [s] = 59.18 98.54 + ENERGY DRIFT PER ATOM [K] = -0.186524742344E+00 0.295215082847E+00 + POTENTIAL ENERGY[hartree] = -0.807161073986E+01 -0.807180060517E+01 + KINETIC ENERGY [hartree] = 0.567823850684E-02 0.588038958177E-02 + TEMPERATURE [K] = 298.841 309.480 + PRESSURE [bar] = 0.887204680984E+03 -0.273935926915E+03 + ******************************************************************************* + + + Spin 1 + + Number of electrons: 4 + Number of occupied orbitals: 4 + Number of molecular orbitals: 4 + + Spin 2 + + Number of electrons: 4 + Number of occupied orbitals: 4 + Number of molecular orbitals: 4 + + Number of orbital functions: 33 + Number of independent orbital functions: 33 + + Parameters for the always stable predictor-corrector (ASPC) method: + + ASPC order: 3 + + B(1) = 3.000000 + B(2) = -3.428571 + B(3) = 1.928571 + B(4) = -0.571429 + B(5) = 0.071429 + + Parameters for the always stable predictor-corrector (ASPC) method: + + ASPC order: 3 + + B(1) = 3.000000 + B(2) = -3.428571 + B(3) = 1.928571 + B(4) = -0.571429 + B(5) = 0.071429 + + Extrapolation method: ASPC + + + SCF WAVEFUNCTION OPTIMIZATION + + ----------------------------------- OT --------------------------------------- + Minimizer : CG : conjugate gradient + Preconditioner : FULL_SINGLE_INVERSE : inversion of + H + eS - 2*(Sc)(c^T*H*c+const)(Sc)^T + Precond_solver : DEFAULT + Line search : 2PNT : 2 energies, one gradient + stepsize : 0.08000000 energy_gap : 0.10000000 + eps_taylor : 0.10000E-15 max_taylor : 4 + ----------------------------------- OT --------------------------------------- + + Step Update method Time Convergence Total energy Change + ------------------------------------------------------------------------------ + 1 OT CG 0.80E-01 6.0 0.00007768 -8.0714146600 -8.07E+00 + 2 OT LS 0.32E+00 3.7 -8.0714147760 diff --git a/tests/cp2k/aimd_stress/deepmd/box.raw b/tests/cp2k/aimd_stress/deepmd/box.raw new file mode 100644 index 000000000..8f2014f0a --- /dev/null +++ b/tests/cp2k/aimd_stress/deepmd/box.raw @@ -0,0 +1 @@ +1.000000000000000000e+01 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 1.000000000000000000e+01 0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 1.000000000000000000e+01 diff --git a/tests/cp2k/aimd_stress/deepmd/coord.raw b/tests/cp2k/aimd_stress/deepmd/coord.raw new file mode 100644 index 000000000..0ee1d8197 --- /dev/null +++ b/tests/cp2k/aimd_stress/deepmd/coord.raw @@ -0,0 +1 @@ +5.701910018920898438e+00 3.809600114822387695e+00 4.388450145721435547e+00 4.446010112762451172e+00 4.656809806823730469e+00 5.381949901580810547e+00 4.492159843444824219e+00 4.909910202026367188e+00 3.577559947967529297e+00 5.838250160217285156e+00 5.622280120849609375e+00 4.610680103302001953e+00 5.116660118103027344e+00 4.755330085754394531e+00 4.461229801177978516e+00 diff --git a/tests/cp2k/aimd_stress/deepmd/energy.raw b/tests/cp2k/aimd_stress/deepmd/energy.raw new file mode 100644 index 000000000..0cc396e4c --- /dev/null +++ b/tests/cp2k/aimd_stress/deepmd/energy.raw @@ -0,0 +1 @@ +-2.196554718017578125e+02 diff --git a/tests/cp2k/aimd_stress/deepmd/force.raw b/tests/cp2k/aimd_stress/deepmd/force.raw new file mode 100644 index 000000000..346b4953e --- /dev/null +++ b/tests/cp2k/aimd_stress/deepmd/force.raw @@ -0,0 +1 @@ +-2.743706703186035156e-01 4.712709188461303711e-01 -1.367179006338119507e-01 7.652513980865478516e-01 2.514204978942871094e-01 -1.059429287910461426e+00 2.538656070828437805e-02 1.183478906750679016e-02 -1.267343163490295410e-01 -8.532900810241699219e-01 -9.029597043991088867e-01 -1.871660351753234863e-01 3.367811143398284912e-01 1.687173396348953247e-01 1.509592533111572266e+00 diff --git a/tests/cp2k/aimd_stress/deepmd/type.raw b/tests/cp2k/aimd_stress/deepmd/type.raw new file mode 100644 index 000000000..0b21c0d0e --- /dev/null +++ b/tests/cp2k/aimd_stress/deepmd/type.raw @@ -0,0 +1,5 @@ +0 +0 +0 +0 +1 diff --git a/tests/cp2k/aimd_stress/deepmd/type_map.raw b/tests/cp2k/aimd_stress/deepmd/type_map.raw new file mode 100644 index 000000000..35025b8b1 --- /dev/null +++ b/tests/cp2k/aimd_stress/deepmd/type_map.raw @@ -0,0 +1,2 @@ +H +C diff --git a/tests/cp2k/aimd_stress/deepmd/virial.raw b/tests/cp2k/aimd_stress/deepmd/virial.raw new file mode 100644 index 000000000..90c5ec17a --- /dev/null +++ b/tests/cp2k/aimd_stress/deepmd/virial.raw @@ -0,0 +1 @@ +-1.305763244628906250e+00 -5.517681837081909180e-01 5.745944380760192871e-01 -5.517681837081909180e-01 -1.251762151718139648e+00 5.180240049958229065e-02 5.745944380760192871e-01 5.180240049958229065e-02 -8.817730545997619629e-01 diff --git a/tests/cp2k/aimd_stress/input.inp b/tests/cp2k/aimd_stress/input.inp new file mode 100644 index 000000000..83080c328 --- /dev/null +++ b/tests/cp2k/aimd_stress/input.inp @@ -0,0 +1,108 @@ + +&GLOBAL + PRINT_LEVEL medium + WALLTIME 43000 + PROJECT_NAME DPGEN + RUN_TYPE MD +&END GLOBAL +&MOTION + &MD + &THERMOSTAT + TYPE NOSE + &END THERMOSTAT + ENSEMBLE NVT + STEPS 3 + TIMESTEP 0.5 + TEMPERATURE 330.0 + &END MD + &PRINT + &FORCES + &EACH + MD 1 + &END EACH + &END FORCES + &TRAJECTORY + &EACH + MD 1 + &END EACH + &END TRAJECTORY + &RESTART + BACKUP_COPIES 3 + &EACH + MD 1 + &END EACH + &END RESTART + &END PRINT +&END MOTION +&FORCE_EVAL + METHOD QS + STRESS_TENSOR ANALYTICAL + &PRINT + &FORCES ON + &END FORCES + &STRESS_TENSOR ON + &END STRESS_TENSOR + &END PRINT + &SUBSYS + &CELL + A 10. 0. 0. + B 0. 10. 0. + C 0. 0. 10. + &END CELL + &COORD + H 5.70191 3.8096 4.38845 + H 4.44601 4.65681 5.38195 + H 4.49216 4.90991 3.57756 + H 5.83825 5.62228 4.61068 + C 5.11666 4.75533 4.46123 + &END COORD + &KIND H + POTENTIAL GTH-PBE-q1 + BASIS_SET DZVP-GTH-PBE + &END KIND + &KIND C + POTENTIAL GTH-PBE-q4 + BASIS_SET DZVP-GTH-PBE + &END KIND + &END SUBSYS + &DFT + POTENTIAL_FILE_NAME GTH_POTENTIALS + PLUS_U_METHOD MULLIKEN + UKS .TRUE. + BASIS_SET_FILE_NAME BASIS_SET + &MGRID + REL_CUTOFF 60 + NGRIDS 5 + CUTOFF 800 + &END MGRID + &QS + EPS_DEFAULT 1.0E-13 + &END QS + &XC + &VDW_POTENTIAL + POTENTIAL_TYPE PAIR_POTENTIAL + &PAIR_POTENTIAL + REFERENCE_FUNCTIONAL PBE + PARAMETER_FILE_NAME dftd3.dat + TYPE DFTD3 + &END PAIR_POTENTIAL + &END VDW_POTENTIAL + &XC_FUNCTIONAL PBE + &END XC_FUNCTIONAL + &END XC + &SCF + EPS_SCF 1e-06 + MAX_SCF 50 + SCF_GUESS RESTART + &OUTER_SCF + EPS_SCF 1e-06 + MAX_SCF 15 + &END OUTER_SCF + &OT + ENERGY_GAP 0.1 + PRECONDITIONER FULL_SINGLE_INVERSE + MINIMIZER CG + &END OT + &END SCF + &END DFT +&END FORCE_EVAL diff --git a/tests/test_abacus_md.py b/tests/test_abacus_md.py index 14607bbaf..d039211b0 100644 --- a/tests/test_abacus_md.py +++ b/tests/test_abacus_md.py @@ -85,6 +85,22 @@ def test_energy(self) : np.testing.assert_almost_equal(self.system_water.data['energies'], ref_energy) np.testing.assert_almost_equal(self.system_Si.data['energies'], ref_energy2) + def test_to_system(self): + pp_file=["H.upf","O.upf"] + numerical_orbital=["H.upf","O.upf"] + numerical_descriptor="jle.orb" + mass=[1.008,15.994] + self.system_water.to(file_name="abacus.md/water_stru",fmt='abacus/stru',pp_file=pp_file,\ + numerical_orbital=numerical_orbital,numerical_descriptor=numerical_descriptor,\ + mass=mass) + self.assertTrue(os.path.isfile('abacus.md/water_stru')) + if os.path.isfile('abacus.md/water_stru'): + with open('abacus.md/water_stru') as f: + iline=0 + for iline,l in enumerate(f): + iline += 1 + self.assertEqual(iline,30) + class TestABACUSMDLabeledOutput(unittest.TestCase, TestABACUSMD): @@ -92,5 +108,9 @@ def setUp(self): self.system_water = dpdata.LabeledSystem('abacus.md',fmt='abacus/md') # system with stress self.system_Si = dpdata.LabeledSystem('abacus.md.nostress',fmt='abacus/md') # system without stress + def tearDown(self): + if os.path.isfile('abacus.md/water_stru'): + os.remove('abacus.md/water_stru') + if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main() diff --git a/tests/test_abacus_relax.py b/tests/test_abacus_relax.py new file mode 100644 index 000000000..3f1230ad6 --- /dev/null +++ b/tests/test_abacus_relax.py @@ -0,0 +1,75 @@ +import os +import numpy as np +import unittest +from context import dpdata +from dpdata.unit import LengthConversion + +bohr2ang = LengthConversion("bohr", "angstrom").value() + +class TestABACUSRelax: + + def test_atom_names(self) : + self.assertEqual(self.system.data['atom_names'], ['H','O']) + + def test_atom_numbs(self) : + self.assertEqual(self.system.data['atom_numbs'], [2,1]) + + def test_atom_types(self) : + ref_type = np.array([0,0,1]) + for ii in range(ref_type.shape[0]) : + self.assertEqual(self.system.data['atom_types'][ii], ref_type[ii]) + + def test_cell(self) : + cell = bohr2ang * 28.0 * np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) + for idx in range(np.shape(self.system.data['cells'])[0]): + np.testing.assert_almost_equal(cell, self.system.data['cells'][idx], decimal = 5) + + def test_coord(self) : + with open('abacus.relax/coord.ref') as fp: + ref = [] + for ii in fp : + ref.append([float(jj) for jj in ii.split()]) + ref = np.array(ref) + ref = ref.reshape([5, 3, 3]) + np.testing.assert_almost_equal(self.system.data['coords'], ref, decimal = 5) + + def test_force(self) : + with open('abacus.relax/force.ref') as fp: + ref = [] + for ii in fp : + ref.append([float(jj) for jj in ii.split()]) + ref = np.array(ref) + ref = ref.reshape([5, 3, 3]) + np.testing.assert_almost_equal(self.system.data['forces'], ref, decimal=5) + + def test_virial(self) : + with open('abacus.relax/virial.ref') as fp: + ref = [] + for ii in fp : + ref.append([float(jj) for jj in ii.split()]) + ref = np.array(ref) + ref = ref.reshape([5, 3, 3]) + np.testing.assert_almost_equal(self.system.data['virials'], ref, decimal=5) + + def test_stress(self) : + with open('abacus.relax/stress.ref') as fp: + ref = [] + for ii in fp : + ref.append([float(jj) for jj in ii.split()]) + ref = np.array(ref) + ref = ref.reshape([5, 3, 3]) + np.testing.assert_almost_equal(self.system.data['stress'], ref, decimal=5) + + def test_energy(self) : + ref_energy = np.array([-465.77753104, -464.35757552, -465.79307346, -465.80056811, + -465.81235433]) + np.testing.assert_almost_equal(self.system.data['energies'], ref_energy) + + +class TestABACUSMDLabeledOutput(unittest.TestCase, TestABACUSRelax): + + def setUp(self): + self.system = dpdata.LabeledSystem('abacus.relax',fmt='abacus/relax') + +if __name__ == '__main__': + unittest.main() \ No newline at end of file diff --git a/tests/test_corr.py b/tests/test_corr.py index e1fe00e69..fd8fa2e78 100644 --- a/tests/test_corr.py +++ b/tests/test_corr.py @@ -28,5 +28,19 @@ def setUp(self): self.f_places = 6 self.v_places = 6 + +class TestCorr(unittest.TestCase, CompLabeledSys, IsPBC): + """Make a test to get a correction of two MultiSystems.""" + def setUp(self): + s_ll = dpdata.MultiSystems(dpdata.LabeledSystem("amber/corr/dp_ll", fmt="deepmd/npy")) + s_hl = dpdata.MultiSystems(dpdata.LabeledSystem("amber/corr/dp_hl", fmt="deepmd/npy")) + self.system_1 = tuple(s_ll.correction(s_hl).systems.values())[0] + self.system_2 = dpdata.LabeledSystem("amber/corr/dp_corr" ,fmt="deepmd/npy") + self.places = 5 + self.e_places = 4 + self.f_places = 6 + self.v_places = 6 + + if __name__ == '__main__': unittest.main() \ No newline at end of file diff --git a/tests/test_cp2k_aimd_output.py b/tests/test_cp2k_aimd_output.py index 13423e1b0..8e2bdd561 100644 --- a/tests/test_cp2k_aimd_output.py +++ b/tests/test_cp2k_aimd_output.py @@ -15,6 +15,15 @@ def setUp(self): self.f_places = 6 self.v_places = 4 +class TestCp2kAimdStressOutput(unittest.TestCase, CompLabeledSys): + def setUp(self): + self.system_1 = dpdata.LabeledSystem('cp2k/aimd_stress',fmt='cp2k/aimd_output') + self.system_2 = dpdata.LabeledSystem('cp2k/aimd_stress/deepmd', fmt='deepmd/raw') + self.places = 6 + self.e_places = 6 + self.f_places = 6 + self.v_places = 4 + #class TestCp2kAimdRestartOutput(unittest.TestCase, CompLabeledSys): # def setUp(self): # self.system_1 = dpdata.LabeledSystem('cp2k/restart_aimd',fmt='cp2k/aimd_output', restart=True) diff --git a/tests/test_gaussian_driver.py b/tests/test_gaussian_driver.py new file mode 100644 index 000000000..69d0c42ec --- /dev/null +++ b/tests/test_gaussian_driver.py @@ -0,0 +1,109 @@ +import unittest +import shutil +import importlib +import os + +import numpy as np +from context import dpdata +from comp_sys import CompSys, IsNoPBC + + +@unittest.skipIf(shutil.which("g16") is None, "g16 is not installed") +@unittest.skipIf(importlib.util.find_spec("openbabel") is None, "openbabel is not installed") +class TestGaussianDriver(unittest.TestCase, CompSys, IsNoPBC): + """Test Gaussian with a hydrogen ion.""" + @classmethod + def setUpClass(cls): + cls.system_1 = dpdata.System(data={ + "atom_names": ["H"], + "atom_numbs": [1], + "atom_types": np.zeros((1,), dtype=int), + "coords": np.zeros((1, 1, 3), dtype=np.float32), + "cells": np.zeros((1, 3, 3), dtype=np.float32), + "orig": np.zeros(3, dtype=np.float32), + "nopbc": True, + }) + cls.system_2 = cls.system_1.predict(keywords="force B3LYP", charge=1, driver="gaussian") + cls.places = 6 + + def test_energy(self): + self.assertAlmostEqual(self.system_2['energies'].ravel()[0], 0.) + + def test_forces(self): + forces = self.system_2['forces'] + np.testing.assert_allclose(forces, np.zeros_like(forces)) + + +class TestMakeGaussian(unittest.TestCase): + """This class will not check if the output is correct, but only see if there is any errors.""" + def setUp(self): + self.system = dpdata.System(data={ + "atom_names": ["H"], + "atom_numbs": [1], + "atom_types": np.zeros((1,), dtype=int), + "coords": np.zeros((1, 1, 3), dtype=np.float32), + "cells": np.zeros((1, 3, 3), dtype=np.float32), + "orig": np.zeros(3, dtype=np.float32), + "nopbc": True, + }) + + @unittest.skipIf(importlib.util.find_spec("openbabel") is None, "requires openbabel") + def test_make_fp_gaussian(self): + self.system.to_gaussian_gjf("gaussian/tmp.gjf", keywords="wb97x/6-31g* force") + + def test_make_fp_gaussian_multiplicity_one(self): + self.system.to_gaussian_gjf("gaussian/tmp.gjf", keywords="wb97x/6-31g* force", multiplicity=1) + + def test_detect_multiplicity(self): + # oxygen O2 3 + self._check_multiplicity(['O', 'O'], 3) + # methane CH4 1 + self._check_multiplicity(['C', 'H', 'H', 'H', 'H'], 1) + # CH3 2 + self._check_multiplicity(['C', 'H', 'H', 'H'], 2) + # CH2 1 + self._check_multiplicity(['C', 'H', 'H'], 1) + # CH 2 + self._check_multiplicity(['C', 'H'], 2) + + def _check_multiplicity(self, symbols, multiplicity): + self.assertEqual(dpdata.gaussian.gjf.detect_multiplicity(np.array(symbols)), multiplicity) + + def tearDown(self): + if os.path.exists('gaussian/tmp.gjf'): + os.remove('gaussian/tmp.gjf') + + +class TestDumpGaussianGjf(unittest.TestCase): + def setUp(self): + self.system = dpdata.LabeledSystem('gaussian/methane.gaussianlog', + fmt='gaussian/log') + + def test_dump_to_gjf(self): + self.system.to_gaussian_gjf("gaussian/tmp.gjf", keywords="force B3LYP/6-31G(d)", multiplicity=1) + with open("gaussian/tmp.gjf") as f: + f.readline() + header = f.readline().strip() + f.readline() + title = f.readline().strip() + f.readline() + charge, mult = (int(x) for x in f.readline().strip().split()) + atoms = [] + coords = [] + for ii in range(5): + line = f.readline().strip().split() + atoms.append(line[0]) + coords.append([float(x) for x in line[1:]]) + + self.assertEqual(header, "#force B3LYP/6-31G(d)") + self.assertEqual(title, self.system.formula) + self.assertEqual(charge, 0) + self.assertEqual(mult, 1) + self.assertEqual(atoms, ['C', 'H', 'H', 'H', 'H']) + for i in range(self.system['coords'].shape[1]): + for j in range(3): + self.assertAlmostEqual(coords[i][j], self.system['coords'][0][i][j]) + + def tearDown(self): + if os.path.exists('gaussian/tmp.gjf'): + os.remove('gaussian/tmp.gjf') diff --git a/tests/test_stat.py b/tests/test_stat.py new file mode 100644 index 000000000..1fcc5af9a --- /dev/null +++ b/tests/test_stat.py @@ -0,0 +1,25 @@ +from context import dpdata + +import unittest + + +class TestStat(unittest.TestCase): + def test_errors(self): + system1 = dpdata.LabeledSystem("gaussian/methane.gaussianlog", fmt="gaussian/log") + system2 = dpdata.LabeledSystem("amber/sqm_opt.out", fmt="sqm/out") + + e = dpdata.stat.Errors(system1, system2) + self.assertAlmostEqual(e.e_mae, 1014.7946598792427, 6) + self.assertAlmostEqual(e.e_rmse, 1014.7946598792427, 6) + self.assertAlmostEqual(e.f_mae, 0.004113640526088011, 6) + self.assertAlmostEqual(e.f_rmse, 0.005714011247538185, 6) + + def test_multi_errors(self): + system1 = dpdata.MultiSystems(dpdata.LabeledSystem("gaussian/methane.gaussianlog", fmt="gaussian/log")) + system2 = dpdata.MultiSystems(dpdata.LabeledSystem("amber/sqm_opt.out", fmt="sqm/out")) + + e = dpdata.stat.MultiErrors(system1, system2) + self.assertAlmostEqual(e.e_mae, 1014.7946598792427, 6) + self.assertAlmostEqual(e.e_rmse, 1014.7946598792427, 6) + self.assertAlmostEqual(e.f_mae, 0.004113640526088011, 6) + self.assertAlmostEqual(e.f_rmse, 0.005714011247538185, 6)