Skip to content

Commit 389a123

Browse files
committed
update samples/
1 parent 7f3b73b commit 389a123

File tree

84 files changed

+9525
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+9525
-0
lines changed
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#! Test if DGAS's orbital rotation code matches expected values.
2+
#! The first two calculations compute the X (symm A'') and A (symm A') states of HO2 in Cs
3+
#! by restricting the occupations of the two states.
4+
#! The second two calculations compute the X and A states of HO2 in C1. Computation
5+
#! of the A state requires a rotation of the HOMO and SOMO by 90 degrees
6+
#! (i.e., by swapping these two orbitals). The orb_rotate() function accomplishes this.
7+
8+
# Restrict occupations to compute CCSD/6-31G energy of X state (symm A'') of HO2 in Cs.
9+
set {
10+
basis 6-31G
11+
reference rohf
12+
maxiter 500
13+
e_convergence 10
14+
d_convergence 10
15+
r_convergence 10
16+
freeze_core True
17+
scf_type pk
18+
docc [7, 1]
19+
socc [0, 1]
20+
}
21+
22+
molecule ho2 {
23+
0 2
24+
O -0.6937342972 0.0081785728 0.0000000000
25+
O 0.6354757377 -0.0626608366 0.0000000000
26+
H 0.9246056151 0.8646730647 0.0000000000
27+
}
28+
29+
scf_e, scf_wfn = energy('scf', return_wfn=True)
30+
ccsd_e, ccsd_wfn = energy('ccsd', return_wfn=True)
31+
32+
33+
clean()
34+
35+
# Restrict occupations to compute CCSD/6-31G energy of A state (symm A') of HO2 in Cs.
36+
set {
37+
docc [6, 2]
38+
socc [1, 0]
39+
}
40+
41+
scf_e, scf_wfn = energy('scf', return_wfn=True)
42+
ccsd_e, ccsd_wfn = energy('ccsd', return_wfn=True)
43+
44+
45+
clean()
46+
47+
# Compute CCSD/6-31G energy of X state of HO2 in C1.
48+
set {
49+
docc [8]
50+
socc [1]
51+
}
52+
53+
molecule ho2 {
54+
0 2
55+
O -0.6937342972 0.0081785728 0.0000000000
56+
O 0.6354757377 -0.0626608366 0.0000000000
57+
H 0.9246056151 0.8646730647 0.0000000000
58+
symmetry c1
59+
}
60+
61+
scf_e, scf_wfn = energy('scf', return_wfn=True)
62+
ccsd_e, ccsd_wfn = energy('ccsd', return_wfn=True)
63+
64+
65+
# Rotate HOMO and SOMO by 90 degrees to obtain guess for A state of HO2 in C1.
66+
#orb_rotate(scf_wfn.Ca(), 0, 7, 8, 90.0)
67+
Matrix.rotate_columns(scf_wfn.Ca(), 0, 7, 8, math.pi / 2.0)
68+
69+
fname = os.path.split(os.path.abspath(core.get_writer_file_prefix(scf_wfn.molecule().name())))[1]
70+
filename = os.path.join(core.IOManager.shared_object().get_default_path(), fname + ".180.npz")
71+
data = {}
72+
data.update(scf_wfn.Ca().np_write(None, prefix="Ca"))
73+
data.update(scf_wfn.Cb().np_write(None, prefix="Cb"))
74+
75+
Ca_occ = scf_wfn.Ca_subset("SO", "OCC")
76+
data.update(Ca_occ.np_write(None, prefix="Ca_occ"))
77+
78+
Cb_occ = scf_wfn.Cb_subset("SO", "OCC")
79+
data.update(Cb_occ.np_write(None, prefix="Cb_occ"))
80+
81+
data["reference"] = core.get_option('SCF', 'REFERENCE')
82+
data["nsoccpi"] = scf_wfn.soccpi().to_tuple()
83+
data["ndoccpi"] = scf_wfn.doccpi().to_tuple()
84+
data["nalphapi"] = scf_wfn.nalphapi().to_tuple()
85+
data["nbetapi"] = scf_wfn.nbetapi().to_tuple()
86+
data["symmetry"] = scf_wfn.molecule().schoenflies_symbol()
87+
data["BasisSet"] = scf_wfn.basisset().name()
88+
data["BasisSet PUREAM"] = scf_wfn.basisset().has_puream()
89+
np.savez(filename, **data)
90+
91+
# Read in rotated guess and compute CCSD/6-31G energy of A state of HO2 in C1.
92+
set {
93+
guess read
94+
}
95+
96+
scf_e, scf_wfn = energy('scf', return_wfn=True)
97+
ccsd_e, ccsd_wfn = energy('ccsd', return_wfn=True)
98+
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#! Test if DGAS's orbital rotation code matches expected values.
2+
#! The first two calculations compute the X (symm A'') and A (symm A') states of HO2 in Cs
3+
#! by restricting the occupations of the two states.
4+
#! The second two calculations compute the X and A states of HO2 in C1. Computation
5+
#! of the A state requires a rotation of the HOMO and SOMO by 90 degrees
6+
#! (i.e., by swapping these two orbitals). The orb_rotate() function accomplishes this.
7+
8+
# Restrict occupations to compute CCSD/6-31G energy of X state (symm A'') of HO2 in Cs.
9+
set {
10+
basis 6-31G
11+
reference rohf
12+
maxiter 500
13+
e_convergence 10
14+
d_convergence 10
15+
r_convergence 10
16+
freeze_core True
17+
scf_type pk
18+
docc [7, 1]
19+
socc [0, 1]
20+
}
21+
22+
molecule ho2 {
23+
0 2
24+
O -0.6937342972 0.0081785728 0.0000000000
25+
O 0.6354757377 -0.0626608366 0.0000000000
26+
H 0.9246056151 0.8646730647 0.0000000000
27+
}
28+
29+
scf_e, scf_wfn = energy('scf', return_wfn=True)
30+
ccsd_e, ccsd_wfn = energy('ccsd', return_wfn=True)
31+
32+
compare_values(-150.108136116503147, scf_e, 6, 'X SCF energy') #TEST
33+
compare_values(-150.347533153677489, ccsd_e, 6, 'X CCSD energy') #TEST
34+
35+
clean()
36+
37+
# Restrict occupations to compute CCSD/6-31G energy of A state (symm A') of HO2 in Cs.
38+
set {
39+
docc [6, 2]
40+
socc [1, 0]
41+
}
42+
43+
scf_e, scf_wfn = energy('scf', return_wfn=True)
44+
ccsd_e, ccsd_wfn = energy('ccsd', return_wfn=True)
45+
46+
compare_values(-150.087298715913619, scf_e, 6, 'A SCF energy') #TEST
47+
compare_values(-150.312480530946573, ccsd_e, 6, 'A CCSD energy') #TEST
48+
49+
clean()
50+
51+
# Compute CCSD/6-31G energy of X state of HO2 in C1.
52+
set {
53+
docc [8]
54+
socc [1]
55+
}
56+
57+
molecule ho2 {
58+
0 2
59+
O -0.6937342972 0.0081785728 0.0000000000
60+
O 0.6354757377 -0.0626608366 0.0000000000
61+
H 0.9246056151 0.8646730647 0.0000000000
62+
symmetry c1
63+
}
64+
65+
scf_e, scf_wfn = energy('scf', return_wfn=True)
66+
ccsd_e, ccsd_wfn = energy('ccsd', return_wfn=True)
67+
68+
compare_values(-150.108136116503147, scf_e, 6, 'X SCF energy') #TEST
69+
compare_values(-150.347533153677489, ccsd_e, 6, 'X CCSD energy') #TEST
70+
71+
# Rotate HOMO and SOMO by 90 degrees to obtain guess for A state of HO2 in C1.
72+
#orb_rotate(scf_wfn.Ca(), 0, 7, 8, 90.0)
73+
Matrix.rotate_columns(scf_wfn.Ca(), 0, 7, 8, math.pi / 2.0)
74+
75+
fname = os.path.split(os.path.abspath(core.get_writer_file_prefix(scf_wfn.molecule().name())))[1]
76+
filename = os.path.join(core.IOManager.shared_object().get_default_path(), fname + ".180.npz")
77+
data = {}
78+
data.update(scf_wfn.Ca().np_write(None, prefix="Ca"))
79+
data.update(scf_wfn.Cb().np_write(None, prefix="Cb"))
80+
81+
Ca_occ = scf_wfn.Ca_subset("SO", "OCC")
82+
data.update(Ca_occ.np_write(None, prefix="Ca_occ"))
83+
84+
Cb_occ = scf_wfn.Cb_subset("SO", "OCC")
85+
data.update(Cb_occ.np_write(None, prefix="Cb_occ"))
86+
87+
data["reference"] = core.get_option('SCF', 'REFERENCE')
88+
data["nsoccpi"] = scf_wfn.soccpi().to_tuple()
89+
data["ndoccpi"] = scf_wfn.doccpi().to_tuple()
90+
data["nalphapi"] = scf_wfn.nalphapi().to_tuple()
91+
data["nbetapi"] = scf_wfn.nbetapi().to_tuple()
92+
data["symmetry"] = scf_wfn.molecule().schoenflies_symbol()
93+
data["BasisSet"] = scf_wfn.basisset().name()
94+
data["BasisSet PUREAM"] = scf_wfn.basisset().has_puream()
95+
np.savez(filename, **data)
96+
97+
# Read in rotated guess and compute CCSD/6-31G energy of A state of HO2 in C1.
98+
set {
99+
guess read
100+
}
101+
102+
scf_e, scf_wfn = energy('scf', return_wfn=True)
103+
ccsd_e, ccsd_wfn = energy('ccsd', return_wfn=True)
104+
105+
compare_values(-150.087298715913619, scf_e, 6, 'A SCF energy') #TEST
106+
compare_values(-150.312480530946573, ccsd_e, 6, 'A CCSD energy') #TEST
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#! DFT (hybrids) + GCP test of implementations in: hybrid_superfuncs.py
2+
3+
##ORCA v.4.0.1, cc-pVDZ, RI-MP2, no FC, GRID7
4+
# PW6B95
5+
# WB97X-D3
6+
# HF-3c
7+
# PBEh-3c
8+
# PBE0
9+
##Gaussian 09: 5D SP Int(Grid=99770)
10+
# wb97x
11+
# SOGGA11-X
12+
##Gaussian 16: cc-pvdz 5D SP int=(grid=99770)
13+
# MN15
14+
15+
# MISSING:
16+
# "wpbe" : build_wpbe_superfunctional,
17+
# "wpbe0" : build_wpbe0_superfunctional,
18+
# "b5050lyp" : build_b5050lyp_superfunctional,
19+
20+
21+
molecule ne {
22+
0 1
23+
Ne
24+
}
25+
26+
set df_scf_guess false
27+
set basis cc-pvdz
28+
set reference rks
29+
set dft_radial_points 99
30+
set dft_spherical_points 770
31+
set dft_block_scheme naive
32+
set scf_type direct
33+
34+
35+
edft = energy('hf3c/minix')
36+
compare_values(-127.718790886397, edft, 4, 'Ne: HF3c')
37+
clean()
38+
edft = energy('pbeh3c/def2-mSVP')
39+
compare_values(-128.695398806080, edft, 4, 'Ne: PBEh3c')
40+
clean()
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#! DFT (hybrids) + GCP test of implementations in: hybrid_superfuncs.py
2+
3+
##ORCA v.4.0.1, cc-pVDZ, RI-MP2, no FC, GRID7
4+
# PW6B95
5+
# WB97X-D3
6+
# HF-3c
7+
# PBEh-3c
8+
# PBE0
9+
##Gaussian 09: 5D SP Int(Grid=99770)
10+
# wb97x
11+
# SOGGA11-X
12+
##Gaussian 16: cc-pvdz 5D SP int=(grid=99770)
13+
# MN15
14+
15+
# MISSING:
16+
# "wpbe" : build_wpbe_superfunctional,
17+
# "wpbe0" : build_wpbe0_superfunctional,
18+
# "b5050lyp" : build_b5050lyp_superfunctional,
19+
20+
21+
molecule ne {
22+
0 1
23+
Ne
24+
}
25+
26+
set df_scf_guess false
27+
set basis cc-pvdz
28+
set reference rks
29+
set dft_radial_points 99
30+
set dft_spherical_points 770
31+
set dft_block_scheme naive
32+
set scf_type direct
33+
34+
35+
edft = energy('hf3c/minix')
36+
compare_values(-127.718790886397, edft, 4, 'Ne: HF3c')
37+
clean()
38+
edft = energy('pbeh3c/def2-mSVP')
39+
compare_values(-128.695398806080, edft, 4, 'Ne: PBEh3c')
40+
clean()
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#! HF3C fd and analytical gradient
2+
3+
molecule mol {
4+
O
5+
H 1 1.1
6+
H 1 1.1 2 109
7+
}
8+
9+
set basis cc-pVDZ
10+
grad_fd = psi4.gradient("HF3C", dertype=0)
11+
grad = psi4.gradient("HF3c", dertype=1)
12+
13+
14+
compare_matrices(grad, grad_fd, 5, "HF3C fd gradient check")
15+
compare_matrices(ref, grad, 7, "HF3C analytical gradient check")

samples/gcp/hf3c-gradients/test.in

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#! HF3C fd and analytical gradient
2+
3+
ref = psi4.Matrix.from_list([ #TEST
4+
[ -0.000000000000, 0.000000000000, -0.118041687256], #TEST
5+
[ 0.000000000000, -0.103275936355, 0.059020843628], #TEST
6+
[ -0.000000000000, 0.103275936355, 0.059020843628]]) #TEST
7+
molecule mol {
8+
O
9+
H 1 1.1
10+
H 1 1.1 2 109
11+
}
12+
13+
set basis cc-pVDZ
14+
grad_fd = psi4.gradient("HF3C", dertype=0)
15+
grad = psi4.gradient("HF3c", dertype=1)
16+
17+
18+
compare_matrices(grad, grad_fd, 5, "HF3C fd gradient check")
19+
compare_matrices(ref, grad, 7, "HF3C analytical gradient check")

samples/gcp/hf3c-hessian/input.dat

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#! HF3C fd and analytical frequency
2+
3+
# Changing ref freq on basis of diff after projection.
4+
# pre-proj all modes:array(['0.0027i', '0.0004', '0.0006', '950.8842', '1137.0842', '1217.0028', '2166.3889', '2804.6651', '3100.0664'],
5+
# pre-proj all modes:['0.0001i' '0.0000i' '0.0000i' '0.0000' '0.0000' '0.0001' '2166.3889' '2804.6651' '3098.6811']
6+
7+
8+
molecule mol {
9+
O
10+
H 1 1.1
11+
H 1 1.1 2 109
12+
symmetry c1
13+
}
14+
15+
set basis sto-3g
16+
scf_e_fd, scf_wfn_fd = psi4.frequency("HF3C", dertype=1, return_wfn=True, project_rot=True)
17+
freq_fd = scf_wfn_fd.frequencies()
18+
19+
scf_e, scf_wfn = psi4.frequency("HF3C", dertype=2, return_wfn=True, project_rot=True)
20+
freq = scf_wfn.frequencies()
21+
22+

samples/gcp/hf3c-hessian/test.in

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#! HF3C fd and analytical frequency
2+
3+
ref = psi4.Vector.from_list([2166.389, 2804.665, 3098.681]) #TEST
4+
# Changing ref freq on basis of diff after projection.
5+
# pre-proj all modes:array(['0.0027i', '0.0004', '0.0006', '950.8842', '1137.0842', '1217.0028', '2166.3889', '2804.6651', '3100.0664'],
6+
# pre-proj all modes:['0.0001i' '0.0000i' '0.0000i' '0.0000' '0.0000' '0.0001' '2166.3889' '2804.6651' '3098.6811']
7+
8+
9+
molecule mol {
10+
O
11+
H 1 1.1
12+
H 1 1.1 2 109
13+
symmetry c1
14+
}
15+
16+
set basis sto-3g
17+
scf_e_fd, scf_wfn_fd = psi4.frequency("HF3C", dertype=1, return_wfn=True, project_rot=True)
18+
freq_fd = scf_wfn_fd.frequencies()
19+
20+
scf_e, scf_wfn = psi4.frequency("HF3C", dertype=2, return_wfn=True, project_rot=True)
21+
freq = scf_wfn.frequencies()
22+
23+
compare_vectors(freq, freq_fd, -1, "HF3C fd frequency check") #TEST
24+
compare_vectors(ref, freq, 2, "HF3C analytical frequency check") #TEST
25+

0 commit comments

Comments
 (0)