Read amplitudes from a text/binary file

87 views
Skip to first unread message

jxzou

unread,
Nov 6, 2023, 6:52:30 AM11/6/23
to molpro-user
Dear Molpro developers and users,
I know from the manual that Molpro can save/read CCSD t1, t2 amplitudes by
```
{CCSD;core,1;save,4000.2}
{CCSD;core,1;start,4000.2}
```
But this seems to be accomplished in the memory. Is there any keyword to read/save t1, t2 amplitudes from/to disk? A possible usage maybe: assuming that I've obtained converged MOs as well as  amplitudes of a nearby geometry and projections onto the current geometry have  been performed, now I want to read in the amplitudes and see whether it is converged very soon.

Thanks for any suggestion.

Best,
Dr. Jingxiang Zou

Grant Hill

unread,
Nov 6, 2023, 7:02:24 AM11/6/23
to jxzou, molpro-user
Hello,

I’ve not tried this for CCSD restarts, but perhaps making file 2 “permanent” will do what you want?


Hope this helps,
Grant


--
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 on the web, visit https://groups.google.com/d/msgid/molpro-user/c91d30c6-0325-4f00-8f45-e8601e3a9882n%40googlegroups.com.

Tatiana Korona

unread,
Nov 6, 2023, 7:32:42 AM11/6/23
to jxzou, molpro-user
Dear Dr. Jingxiang Zou,

The following input prints for me (in the main output) all coefficients > a given threshold:

gthresh,thrpri=-0.0001

hf
{ccsd
print,cp=-1
}

Best wishes,

Tatiana


--

andreas...@gmail.com

unread,
Nov 6, 2023, 2:49:59 PM11/6/23
to molpro-user
Dear Jingxiang,

here is an example based on Grant's suggestion to use the restart option for Molpro files:
Input file 1 with the initial geometry:

file,2,test.dat,new
geometry={
O  0.0000000000  0.0000000000 -0.0573384885
H  0.7581330543  0.0000000000  0.5338192442
H -0.7581330543  0.0000000000  0.5338192442
}
basis=vdz
hf
{ccsd; save,4000.2}

The line 'file,2,test.dat,new' saved the whole file 2 containing orbital coefficients, ccsd amplitudes, etc. to an external
file named (here) test.dat. The standard directory for the location of this file is $HOME/wfu, but you can change this
using the -W option on the command line.

The second file for the restart then could look like this (now with a slightly different geometry):

file,2,test.dat
geometry={
O   0.00  0.0  -0.057
H   0.76  0.0   0.53
H  -0.76  0.0   0.53
}
basis=vdz
{hf; start,2100.2}
{ccsd; start,4000.2}

Best wishes,
Andreas

jxzou

unread,
Nov 7, 2023, 4:16:40 AM11/7/23
to molpro-user
Thank you Grant, Tatiana, and Andreas. Your answers are very helpful to me.

The input files provided by Andreas do work. If the geometry is identical within two jobs, the SCF and CCSD are converged in 1 cycle, which means that the MOs, and t1, t2 amplitudes are read successfully.

My real question would be a little bit of complicated: I have MOs and t1, t2 amplitudes from other programs (CFOUR, PySCF, etc), I can write these data into plain text files or raw data binary files, using simple Fortran code. But it seems difficult to write data into a .wfu file or generate a .wfu file, since the .wfu file contains much more information than I thought. So I'm wondering if there is any syntax in Molpro like this

{matrop;
read, t1, AMP, file=t1.txt;
save, t1, 4000.2, AMPLITUDES}
{CCSD;start,4000.2}

If such syntax does exist, the question could be solved immediately. Note that the four lines above are my imagination, it does not work when it is written into the Molpro input file. I got the inspiration from the known syntax for reading MOs
{matrop;
read,mo,ORB,file=h2o_rhf.a;
save,mo,2100.2,ORBITALS}
{HF;start,2100.2}

So, I think I'm close to the final answer about reading CCSD amplitudes from a raw text/binary file. Either I try to generate a .wfu file, or I try to figure out how to read amplitudes using "matrop;read".

More help and suggestions would be greatly appreciated.

Best,
Jingxiang Zou

andreas...@gmail.com

unread,
Nov 7, 2023, 2:40:13 PM11/7/23
to molpro-user
Dear Jingxiang,

importing orbitals/amplitudes from other programs into Molpro is very tricky due to various reasons. Firstly, of course, you have to make sure that
ALL thresholds for integrals/energy/density etc. are set to the most tight settings possible. And second, spherical basis functions are usually ordered
differently in the different programs. So what you need to do in case, e.g., of orbital coefficients is to reorder them to match the same order as Molpro
(use gprint,basis in the header of the input file to look up the order of the basis functions in Molpro).

The main problem with this is, however, that there is currently no way to read/save the amplitude record on a file. The {matrop; export,...} and
{matrop; import,...} methods only work in conjunction with dump records (like the record that saves the orbital coefficients). But the record that save the
coupled cluster amplitudes for restarts is no dump record, so this approach can unfortunately not be used.

Because of this I do not see any (easy) way how one could restart ccsd calculations with manipulated amplitudes from an external source.

Best wishes,
Andreas

jxzou

unread,
Nov 8, 2023, 3:14:43 AM11/8/23
to molpro-user
Thanks for your kind help, Andrea. Now please allow me to make a sincere request: Would Molpro developers be so kind as to add a dump record for CC amplitudes in the future version of Molpro program?

Before there exists a dump record for CC amplitudes, I think a plausible way currently is to generate a .wfu binary file from scratch, which seems not easy at all.

The transferring of MOs among quantum chemistry programs has been achieved by me previously in the open source package MOKIT(https://gitlab.com/jxzou/mokit), in which the fch2com/mkl2com/py2molpro modules are developed for transferring MOs from Gaussian/ORCA/PySCF to Molpro (and reversed usage modules like xml2fch). These modules will transfer Cartesian coordinates, basis set data, MOs as well as some keywords simultaneously. The MO coefficients are correctly re-arranged according to the order of basis function angular momentum (5D/7F/9G/11H, 6D/10F/15G/21H). So far, these modules work nicely for wave function methods like RHF/ROHF/UHF and CASSCF (meaning SCF would be converged in 1~2 cycle). Indeed, this job is tricky and it took me some time. So now I'm working on transferring the CCSD amplitudes, which requires transferring the MOs, t1, and t2 amplitudes simultaneously since amplitudes will be affected by MOs.

Any suggestion or discussion are still welcomed from anyone who is reading this issue :)
Reply all
Reply to author
Forward
0 new messages