[CP2K-user] [CP2K:19262] Re: Read the coefficients for the wave function from WFN files, and combine them

cp2k daniele.ongari at gmail.com
Tue Sep 19 14:46:42 UTC 2023

Hi Leili, 

it has been a while since I'm not working on it.

You can check these 2 repositories of mine: 
- experimenting: https://github.com/danieleongari/cp2k_wfncombine
- python package: https://github.com/danieleongari/cp2k_wfntools

Hope this helps!


Il giorno martedì 19 settembre 2023 alle 16:31:54 UTC+2 Leili Rassouli ha 

Hi Daniele,

I'm encountering a similar issue, and I'm interested in reading a binary 
.wfn file, making some changes, and then restarting the calculation with a 
newly created .wfn file. I was wondering if you have found a way or have a 
script for this task. Any insights on creating a new .wfn for restarting 
calculations would be greatly appreciated.

Best regards,

On Thursday, October 4, 2018 at 9:11:39 AM UTC-4 Daniele Ongari wrote:

Thanks I will try it!
In the meanwhile I'm working on a script that reads the WFN and hopefully 
can combine the coefficient from different fragments.


Il giorno martedì 2 ottobre 2018 10:18:32 UTC+2, Ole Schütt ha scritto:

Hi Daniele, 

I once wrote a parser for the molecular orbital coefficients in Python: 


You can obtain the MO file like this: 

       &MO ON 
         FILENAME cartesian-mos 
           QS_SCF 0 
         &END EACH 
       &END MO 
     &END PRINT 
   &END DFT 


On 2018-09-27 10:09, Daniele Ongari wrote: 
> Thank you for the hint, but I think something is going weir with the 
> conversion: the orbitals look fine if printed in a cube but not on 
> molden. 
> I will try to understand how the WFN is written and parse it directly 
> then. Thanks! 
> Il giorno mercoledì 19 settembre 2018 12:21:20 UTC+2, Daniele Ongari 
> ha scritto: 
>> Dear CP2K developers, 
>> I'm wondering if the binary WFN files generated by CP2K contain the 
>> coefficients for the gaussian basis set, so: 
>> 1) is there a tool to read the coefficients for the wave function 
>> from WFN files? I need it for educational purpose! 
>> 2) is it possible to combine the coefficients for weakly interacting 
>> fragments, to speed up calculations for interaction energies by 
>> using previously converged WFN of isolated fragments? 
>> So, I would need to make the WFN readable, understand the 
>> formatting, mix the two sets of coefficients, convert the file to a 
>> new binary WFN and restart the calculation from this. 
>> Is there already such a tool? I'm interested to work on it and 
>> possibly automatize the procedure using AiiDA. 
>> I found a similar old thread, 
>> https://groups.google.com/forum/#!topic/cp2k/wab9r_ltk2A [1], but it 
>> end up saying that RestartTools is not compatible with the newer 
>> versions of CP2K. 
>> Thanks 
>  -- 
> You received this message because you are subscribed to the Google 
> Groups "cp2k" group. 
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to cp2k+uns... at googlegroups.com. 
> To post to this group, send email to cp... at googlegroups.com. 
> Visit this group at https://groups.google.com/group/cp2k. 
> For more options, visit https://groups.google.com/d/optout. 
> Links: 
> ------ 
> [1] https://groups.google.com/forum/#!topic/cp2k/wab9r_ltk2A 

You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/0e49e520-742d-4c42-a645-5b77630c31c7n%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20230919/017e9280/attachment.htm>

More information about the CP2K-user mailing list