-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reading grad.npy (psi4) #182
Comments
Dear sunghwan-choi, the formatting you chose makes this issue quite hard to read ;) To me it appears as if your Psi4 is working, isn't it? It seems the calculation actually runs, as you get an energy value?! If you use Psi4 via the runpsi.sh script please check if you can run the input pysisyphus generates by directly passing the input file to the script. This way you could exclude the possibility that something is wrong with your Psi4 setup. Please try to run the following yaml input (which works on my machine ... ;)): geom:
type: cart
fn: lib:hcn_iso_hf_sto3g_ts_opt.xyz
calc:
type: psi4
method: WB97X-D3
pal: 2
charge: 0
mult: 1
basis: def2-TZVP
irc:
type: eulerpc
rms_grad_thresh: 1e-3
hessian_recalc: 10
endopt:
thresh: gau_tight All the best, |
Thank you for your super fast response and I am sorry for the weird formatting. I edited my original issue. I found a clue... p.s. Could you share your output? because the IRC convergence from your input is not well achieved even though I run pysis on my login node |
Please see the attached logfile. I ran it with a development version of pysisyphus that I'll release soon. But there shouldn't be any major changes that would affect IRC convergence ... d8b 888
Y8P 888
888
88888b. 888 888 .d8888b 888 .d8888b 888 888 88888b. 88888b. 888 888 .d8888b
888 "88b 888 888 88K 888 88K 888 888 888 "88b 888 "88b 888 888 88K
888 888 888 888 "Y8888b. 888 "Y8888b. 888 888 888 888 888 888 888 888 "Y8888b.
888 d88P Y88b 888 X88 888 X88 Y88b 888 888 d88P 888 888 Y88b 888 X88
88888P" "Y88888 88888P' 888 88888P' "Y88888 88888P" 888 888 "Y88888 88888P'
888 888 888 888
888 Y8b d88P Y8b d88P 888
888 "Y88P" "Y88P" 888
Version 0.7.5.dev144+g3f3aa59d (Python 3.9.9, NumPy 1.22.1, SciPy 1.7.3)
Executed at Mon Feb 14 09:17:35 2022 on 'dachshoehle'
Platform: Linux-5.10.89-1-MANJARO-x86_64-with-glibc2.33
Interpreter: /home/johannes/.pyenv/versions/pysis/bin/python
Current working directory: /home/johannes/tmp/244_psi4irc
If pysisyphus benefitted your research please cite:
https://doi.org/10.1002/qua.26390
Good luck!
{'calc': {'basis': 'def2-TZVP',
'charge': 0,
'method': 'WB97X-D3',
'mult': 1,
'pal': 2,
'type': 'psi4'},
'endopt': {'T': 298.15,
'do_hess': False,
'dump': True,
'fragments': False,
'geom': {'coord_kwargs': {}, 'type': 'redund'},
'max_cycles': 150,
'overachieve_factor': 5,
'p': 101325,
'thresh': 'gau_tight',
'type': 'rfo'},
'geom': {'coord_kwargs': {},
'fn': 'lib:hcn_iso_hf_sto3g_ts_opt.xyz',
'type': 'cart'},
'irc': {'hessian_recalc': 10, 'rms_grad_thresh': '1e-3', 'type': 'eulerpc'}}
Read 1 geometries.
###############
# RUNNING IRC #
###############
Calculating energy and gradient at TS.
Transition vector is mode 0 with wavenumber -1096.44 cm⁻¹.
Energy-based (ΔE=0.001 au) initial displacement from the TS using 2rd derivatives.
Initial step lengths (not mass-weighted):
Forward: 0.1942 au
Backward: 0.1942 au
IRC length in mw. coords, max(|grad|) and rms(grad) in unweighted coordinates.
#################
# IRC - FORWARD #
#################
Requested energy lowering: 0.0010 au ( 2.63 kJ mol⁻¹)
Actual energy lowering: 0.0007 au ( 1.97 kJ mol⁻¹)
Δ: 0.0003 au ( 0.66 kJ mol⁻¹)
Step IRC length dE / au max(|grad|) rms(grad)
--------------------------------------------------------
0 0.194126 -0.004556 0.024928 0.012939
1 0.291866 -0.001974 0.019902 0.011187
2 0.384751 -0.002278 0.023885 0.013112
3 0.482529 -0.002683 0.027980 0.015120
4 0.584002 -0.003029 0.031767 0.016852
5 0.688261 -0.003320 0.035122 0.018282
6 0.793885 -0.003537 0.037983 0.019400
7 0.900298 -0.003692 0.040323 0.020219
8 1.007119 -0.003790 0.042156 0.020758
9 1.114089 -0.003828 0.043505 0.021032
10 1.221351 -0.003828 0.044343 0.021078
11 1.329898 -0.003839 0.044771 0.020934
12 1.437631 -0.003751 0.044730 0.020597
13 1.545368 -0.003662 0.044241 0.020084
14 1.652979 -0.003545 0.043336 0.019411
15 1.760450 -0.003400 0.042059 0.018586
16 1.866704 -0.003193 0.040409 0.017630
17 1.973002 -0.003014 0.038335 0.016545
18 2.078814 -0.002811 0.035886 0.015344
19 2.183507 -0.002576 0.033121 0.014036
20 2.287005 -0.002330 0.030015 0.012629
21 2.389526 -0.002074 0.026675 0.011143
22 2.490467 -0.001797 0.023099 0.009580
23 2.589843 -0.001508 0.019304 0.007954
24 2.687856 -0.001221 0.015267 0.006268
25 2.785241 -0.000937 0.011013 0.004513
26 2.880813 -0.000627 0.006646 0.002718
27 2.976726 -0.000316 0.002089 0.000900
rms(grad) converged!
##################
# IRC - BACKWARD #
##################
Requested energy lowering: 0.0010 au ( 2.63 kJ mol⁻¹)
Actual energy lowering: 0.0012 au ( 3.19 kJ mol⁻¹)
Δ: -0.0002 au (-0.57 kJ mol⁻¹)
Step IRC length dE / au max(|grad|) rms(grad)
--------------------------------------------------------
0 0.162984 -0.004157 0.037137 0.015421
1 0.266768 -0.001959 0.018877 0.009731
2 0.358038 -0.001858 0.016394 0.009795
3 0.452411 -0.001932 0.016508 0.009953
4 0.550510 -0.001926 0.016491 0.009689
5 0.650759 -0.001854 0.016061 0.009246
6 0.752882 -0.001785 0.015540 0.008878
7 0.855737 -0.001726 0.015221 0.008727
8 0.959764 -0.001724 0.015176 0.008809
9 1.064819 -0.001755 0.015308 0.009030
10 1.170707 -0.001799 0.015507 0.009329
11 1.277586 -0.001853 0.015670 0.009645
12 1.384742 -0.001895 0.016004 0.009936
13 1.492333 -0.001935 0.016313 0.010163
14 1.600885 -0.001964 0.016699 0.010315
15 1.709318 -0.001966 0.017187 0.010401
16 1.818372 -0.001970 0.017501 0.010400
17 1.926789 -0.001939 0.017606 0.010319
18 2.035126 -0.001906 0.017538 0.010149
19 2.142717 -0.001839 0.017278 0.009898
20 2.249516 -0.001767 0.016673 0.009595
21 2.355238 -0.001689 0.015993 0.009224
22 2.460078 -0.001604 0.015193 0.008781
23 2.564932 -0.001527 0.014254 0.008279
24 2.668006 -0.001417 0.013245 0.007726
25 2.770515 -0.001311 0.012139 0.007129
26 2.871668 -0.001195 0.011004 0.006506
27 2.971267 -0.001081 0.010070 0.005855
28 3.070456 -0.000975 0.009014 0.005172
29 3.166768 -0.000843 0.007846 0.004481
30 3.260426 -0.000714 0.007051 0.003774
31 3.352153 -0.000589 0.005873 0.003065
32 3.442341 -0.000465 0.004586 0.002352
33 3.530369 -0.000345 0.003180 0.001639
34 3.618020 -0.000225 0.001666 0.000932
rms(grad) converged!
#################################
# OPTIMIZING REACTION PATH ENDS #
#################################
+----------------------------------+
| RUNNING FORWARD_END OPTIMIZATION |
+----------------------------------+
Input geometry: Geometry(C1_H1_N1, 3 atoms)
Coordinate system: redund
Optimizer: rfo
Spent 0.0 s preparing the first cycle.
If not specified otherwise, all quantities are given in au.
cycle Δ(energy) max(|force|) rms(force) max(|step|) rms(step) s/cycle
0 nan 0.002183 0.001119 0.021818 0.010913 3.48
1 -0.000031 0.000670 0.000335 0.009658 0.004829 3.54
2 -0.000003 0.000013 0.000006 0.000126 0.000063 3.45
Unexpected energy increase (0.000000 au)! Trust radius: old=0.5, new=0.125
3 0.000000 0.000013 0.000007 86.975798 43.504488 3.56
Crashed input:
molecule mol{
C -0.86201350 0.56246683 -32.01279748
H 0.46699835 1.67201219 16.55278598
N 0.46146579 -0.55880611 15.46001150
0 1
symmetry c1
}
set_num_threads(2)
memory 1000 MB
set basis def2-TZVP
G, wfn = gradient('WB97X-D3', return_wfn=True)
G_arr = np.array(G)
np.save('grad', G_arr)
Wavefunction.to_file(wfn, '/home/johannes/tmp/244_psi4irc/qm_calcs/forward_end_001.004.wfn.npy')
print('PARSE ENERGY:', wfn.energy())
Copied contents of
'/tmp/forward_end_001_004_mg4imamf'
to
'/home/johannes/tmp/244_psi4irc/crashed_forward_end_001'.
Consider checking the log files there.
Optimization crashed!
+-----------------------------------+
| RUNNING BACKWARD_END OPTIMIZATION |
+-----------------------------------+
Input geometry: Geometry(C1_H1_N1, 3 atoms)
Coordinate system: redund
Optimizer: rfo
Spent 0.0 s preparing the first cycle.
If not specified otherwise, all quantities are given in au.
cycle Δ(energy) max(|force|) rms(force) max(|step|) rms(step) s/cycle
0 nan 0.002253 0.001319 0.005411 0.003142 3.46
1 -0.000011 0.002115 0.001221 0.078576 0.045375 3.49
2 -0.000087 0.000791 0.000557 0.004561 0.002731 3.40
3 -0.000001 0.000144 0.000083 0.005308 0.003065 3.47
Unexpected energy increase (0.000001 au)! Trust radius: old=0.5, new=0.125
4 0.000001 0.000158 0.000118 0.002397 0.001387 3.50
5 -0.000000 0.000082 0.000065 0.002393 0.001384 3.47
6 -0.000001 0.000017 0.000014 0.000680 0.000393 3.47
Unexpected energy increase (0.000000 au)! Trust radius: old=0.125, new=0.1
7 0.000000 0.000001 0.000000 0.000025 0.000014 3.42
Converged!
Final summary:
max(forces, internal): 0.000001 hartree/(bohr,rad)
rms(forces, internal): 0.000000 hartree/(bohr,rad)
max(forces,cartesian): 0.000017 hartree/bohr
rms(forces,cartesian): 0.000009 hartree/bohr
energy: -93.40854690 hartree
Wrote final, hopefully optimized, geometry to 'backward_end_final_geometry.xyz'
Moved 'backward_end_final_geometry.xyz' to 'backward_end_opt.xyz'.
#############################################
# BARRIER HEIGHTS AFTER END OPTIMIZATION(S) #
#############################################
There appears to be a problem with the internal coordinates in the first end-optimization (FORWARD_END OPTIMIZATION). The energy profile looks reasonably smooth; the artifacts in the beginning stem from the fact, that the input geometry is not a proper TS at the given level of theory (wb97x-d3/def2-tzvp) but at HF/STO-3G. Disregarding the first points, the gradient-evolution along the IRC also looks good to me. What error do you get? |
I think the convergence issue (shown in the attached log) comes from the same problem. (npy files are not properly generated) IRC calculation needs to update gradient and hessian but pysis read the previous one. I think this is not the problem of psi4 because the explicit running of psi4 always generates npy files properly.
Anyhow, the problem is solved. but question remained; why pysisyphus cannot read npy file properly on a certain machine even though explicit psi4 running yields npy file properly. Also, I will report this situation to my system administrator. If I got some meaningful answers, I will post them. |
Does the following python script work? from pysisyphus.calculators import Psi4
from pysisyphus.helpers import geom_loader
geom = geom_loader("lib:hcn_iso_hf_sto3g_ts_opt.xyz")
calc = Psi4(
method="wb97x-d3",
basis="def2-tzvp",
pal=2,
charge=0,
mult=1
)
geom.set_calculator(calc)
energy = geom.energy
print("energy", energy)
forces = geom.forces
print("forces", forces)
hessian = geom.hessian
print("hessian", hessian) Personally I experience no issues in parsing the grad.npy files ... I'll try to look at the diverging endopt-Optimization. The generated internal coordinates are probably the issue. |
Sorry for being late. Your script perfectly run and the output is following
Are there any ways to set a scratch directory of calculations instead of the default /tmp/ directory? |
Good to know that it worked for you 😄
Yes! pysisyphus uses a function from the python stlib (
Personally, I use All the best, |
Thank you for your superfast answer. |
But the scratch directory is created in the specified directory, isn't it? |
scratch directory(in my case, irc_000_000_r_j5xcw7) was properly created. |
And does the simple script run with a modified Given the fact that pysisyphus appears to work when started on your login node, but doesn't work when executed from another node make this seem to be a problem on your side/your HPC cluster configuration... As I don't have access to your cluster I can't really reproduce this issue and right now I also ran out of ides of what to try ... Do you have experience with debugging python scripts with |
Hi, I have this issue before, but later I found it was due to insufficient memory allocated for psi4 to run. psi4 would directly exit and pysis would falsely assume that psi4 was done calculating, and try to read the grad. I was able to change the memory in file. |
Dear developers
I am a newbie. I want to calculate IRC with psi4.
Based on the example, I wrote a simple YAML input as
If I ran pysisyphus with psi4, the following error occurred.
In crashed_irc_000 folder, there is no grad.npy file.
but I think the generated input is fine because if I explicitly run psi4, then I can get grad.npy properly.
Why did this error happen?
My environment files are written as
The text was updated successfully, but these errors were encountered: