ValeevGroup / mpqc

The Massively Parallel Quantum Chemistry program, MPQC, computes properties of atoms and molecules from first principles using the time independent Schrödinger equation.
66 stars 24 forks source link

optimize fail at update atomic coordinates #36

Closed pchong90 closed 9 years ago

pchong90 commented 9 years ago

I am running MPQC with caspt2 from Molcas.

previous iteration:

gradient in internal coordinates
1 0.0000005000
gradient in Cartesian coordinates
1 0.0000000000
2 -0.0000000000
3 -0.0000003536
4 0.0000000000
5 0.0000000000
6 0.0000003536
.......................................
Starting "backtrack" line optimization.
RASSCF energy [au]: -100.083249970000
CASPT2 energy [au]: -0.223376470000
Total CASPT2 energy [au]: -100.306626440000
Sufficient decrease cannot be achieved for the requested value accuracy. Skipping line search. MolcasPT2R12: changing atomic coordinates: Molecular formula: HF molecule: ( symmetry = c1 unit = "angstrom" { n atoms geometry }={ 1 H [ -0.0000000000 0.0000000000 -0.8283798730] 2 F [ 0.0000000000 -0.0000000000 0.0924798730] } ) Atomic Masses: 1.00783 18.99840 Reference origin = [ 0.0000000000 0.0000000000 0.0000000000] Finished "backtrack" line optimization. ....................................... Max Gradient : 0.0000003536 0.0000001000 no Max Displacement : 0.0000002899 0.0000001000 no Gradient*Displace: 0.0000000000 0.0000001000 yes taking step of size 0.000000 Optimization iteration 4 complete //////////////////////////////////////////////////////////////////////

next iteration: gradient in internal coordinates 1 0.0000005000 gradient in Cartesian coordinates 1 0.0000000000 2 -0.0000000000 3 -0.0000003536 4 0.0000000000 5 -0.0000000000 6 0.0000003536 NOTICE: maxabs_gradient increased from 3.5355e-07 to 3.5355e-07 ....................................... Starting "backtrack" line optimization. RASSCF energy [au]: -100.083249980000 CASPT2 energy [au]: -0.223376460000 Total CASPT2 energy [au]: -100.306626440000 MolcasPT2R12: changing atomic coordinates: Molecular formula: HF molecule: ( symmetry = c1 unit = "angstrom" { n atoms geometry }={ 1 H [ 0.0000002902 -0.0000000228 -2048799803.9995157719] 2 F [ 0.0000000020 -0.0000009555 2048799803.4597973824] } ) Atomic Masses: 1.00783 18.99840 Reference origin = [ 0.0000000000 0.0000000000 0.0000000000]

I will take a look on the QNewton algorithm about updating stepsize

pchong90 commented 9 years ago

update:

the problem come from the inverse BFGS hessian 1 2
1 1.0000000000
2 -0.0000000000 1.0000000000
3 0.9399626144 2.1093753639
4 0.0000000000 0.0000000000
5 0.0000000000 0.0000000000
6 -0.9399626139 -2.1093753628
3 4
3 4032902427836434.0000000000
4 0.0034431655 1.0000000000
5 -2.9931933212 -0.0000000000
6 -4032902425739279.5000000000 -0.0034431655
5 6
5 1.0000000000
6 2.9931933197 4032902423642127.5000000000

evaleev commented 9 years ago

Weird, it seems it's singular? It should be using a pseudoinverse anyway On Mar 20, 2015 5:55 PM, "Chong Peng" notifications@github.com wrote:

update:

the problem come from the inverse BFGS hessian 1 2

1 1.0000000000

2 -0.0000000000 1.0000000000

3 0.9399626144 2.1093753639

4 0.0000000000 0.0000000000

5 0.0000000000 0.0000000000

6 -0.9399626139 -2.1093753628

                    3                             4

3 4032902427836434.0000000000

4 0.0034431655 1.0000000000

5 -2.9931933212 -0.0000000000

6 -4032902425739279.5000000000 -0.0034431655

                    5                             6

5 1.0000000000

6 2.9931933197 4032902423642127.5000000000

— Reply to this email directly or view it on GitHub https://github.com/ValeevGroup/mpqc/issues/36#issuecomment-84164556.

pchong90 commented 9 years ago

The problem come from the gradient. it happens that g(n-1) = g(n) at x(n-1) and x(n). when updating BFGS, g(n-1)-g(n) will just be zero, and it will appear in the denominator.

when x(n-1) and x(n) is very close. Molcas round it to 6 decimal digit. so x(n-1) = x(n) after the round up.

I will look into how to make Molcas more accurate.

But it is still worth to add a check that g(n-1) != g(n). I will do it later.

pchong90 commented 9 years ago

Problem is the energy MPQC get from Molcas is not accurate enough. Temporary solution is printing more digits for energy in Molcas.