Molcas Forum

Support and discussions for Molcas and OpenMolcas users and developers

You are not logged in.

Announcement

Welcome to the Molcas forum.

Please note: The forum's URL has changed. The new URL is: https://molcasforum.univie.ac.at. Please update your bookmarks!

You can choose an avatar and change the default style by going to "Profile" → "Personality" or "Display".

#1 2018-03-01 06:44:14

MHHsieh
Member
Registered: 2018-02-26
Posts: 10

[SOLVED] The input of constrained optimization

Hi,

Thanks for replying me the last question.
I have another question about constrained optimization:
I want to optimize a molecule with ONLY ONE atom can move, while others are fixed.

In Gaussian, there are a keyword can fix the atom directly.
For example, opt=readopt and noatoms atoms=1, this will only optimize the atom number 1 and fix other atoms. (LINK)
In Molpro, keyword 'active' can also be used to control only one atom. (LINK)

I noticed that Molcas can use vary and fix to control specified internal coordinates.
However, it seems that I have to assign all internal coordinates and to put it into vary and fix.
If I put only what I want to fix in fix, then the following message will be printed:

 **************** ERROR **********************
  N.r of Internal Coordinates lower than 3N-6
 *********************************************

Does Molcas have similar function that I can put something in "fix" while others will automatically set to be "vary"?
If not, is there any method to find out all internal coordinates? because I have 39 atoms in my system...

Thanks.

Best,
M.H.

Last edited by MHHsieh (2018-03-01 07:42:20)

Offline

#2 2018-03-01 09:54:40

Ignacio
Administrator
From: Uppsala
Registered: 2015-11-03
Posts: 1,085

Re: [SOLVED] The input of constrained optimization

You should use the "Constraints" block in GATEWAY (with similar syntax to "Internal" in SLAPAF). For your case, if you want everything fixed but one atom, assuming there is no external field, the easiest is probably using the "Fragment" keyword:

Constraints
  * Here you put all the atoms in your system except the one you want to optimize
  f = Fragment C1 C2 H3 O5 ...
 Values
  f = Fix
End of constraints

If there is some external field (no translation/rotation invariance), it's probably better to constrain all Cartesian coordinates instead:

Constraints
  c1 = Cartesian x C1
  c2 = Cartesian y C1
  c3 = Cartesian z C1
  ...
 Values
  c1 = Fix
  c2 = Fix
  c3 = Fix
  ...
End of constraints

Note that with extensive constraints the computational cost of numerical gradients is greatly reduced and it may become an attractive option, especially since the numerical differentiation is parallelized.

Offline

#3 2018-03-01 17:10:36

MHHsieh
Member
Registered: 2018-02-26
Posts: 10

Re: [SOLVED] The input of constrained optimization

It works!
Thank you very much!

MH

Offline

#4 2020-11-25 11:33:06

moev96
Member
Registered: 2020-11-02
Posts: 13

Re: [SOLVED] The input of constrained optimization

Hi,

maybe I could reopen this topic again. I want to use this for Naphthalene (as a simple example). Following the second method, I always get at the SLAPAF calculation an error: "Constraints are linear dependent!".

My input file is the following

&GATEWAY
Basis set
 C.cc-pVDZ
 * C positions  
 C1    -0.0000     0.7156842     0.0000 /Angstrom
 C3     1.2444     1.4023581     0.0000 /Angstrom
 C7     2.4202     0.7126588     0.0000 /Angstrom
 Cartesian(all)
end of basis

Basis set
 H.cc-pVDZ
 * H positions
 H3     1.2424     2.4782     0.0000 /Angstrom
 H7     3.3612     1.2470     0.0000 /Angstrom
 Cartesian(all)      
end of basis

Constraints
 f1   = Cartesian x C1
 f2   = Cartesian y C1
 f3   = Cartesian z C1
 f4   = Cartesian x C3
 f5   = Cartesian y C3
 f6   = Cartesian z C3
 f7   = Cartesian x C7
 f8   = Cartesian y C7
 f9   = Cartesian z C7
 Values
 f1 = Fix
 f2 = Fix
 f3 = Fix
 f4 = Fix
 f5 = Fix
 f6 = Fix
 f7 = Fix
 f8 = Fix
 f9 = Fix 
End of constraints

Symmetry
 XY XZ XYZ

>>  Do  while
&SEWARD
&SCF    
 charge 
  0
&SLAPAF
>>  EndDo

Following the first method only fixes the bond distances between C1-C3 and C3-C7, or am I assuming this wrong (took a look in the output and this also did not worked perfectly (differs from the original input by (0.002 angstrom)))? (C1-C7 bond distance was a 0.01 angstrom different from the input)
Would be great if the output coordiantes would really be fixed.

Thanks.

Best

Offline

#5 2020-11-25 19:52:52

Ignacio
Administrator
From: Uppsala
Registered: 2015-11-03
Posts: 1,085

Re: [SOLVED] The input of constrained optimization

Try not specifying the coordinates that are zero by symmetry (x C1, z C1, z C3, z C7)

Offline

#6 2020-11-26 17:55:37

moev96
Member
Registered: 2020-11-02
Posts: 13

Re: [SOLVED] The input of constrained optimization

Thank you so much, it is working now.

Offline

Board footer

Powered by FluxBB 1.5.11

Last refresh: Today 23:05:55