Read the coefficients for the wave function from WFN files, and combine them

535 views
Skip to first unread message

Daniele Ongari

unread,
Sep 19, 2018, 6:21:20 AM9/19/18
to cp2k
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, but it end up saying that RestartTools is not compatible with the newer versions of CP2K.

Thanks


hut...@chem.uzh.ch

unread,
Sep 19, 2018, 9:53:50 AM9/19/18
to cp...@googlegroups.com
Hi

1) maybe using the MOLDEN output option is the way to go?
2) this is usually not worth the trouble, but I don't know
your specific case. I think no such tool exists.

regards

Juerg
--------------------------------------------------------------
Juerg Hutter Phone : ++41 44 635 4491
Institut für Chemie C FAX : ++41 44 635 6838
Universität Zürich E-mail: hut...@chem.uzh.ch
Winterthurerstrasse 190
CH-8057 Zürich, Switzerland
---------------------------------------------------------------

-----cp...@googlegroups.com wrote: -----
To: "cp2k" <cp...@googlegroups.com>
From: "Daniele Ongari"
Sent by: cp...@googlegroups.com
Date: 09/19/2018 12:21PM
Subject: [CP2K:10749] Read the coefficients for the wave function from WFN files, and combine them
--
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...@googlegroups.com.
To post to this group, send email to cp...@googlegroups.com.
Visit this group at https://groups.google.com/group/cp2k.
For more options, visit https://groups.google.com/d/optout.

Matt W

unread,
Sep 19, 2018, 12:40:10 PM9/19/18
to cp2k
The MOLDEN output may well be the way to go. It needs a few updates to work in generally, however.

I have also had a request to support the wfx format


which requires very similar information to the molden output and can be used to add in core charges for Bader charge analysis etc. I will try and get it worked on in the near future.

Matt

Daniele Ongari

unread,
Sep 27, 2018, 4:09:52 AM9/27/18
to cp...@googlegroups.com

Screenshot from 2018-09-27 10-05-04.png

Thank you for the hint, but I think something is going weird with the conversion: the orbitals look fine if printed in a cube (with &PRINT/&MO_CUBES) but not on molden.
I will try to understand how the WFN is written and parse it directly then. Thanks!

Ole Schütt

unread,
Oct 2, 2018, 4:18:32 AM10/2/18
to cp...@googlegroups.com
Hi Daniele,

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


https://github.com/ondrejkrejci/PPSTM/blob/master/pyPPSTM/ReadSTM.py#L520

You can obtain the MO file like this:

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


-Ole


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...@googlegroups.com.
> To post to this group, send email to cp...@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

Daniele Ongari

unread,
Oct 4, 2018, 9:11:39 AM10/4/18
to cp2k
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.

Daniele
Message has been deleted

Leili Rassouli

unread,
Sep 19, 2023, 10:31:54 AM9/19/23
to cp2k
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,
Lili

cp2k

unread,
Sep 19, 2023, 10:46:42 AM9/19/23
to cp2k
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!

Daniele 

Leili Rassouli

unread,
Sep 19, 2023, 3:05:27 PM9/19/23
to cp...@googlegroups.com
Dear Daniele, 
Thanks for sharing your repositories with me.
Best,
Lili

You received this message because you are subscribed to a topic in the Google Groups "cp2k" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cp2k/8iUd_UfspA0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cp2k+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/0e49e520-742d-4c42-a645-5b77630c31c7n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages