Commit ccb9a878 authored by Lauri Himanen's avatar Lauri Himanen

Fixed issue with XC functional name not working properly, removed redundant...

Fixed issue with XC functional name not working properly, removed redundant section_method information.
parent a9a76df6
title "WATER 6-311G* meta-GGA XC geometry"
echo
geometry units angstroms
O 0.00000000 0.00000000 -0.06392934
H 0.76924532 0.00000000 0.52693942
H -0.76924532 0.00000000 0.52693942
end
basis
H library 6-311G*
O library 6-311G*
end
dft
iterations 50
print kinetic_energy
xc xtpss03 ctpss03
decomp
end
task dft energy
start qmd_dft_h2o_svr
echo
print low
print medium
geometry noautosym noautoz
O 0.00000000 -0.01681748 0.11334792
H 0.00000000 0.81325914 -0.34310308
......
3
5 0.001163366076
5 0.000360499861
Coordinates
-0.000000000018 -0.027284615349 0.217216502489
0.000000000291 1.483268501119 -0.644023271559
-0.000000000005 -1.300500817030 -1.116389927956
-0.000000000000 -0.034144229191 0.212416900341
0.000000000010 1.583695374879 -0.644729451162
-0.000000000008 -1.292060669195 -1.039510598857
Velocities
-0.000000000001 0.000047142069 0.000071348349
0.000000000016 -0.000444698600 -0.000234918745
0.000000000000 -0.000303480056 -0.000897431034
-0.000000000000 -0.000016518987 -0.000006808909
0.000000000000 0.000545171878 0.000007953515
-0.000000000000 -0.000283003638 0.000100108778
3
0 -76.3211206618 -1.303518E-11 1.207060E-01 -8.136823E-01
O 0.00000000 -0.01682581 0.11342108 0.00000000 0.00272962 0.00101163
H 0.00000000 0.81325075 -0.34302988 -0.00000000 -0.03553239 0.00728733
H 0.00000000 -0.67864425 -0.56433880 0.00000000 -0.00778865 -0.02334263
0 -76.3229853445 -1.303518E-11 1.207060E-01 -8.136823E-01
O 0.00000000 -0.01682581 0.11342108 0.00000000 -0.00144277 -0.00153889
H 0.00000000 0.81325075 -0.34302988 0.00000000 0.02406473 0.00400183
H 0.00000000 -0.67864425 -0.56433880 -0.00000000 -0.00116687 0.02042151
3
5 -76.3222783406 -2.610093E-10 1.084653E-01 -8.252185E-01
O -0.00000000 -0.01443840 0.11494602 -0.00000000 0.00103132 0.00156088
H 0.00000000 0.78491189 -0.34080244 0.00000000 -0.00972863 -0.00513930
H -0.00000000 -0.68819540 -0.59076811 0.00000000 -0.00663921 -0.01963302
5 -76.3243940908 -1.146548E-11 1.269964E-01 -8.030619E-01
O -0.00000000 -0.01806835 0.11240618 -0.00000000 -0.00036138 -0.00014896
H 0.00000000 0.83805550 -0.34117613 0.00000000 0.01192668 0.00017400
H -0.00000000 -0.68372906 -0.55008532 -0.00000000 -0.00619125 0.00219007
......@@ -64,7 +64,7 @@ task pspw energy
hostname = lenovo700
program = nwchem
date = Mon Sep 12 16:55:56 2016
date = Thu Sep 22 08:48:53 2016
compiled = Mon_Feb_15_08:24:17_2016
source = /build/nwchem-MF0R1k/nwchem-6.6+r27746
......@@ -200,7 +200,7 @@ task pspw energy
* developed by the group of Prof. John H. Weare *
* *
****************************************************
>>> JOB STARTED AT Mon Sep 12 16:55:56 2016 <<<
>>> JOB STARTED AT Thu Sep 22 08:48:53 2016 <<<
================ input data ========================
library name resolved from: .nwchemrc
NWCHEM_NWPW_LIBRARY set to: </home/lauri/nwchem-6.6/src/nwpw/libraryps/>
......@@ -273,7 +273,7 @@ task pspw energy
============ Grassmann lmbfgs iteration ============
>>> ITERATION STARTED AT Mon Sep 12 16:55:59 2016 <<<
>>> ITERATION STARTED AT Thu Sep 22 08:48:55 2016 <<<
iter. Energy DeltaE DeltaRho
------------------------------------------------------
- 15 steepest descent iterations performed
......@@ -284,7 +284,7 @@ task pspw energy
40 -0.2033722532E+02 -0.12138E-05 0.19371E-05
50 -0.2033722736E+02 -0.91327E-07 0.19252E-07
*** tolerance ok. iteration terminated
>>> ITERATION ENDED AT Mon Sep 12 16:56:04 2016 <<<
>>> ITERATION ENDED AT Thu Sep 22 08:49:00 2016 <<<
== Summary Of Results ==
......@@ -349,35 +349,35 @@ mu = ( -0.0000, -0.0000, -0.0001 ) au
== Timing ==
cputime in seconds
prologue : 0.246928E+01
main loop : 0.554087E+01
epilogue : 0.874305E-02
total : 0.801889E+01
cputime/step: 0.436289E-01 ( 127 evalulations, 46 linesearches)
prologue : 0.240955E+01
main loop : 0.509009E+01
epilogue : 0.848699E-02
total : 0.750813E+01
cputime/step: 0.400795E-01 ( 127 evalulations, 46 linesearches)
Time spent doing total step percent
total time : 0.801902E+01 0.631419E-01 100.0 %
i/o time : 0.233468E+01 0.183833E-01 29.1 %
FFTs : 0.220952E+00 0.173978E-02 2.8 %
dot products : 0.255144E+00 0.200901E-02 3.2 %
geodesic : 0.343504E+00 0.270476E-02 4.3 %
ffm_dgemm : 0.982336E-01 0.773493E-03 1.2 %
fmf_dgemm : 0.226185E+00 0.178099E-02 2.8 %
m_diagonalize : 0.225135E-02 0.177272E-04 0.0 %
exchange correlation : 0.197441E+01 0.155465E-01 24.6 %
local pseudopotentials : 0.229120E-03 0.180410E-05 0.0 %
non-local pseudopotentials : 0.139970E+00 0.110213E-02 1.7 %
hartree potentials : 0.150010E-01 0.118118E-03 0.2 %
ion-ion interaction : 0.842810E-03 0.663630E-05 0.0 %
structure factors : 0.763263E-02 0.600994E-04 0.1 %
phase factors : 0.100126E-04 0.788392E-07 0.0 %
masking and packing : 0.248325E+00 0.195532E-02 3.1 %
queue fft : 0.221603E+01 0.174490E-01 27.6 %
queue fft (serial) : 0.132455E+01 0.104295E-01 16.5 %
queue fft (message passing): 0.824916E+00 0.649540E-02 10.3 %
>>> JOB COMPLETED AT Mon Sep 12 16:56:04 2016 <<<
total time : 0.750847E+01 0.591218E-01 100.0 %
i/o time : 0.229253E+01 0.180515E-01 30.5 %
FFTs : 0.207814E+00 0.163633E-02 2.8 %
dot products : 0.233923E+00 0.184191E-02 3.1 %
geodesic : 0.311263E+00 0.245089E-02 4.1 %
ffm_dgemm : 0.908784E-01 0.715578E-03 1.2 %
fmf_dgemm : 0.204648E+00 0.161140E-02 2.7 %
m_diagonalize : 0.426002E-02 0.335435E-04 0.1 %
exchange correlation : 0.187728E+01 0.147817E-01 25.0 %
local pseudopotentials : 0.374079E-03 0.294550E-05 0.0 %
non-local pseudopotentials : 0.128587E+00 0.101249E-02 1.7 %
hartree potentials : 0.133843E-01 0.105388E-03 0.2 %
ion-ion interaction : 0.805140E-03 0.633968E-05 0.0 %
structure factors : 0.703539E-02 0.553968E-04 0.1 %
phase factors : 0.240793E-04 0.189601E-06 0.0 %
masking and packing : 0.236457E+00 0.186187E-02 3.1 %
queue fft : 0.202347E+01 0.159329E-01 26.9 %
queue fft (serial) : 0.123700E+01 0.974016E-02 16.5 %
queue fft (message passing): 0.731232E+00 0.575774E-02 9.7 %
>>> JOB COMPLETED AT Thu Sep 22 08:49:00 2016 <<<
****************************************************
* *
* NWPW PSPW Calculation *
......@@ -393,7 +393,7 @@ Time spent doing total step percent
* developed by the group of Prof. John H. Weare *
* *
****************************************************
>>> JOB STARTED AT Mon Sep 12 16:56:04 2016 <<<
>>> JOB STARTED AT Thu Sep 22 08:49:00 2016 <<<
================ input data ========================
pseudopotential is not correctly formatted:S.vpp
......@@ -491,13 +491,13 @@ converting .... psi: 5 spin: 2
============ Grassmann lmbfgs iteration ============
>>> ITERATION STARTED AT Mon Sep 12 16:56:10 2016 <<<
>>> ITERATION STARTED AT Thu Sep 22 08:49:06 2016 <<<
iter. Energy DeltaE DeltaRho
------------------------------------------------------
10 -0.2041356657E+02 -0.48711E-05 0.23682E-02
20 -0.2041357207E+02 -0.89875E-07 0.41247E-07
*** tolerance ok. iteration terminated
>>> ITERATION ENDED AT Mon Sep 12 16:56:15 2016 <<<
>>> ITERATION ENDED AT Thu Sep 22 08:49:10 2016 <<<
== Summary Of Results ==
......@@ -562,37 +562,37 @@ mu = ( -0.0000, -0.0000, -0.0000 ) au
== Timing ==
cputime in seconds
prologue : 0.585879E+01
main loop : 0.469916E+01
epilogue : 0.233262E-01
total : 0.105813E+02
cputime/step: 0.123662E+00 ( 38 evalulations, 17 linesearches)
prologue : 0.558673E+01
main loop : 0.424714E+01
epilogue : 0.200338E-01
total : 0.985390E+01
cputime/step: 0.111767E+00 ( 38 evalulations, 17 linesearches)
Time spent doing total step percent
total time : 0.105814E+02 0.278458E+00 100.0 %
i/o time : 0.573585E+01 0.150943E+00 54.2 %
FFTs : 0.185978E+00 0.489416E-02 1.8 %
dot products : 0.199916E+00 0.526094E-02 1.9 %
geodesic : 0.313206E+00 0.824226E-02 3.0 %
ffm_dgemm : 0.723837E-01 0.190483E-02 0.7 %
fmf_dgemm : 0.239360E+00 0.629896E-02 2.3 %
m_diagonalize : 0.926009E-03 0.243687E-04 0.0 %
exchange correlation : 0.159067E+01 0.418597E-01 15.0 %
local pseudopotentials : 0.682831E-03 0.179692E-04 0.0 %
non-local pseudopotentials : 0.127134E+00 0.334563E-02 1.2 %
hartree potentials : 0.130639E-01 0.343787E-03 0.1 %
ion-ion interaction : 0.105786E-02 0.278385E-04 0.0 %
structure factors : 0.669738E-02 0.176247E-03 0.1 %
phase factors : 0.882049E-05 0.232118E-06 0.0 %
masking and packing : 0.213811E+00 0.562660E-02 2.0 %
queue fft : 0.192422E+01 0.506374E-01 18.2 %
queue fft (serial) : 0.107227E+01 0.282176E-01 10.1 %
queue fft (message passing): 0.791364E+00 0.208254E-01 7.5 %
>>> JOB COMPLETED AT Mon Sep 12 16:56:15 2016 <<<
Task times cpu: 18.5s wall: 18.6s
total time : 0.985406E+01 0.259317E+00 100.0 %
i/o time : 0.548607E+01 0.144370E+00 55.7 %
FFTs : 0.166741E+00 0.438793E-02 1.7 %
dot products : 0.178815E+00 0.470566E-02 1.8 %
geodesic : 0.274660E+00 0.722789E-02 2.8 %
ffm_dgemm : 0.636101E-01 0.167395E-02 0.6 %
fmf_dgemm : 0.211718E+00 0.557152E-02 2.1 %
m_diagonalize : 0.691879E-03 0.182073E-04 0.0 %
exchange correlation : 0.148924E+01 0.391906E-01 15.1 %
local pseudopotentials : 0.679016E-03 0.178688E-04 0.0 %
non-local pseudopotentials : 0.116550E+00 0.306710E-02 1.2 %
hartree potentials : 0.119827E-01 0.315333E-03 0.1 %
ion-ion interaction : 0.102091E-02 0.268660E-04 0.0 %
structure factors : 0.611088E-02 0.160813E-03 0.1 %
phase factors : 0.240793E-04 0.633665E-06 0.0 %
masking and packing : 0.194830E+00 0.512711E-02 2.0 %
queue fft : 0.170988E+01 0.449967E-01 17.4 %
queue fft (serial) : 0.963153E+00 0.253461E-01 9.8 %
queue fft (message passing): 0.699771E+00 0.184150E-01 7.1 %
>>> JOB COMPLETED AT Thu Sep 22 08:49:10 2016 <<<
Task times cpu: 17.3s wall: 17.4s
Summary of allocated global arrays
-----------------------------------
No active global arrays
......@@ -664,4 +664,4 @@ MA usage statistics:
K. Glaesemann, G. Sandrone, M. Stave, H. Taylor, G. Thomas, J. H. van Lenthe,
A. T. Wong, Z. Zhang.
Total times cpu: 18.5s wall: 18.6s
Total times cpu: 17.3s wall: 17.4s
......@@ -68,6 +68,10 @@ class TestDFTGaussianEnergy(unittest.TestCase):
result = self.results["program_version"]
self.assertEqual(result, "6.6")
def test_xc_functional(self):
result = self.results["XC_functional"]
self.assertEqual(result, "1.0*MGGA_C_TPSS+1.0*MGGA_X_TPSS")
def test_atom_labels(self):
atom_labels = self.results["atom_labels"]
expected_labels = np.array(["O", "H", "H"])
......@@ -203,6 +207,14 @@ class TestDFTGaussianForce(unittest.TestCase):
result = self.results["configuration_periodic_dimensions"]
self.assertTrue(np.array_equal(result, np.array([False, False, False])))
def test_electronic_structure_method(self):
result = self.results["electronic_structure_method"]
self.assertEqual(result, "DFT")
def test_xc_functional(self):
result = self.results["XC_functional"]
self.assertEqual(result, "1.0*MGGA_C_TPSS+1.0*MGGA_X_TPSS")
def test_atom_forces(self):
result = self.results["atom_forces"]
expected_result = convert_unit(
......@@ -228,6 +240,14 @@ class TestDFTGaussianGeoOpt(unittest.TestCase):
result = self.results["configuration_periodic_dimensions"][0]
self.assertTrue(np.array_equal(result, np.array([False, False, False])))
def test_xc_functional(self):
result = self.results["XC_functional"]
self.assertEqual(result, "1.0*MGGA_C_TPSS+1.0*MGGA_X_TPSS")
def test_electronic_structure_method(self):
result = self.results["electronic_structure_method"]
self.assertEqual(result, "DFT")
def test_frame_sequence(self):
sequence = self.results["section_frame_sequence"][0]
......@@ -355,49 +375,73 @@ class TestDFTGaussianMD(unittest.TestCase):
)
cls.kin = convert_unit(
np.array([
0.003270,
0.003055,
0.001843,
0.001541,
0.001163,
0.001588,
0.001316,
0.001306,
0.000875,
0.000360,
]),
"hartree"
)
cls.pot = convert_unit(
np.array([
-76.324877,
-76.324529,
-76.324138,
-76.323751,
-76.323442,
-76.325047,
-76.324974,
-76.324885,
-76.324800,
-76.324755,
]),
"hartree"
)
cls.cons = convert_unit(
np.array([
-76.321607,
-76.321474,
-76.322295,
-76.322210,
-76.322278,
-76.323459,
-76.323657,
-76.323578,
-76.323925,
-76.324394,
]),
"hartree"
)
cls.temp = convert_unit(
np.array([
688.40,
643.13,
387.93,
324.45,
244.91,
334.35,
277.07,
275.04,
184.29,
75.89,
]),
"K"
)
def get_system(self, index):
scc = self.get_scc(index)
system_ref = scc["single_configuration_calculation_to_system_ref"]
system = self.results["section_system"][system_ref]
return system
def get_scc(self, index):
sample_refs = self.results["frame_sequence_local_frames_ref"]
sccs = self.results["section_single_configuration_calculation"]
scc = sccs[sample_refs[index]]
return scc
def test_configuration_periodic_dimensions(self):
result = self.results["configuration_periodic_dimensions"][0]
self.assertTrue(np.array_equal(result, np.array([False, False, False])))
def test_single_configuration_to_calculation_method(self):
result = self.results["single_configuration_to_calculation_method_ref"]
self.assertTrue(np.array_equal(result, np.array(6*[0])))
def test_electronic_structure_method(self):
result = self.results["electronic_structure_method"]
self.assertEqual(result, "DFT")
def test_xc_functional(self):
result = self.results["XC_functional"]
self.assertEqual(result, "1.0*HYB_GGA_XC_PBEH")
def test_sampling_method(self):
result = self.results["sampling_method"]
self.assertEqual(result, "molecular_dynamics")
......@@ -412,7 +456,7 @@ class TestDFTGaussianMD(unittest.TestCase):
def test_frame_sequence_local_frames_ref(self):
result = self.results["frame_sequence_local_frames_ref"]
self.assertTrue(np.array_equal(result, np.array(range(5))))
self.assertTrue(np.array_equal(result, np.array(range(1, 6))))
def test_number_of_frames_in_sequence(self):
result = self.results["number_of_frames_in_sequence"]
......@@ -453,47 +497,52 @@ class TestDFTGaussianMD(unittest.TestCase):
self.assertTrue(np.allclose(result[1], expected_result[1], rtol=0, atol=0.0001))
def test_atom_positions(self):
result = self.results["atom_positions"]
first_system = self.get_system(0)
first_pos = first_system["atom_positions"]
last_system = self.get_system(-1)
last_pos = last_system["atom_positions"]
expected_start = convert_unit(
np.array([
[-0.000000, -0.030541, 0.214843],
[0.000000, 1.520797, -0.645137],
[-0.000000, -1.286347, -1.077605],
[-0.000000, -0.032407, 0.213730],
[ 0.000000, 1.547303, -0.646826],
[-0.000000, -1.283238, -1.058258],
]),
"bohr"
)
expected_end = convert_unit(
np.array([
[-0.000000, -0.027285, 0.217217],
[0.000000, 1.483269, -0.644023],
[-0.000000, -1.300501, -1.116390],
[-0.000000, -0.034144, 0.212417],
[ 0.000000, 1.583695, -0.644729],
[-0.000000, -1.292061, -1.039511],
]),
"bohr"
)
self.assertTrue(np.array_equal(result[0, :], expected_start))
self.assertTrue(np.array_equal(result[-1, :], expected_end))
self.assertTrue(np.array_equal(first_pos, expected_start))
self.assertTrue(np.array_equal(last_pos, expected_end))
def test_atom_forces(self):
result = self.results["atom_forces"]
first_force = self.get_scc(0)["atom_forces"]
last_force = self.get_scc(-1)["atom_forces"]
expected_start = convert_unit(
-np.array([
[0.000000, 0.017462, -0.022827],
[-0.000000, -0.023895, 0.014570],
[0.000000, 0.006434, 0.008257],
[ 0.000000, -0.003686, -0.024792],
[-0.000000, -0.009261, 0.007954],
[ 0.000000, 0.012947, 0.016838],
]),
"forceAu"
)
expected_end = convert_unit(
-np.array([
[0.000000, 0.053886, -0.016628],
[-0.000000, -0.046371, 0.025550],
[-0.000000, -0.007515, -0.008923],
[-0.000000, -0.023297, -0.023732],
[-0.000000, 0.008095, 0.001352],
[ 0.000000, 0.015202, 0.022380],
]),
"forceAu"
)
self.assertTrue(np.array_equal(result[0, :], expected_start))
self.assertTrue(np.array_equal(result[-1, :], expected_end))
self.assertTrue(np.array_equal(first_force, expected_start))
self.assertTrue(np.array_equal(last_force, expected_end))
# def test_atom_velocities(self):
# result = self.results["atom_velocities"]
......@@ -568,6 +617,129 @@ class TestDFTGaussianXCFunctional(unittest.TestCase):
xc = get_result("dft_gaussian/functionals/hcth407", "XC_functional")
self.assertEqual(xc, "1.0*GGA_XC_HCTH_407")
def test_tpss(self):
xc = get_result("dft_gaussian/functionals/tpss", "XC_functional")
self.assertEqual(xc, "1.0*MGGA_C_TPSS+1.0*MGGA_X_TPSS")
#===============================================================================
class TestDFTPWEnergy(unittest.TestCase):
"""Tests that the parser can handle plane-wave DFT energy calculations.
"""
@classmethod
def setUpClass(cls):
cls.results = get_results("dft_pw/energy", "section_run")
# cls.results.print_summary()
def test_program_name(self):
result = self.results["program_name"]
self.assertEqual(result, "NWChem")
def test_configuration_periodic_dimensions(self):
result = self.results["configuration_periodic_dimensions"][0]
self.assertTrue(np.array_equal(result, np.array([True, True, True])))
def test_program_version(self):
result = self.results["program_version"]
self.assertEqual(result, "6.6")
def test_total_charge(self):
charge = self.results["total_charge"][0]
self.assertEqual(charge, 0)
def test_electronic_structure_method(self):
result = self.results["electronic_structure_method"][0]
self.assertEqual(result, "DFT")
def test_simulation_cell(self):
result = self.results["simulation_cell"][0]
self.assertTrue(np.array_equal(result, convert_unit(np.array(
[
[20.0, 0.0, 0.0],
[0.0, 20.0, 0.0],
[0.0, 0.0, 20.0],
]), "angstrom")
))
# def test_atom_labels(self):
# atom_labels = self.results["atom_labels"]
# expected_labels = np.array(["O", "H", "H"])
# self.assertTrue(np.array_equal(atom_labels, expected_labels))
# def test_atom_positions(self):
# atom_position = self.results["atom_positions"]
# expected_position = convert_unit(np.array(
# [
# [0.00000000, 0.00000000, -0.11817375],
# [0.76924532, 0.00000000, 0.47269501],
# [-0.76924532, 0.00000000, 0.47269501],
# ]
# ), "angstrom")
# self.assertTrue(np.array_equal(atom_position, expected_position))
# def test_number_of_atoms(self):
# n_atoms = self.results["number_of_atoms"]
# self.assertEqual(n_atoms, 3)
# def test_energy_total(self):
# result = self.results["energy_total"]
# expected_result = convert_unit(np.array(-76.436222730188), "hartree")
# self.assertTrue(np.array_equal(result, expected_result))
# def test_energy_x(self):
# result = self.results["energy_X"]
# expected_result = convert_unit(np.array(-9.025345841743), "hartree")
# self.assertTrue(np.array_equal(result, expected_result))
# def test_energy_c(self):
# result = self.results["energy_C"]
# expected_result = convert_unit(np.array(-0.328011552453), "hartree")
# self.assertTrue(np.array_equal(result, expected_result))
# def test_energy_total_scf_iteration(self):
# result = self.results["energy_total_scf_iteration"]
# # Test the first and last energies
# expected_result = convert_unit(np.array(
# [
# [-76.3916403957],
# [-76.4362227302],
# ]), "hartree")
# self.assertTrue(np.array_equal(np.array([[result[0]], [result[-1]]]), expected_result))
# def test_energy_change_scf_iteration(self):
# result = self.results["energy_change_scf_iteration"]
# expected_result = convert_unit(np.array(
# [
# [-8.55E+01],
# [-3.82E-07],
# ]), "hartree")
# self.assertTrue(np.array_equal(np.array([[result[0]], [result[-1]]]), expected_result))
# def test_scf_max_iteration(self):
# result = self.results["scf_max_iteration"]
# self.assertEqual(result, 50)
# def test_scf_threshold_energy_change(self):
# result = self.results["scf_threshold_energy_change"]
# self.assertEqual(result, convert_unit(1.00E-06, "hartree"))
# def test_scf_dft_number_of_iterations(self):
# result = self.results["number_of_scf_iterations"]
# self.assertEqual(result, 6)
# def test_spin_target_multiplicity(self):
# multiplicity = self.results["spin_target_multiplicity"]