Looping over multiple basis set (string) vectors

32 views
Skip to first unread message

Lukáš Félix Pašteka

unread,
Jan 27, 2025, 4:22:09 PM1/27/25
to molpro-user
Dear Molpro community,

I am trying to run a calculation for different basis sets. While this is simple when the same basis sets are available for all atoms, I cannot figure out a way to mix different versions of basis sets available for different atoms.

The following minimal (non)working example is an attempt to use -X2C and -DK Dunning sets for Li and K atoms:

   ***,LiK test
   angstrom
   geometry={Li; K 1 2.7}
   dkho=101
   $bas=[VDZ,WCVDZ,AVDZ]
   do i=1,#bas
     basis={default=bas(i)-X2C; li=bas(i)-DK}
     rhf
   end do


However the calculation fails and the output reads:

   DO I                   =         1.00000000
   SETTING BASIS          =    VDZ-X2C,LI=BAS(I)-DK
   ...
   Cannot find default basis BAS(I)-DK for atom Li

As you can see, only one string variable is always replaced by its stored value.
Same thing happens if I explicitly use two separate basis vectors, such as:

   $bas1=[VDZ-X2C,WCVDZ-X2C,AVDZ-X2C]
   $bas2=[VDZ-DK,WCVDZ-DK,AVDZ-DK]
   do i=1,#bas1
     basis={default=bas1(i); li=bas2(i)}
     rhf
   end do


I tried all variations of the basis input syntax I could think of, and I tried other variable names, but I am probably missing something basic. 
I'm running Molpro 2024.

Is there a way to loop over multiple basis set vectors?

Best
Lukas



peterso...@gmail.com

unread,
Jan 27, 2025, 5:41:04 PM1/27/25
to Lukáš Félix Pašteka, molpro-user

Probably a more elegant solution, but the following works:

 

  angstrom

    geometry={Li; K 1 2.7}     

    dkho=101                             

    $bas1=[cc-pVDZ-X2C,cc-pWCVDZ-X2C,aug-cc-pVDZ-X2C]

    $bas2=[cc-pVDZ-DK,cc-pWCVDZ-DK,aug-cc-pVDZ-DK]

    do i=1,#bas1      

      basis={         

      spd,K,$bas1(i);c

      spd,Li,$bas2(i);c

            }

      rhf

    end do

 

regards,  -Kirk

--
You received this message because you are subscribed to the Google Groups "molpro-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to molpro-user...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/molpro-user/0616888f-ca30-43c1-95c6-e96becf2407en%40googlegroups.com.

Lukáš Félix Pašteka

unread,
Jan 28, 2025, 8:58:38 AM1/28/25
to molpro-user
Dear Kirk,
Thank you very much, this helps a lot! 
A small update - your script works well, but it is limited to basis sets with a priori known and constant angular span (e.g. spd). 
For a more general case that works with different cardinalities, one can use the following:

   $bas1=[cc-pVDZ-X2C,cc-pWCVDZ-X2C,cc-pVTZ-X2C]
   $bas2=[cc-pVDZ-DK,cc-pWCVDZ-DK,cc-pVTZ-DK]
   do i=1,#bas1
     basis={default=$bas1(i);Li=$bas2(i)}
     rhf
   end do

Alternatively, a single basis vector with suffixes added in the loop can be used:

   $bas=[cc-pVDZ,cc-pWCVDZ,cc-pVTZ]
   do i=1,#bas
     bas1='$bas(i)-X2C'
     bas2='$bas(i)-DK'
     basis={default=$bas1;Li=$bas2}
     rhf
   end do


I'll just add a few notes for the sake of posterity and others who might want to use this later:
  1. Using a full basis set name is crucial here (cc-pVDZ-X2C as opposed to the short name VDZ-X2C). Interestingly, one can use short basis name in bas1, but bas2 has to bear the full name. It is a mystery to me why this matters.
  2. Using the dollar sign in front of the variables ($bas1  $bas2) is also necessary. Although for the case with 1 basis vector, it is not. In the example given in Molpro manual, no dollar sign is used either, which is a little confusing.
  3. This works with both the   basis...end  and  basis={...}  syntax, but it does not work with the inline comma-separated   basis,...  syntax, i.e.   basis={default=$bas1(i);Li=$bas2(i)}  works,  but   basis,default=$bas1(i),Li=$bas2(i)  does not work.
Best
Lukas

peterso...@gmail.com

unread,
Jan 28, 2025, 9:37:04 AM1/28/25
to Lukáš Félix Pašteka, molpro-user

Dear Lukas,

 

Ah, I hadn’t thought to just use your approach but with the full names.  Certainly much nicer and glad that works.

 

Best regards,  -Kirk

Reply all
Reply to author
Forward
0 new messages