Multiwfn official website: //www.umsyar.com/multiwfn. Multiwfn forum in Chinese: http://bbs.keinsci.com/wfn
You are not logged in.
Dear Tian Lu,
Does MultiWFN have an implementation of incompete Gamma function?
I did not find its implementation in MultiWFN. Grepping in a bit outdated version of MultiWFN shows that output:
$ grep "incomplete" * -i
grep: libreta_fast: Is a directory
grep: libreta_slow: Is a directory
grep: noGUI: Is a directory
grep: noGUI.old: Is a directory
Best regards,
Igor
Dear Tian Lu,
I've created a new Density Functional Approximation's feature implied on generalized hypergeometric function.
My implementation in MultiWFN is based on Arb C library (https://arblib.org/). I hacked Makefile for linking MultiWFN with it. Unfortunately, currently, it leads to dynamic dependency from this library. Somehow, it is possible to link it statically.
Anyway, in the future, if somebody wants to compile MultiWFN by himself, it will require to have compiled Arb C library, which is not provided by MultiWFN. So, somebody will want to drop support of this library for his experiments. In that case, it will require to have one more script which removes Arb C library dependency (as it is done with ./noGUI.sh).
Also, compiling of libreta is too long. I disabled it in some of my experiments by removing its code.
Can we go out from Makefile to CMake (https://cmake.org) for simplifying building MultiWFN without applying any noSMTH.sh?
CMake allows people to choose which parts can be compiled much simpler than the running of noSMTH.sh with:
cmake -DENABLE_FEATURE=OFF
What do you think about it?
Best regards,
Igor
Dear Tian Lu,
Thank you so much!
Unfortunately, using 100.19, that is not possible to construct promolecular density of different dimers without changing .wfn files.
I used that script for generating dimers with promolecular densities for comparing their densities with SCF-optimized densities (they are at H2p_*.wfn files).
for wfn in H2p_*.wfn;
do
rm H0.5.wfn_001_0300_0434
coord=`grep "(CENTRE 1)" $wfn | sed "s/ \+/ /g" | cut -d" " -f8`
coord2=`echo "${coord} * 2" | bc -l`
ADD=`echo "1000 10 48 6 31 0,0,-${coord} 1 32 0,0,${coord2} 1 1 -1 100 -5 1 ${wfn} 0" | tr " " "\n" | ./gMultiwfn H0.5.wfn 2>/dev/null | grep "Final result:" | sed "s/ \+/ /g" | cut -d" " -f4`
echo "${wfn};${ADD}"
done
Probably, in the general case, I need a reader of XYZ-files and atomwfn directory for constructing promolecular densities for given XYZ's.
Best regards,
Igor
If someone will be interested in such duplication of system, this is the patch for doing that:
0002-Copy-fragments-and-MOs-while-dublication-is.patch.txt
It will produce repeated independent structures with independent molecular orbitals.
Best regards,
Igor
Dear Tian Lu,
I understand how to fix that part of the MultiWFN code for being it to work correctly (at least as I want).
I found a mistake with variable usage: center_tmp is not declared but used. The correct variable is ncenter_tmp.
There is a needed patch (works both for ifort and gfortran):
0001-center_tmp-is-not-declared.patch.txt
Best regards,
Igor
Dear Tian Lu
I'm trying to construct promolecule density of dimers using atom's densities.
I'm running the following set of commands:
./Multiwfn H0.5.wfn
6
31
0,0,-0.47243153
1
32
0,0,.94486306
1
1
0
It produces new.wfn which is incorrect since when I'm trying to integrate it using:
./Multiwfn new.wfn
100
4
1
it leads to SegFault. It comes from `noGUI/sub.f90:2610`
It seems to me that modifying of wfn by that way does not produce the correct wfn.
At least, the number of electrons should be 2 times more (occupation number).
There is an initial wfn and new.wfn:
H0.5.wfn - initial
new.wfn - wfn produced by MultiWFN
Best regards,
Igor
Dear Tian Lu,
Thank you so much! Now, it is working!
Best regards,
Igor
Dear Tian Lu,
I downloaded most recent //www.umsyar.com/multiwfn/misc/Multi … _noGUI.zip. Unfortunately, it continues to produce NaN local Hartree-Fock energy with
$ echo "1000 2 999 100 4 100" | tr " " "\n" | ./Multiwfn Al_large.wfn 2>/dev/null | grep "Final result"
Final result: NaN
Additionally, running that version of MultiWFN with attached to archive settings.ini leads to error:
forrtl: severe (59): list-directed I/O syntax error, unit -5, file Internal List-Directed Read
Image PC Routine Line Source
Multiwfn 0000000001F13C4B Unknown Unknown Unknown
Multiwfn 0000000001F4037E Unknown Unknown Unknown
Multiwfn 0000000001F3F0A5 Unknown Unknown Unknown
Multiwfn 000000000079DFBF Unknown Unknown Unknown
Multiwfn 0000000000802012 Unknown Unknown Unknown
Multiwfn 000000000042B022 Unknown Unknown Unknown
libc-2.31.so 00007FC51DAFD0B3 __libc_start_main Unknown Unknown
Multiwfn 000000000042AF29 Unknown Unknown Unknown
Best regards,
Igor
Dear Tian Lu,
While we tested a new code, we found that some basis sets lead to unreliable results while local Hartree-Fock energy is integrated over the whole space.
Here, the example .wfn where the problem is:
Al_large.wfn
At the same time, that .wfn have reliable energy:
Al_small.wfn
With binaries, provided in www.umsyar.com, we got the following energies:
$ echo "1000 2 999 100 4 100" | tr " " "\n" | ./Multiwfn Al_large.wfn 2>/dev/null | grep "Final result"
Final result: NaN
$ echo "1000 2 999 100 4 100" | tr " " "\n" | ./Multiwfn Al_small.wfn 2>/dev/null | grep "Final result"
Final result: -18.0695836639
Best regards,
Igor
Dear Tian Lu,
There is an actual patch for the latest version of MultiWFN for begin it be compiled with gFortran. That should work both for gFortran and Intel Fortran compiler.
0001-Fix-gfortran-builds.patch.txt
Could you please apply it to the current source code?
Best regards,
Igor
Dear Tian Lu,
Thank you so much!
Now, that is working!
Best regards,
Igor
Dear Tian Lu,
I found the problem. I do not use settings.ini.
I run Multiwfn as:
./Multiwfn H2O.wfn
1000
2
999
100
4
100
In that case, libreta is not initialized and genPprim routine is not called, so, Pprim_tot is not initialized.
I can write a code in 1000 section, but I'm not sure that it is a good idea since at the next time someone will need to fix several places.
What will be a better place for the correct initialization of needed libraries and matrixes?
Best regards,
Igor
Dear Tian Lu,
Thank you so much!
Unfortunately, I got SIGSEGV: Segmentation fault - invalid memory reference.
I will look what is the problem with my input file or with the implementation or with the compiler.
Best regards,
Igor
Dear Tian Lu,
Some DFT functionals use local Hartree-Fock energy as one of its features as density, gradient, or Laplacian. The not full list is presented at https://gitlab.com/libxc/libxc/-/issues/40.
An example of a computation procedure can be found at https://github.com/deepmind/deepmind-re … py#L29-L49:
The Hartree-Fock (HF) exchange energy can be written as:
-2 HF_x = \sum_{a,b,c,d} D_{ab} D_{cd} \int dr \int dr' [ \chi_a(r) \chi_c(r) v(r, r') \chi_b(r') \chi_d(r') ]
where D is the density matrix, \chi_a the atomic basis functions and r, r' are
coordinates. For clarity we have dropped the spin-channel label of the density
matrix.
Defining the following intermediates:
\nu_{bd}(r) = \int dr' (\chi_b(r') v(r, r') \chi_d(r'))
E_b(r) = \sum_a D_{ab} \chi_a(r)
E_d(r) = \sum_c D_{cd} \chi_c(r)
we get the following expression for HF:
-2 HF_x = \int dr \sum_{bd} E_b(r) E_d(r) \nu_{bd}(r)
Therefore the quantity
exx(r) = -0.5 sum_{bd} E_b(r) E_d(r) \nu_{bd}(r)
As I can see, \nu_{bd}(r) is a one-electron Coulomb integral that should be computed fastly using libreta.
Is it possible to implement?
Best regards,
Igor
Dear Tian Lu,
Thank you!
I have one more patch for fixing build errors with gfortran:
0001-Fix-compilation-errors-with-gfortan.patch.txt
It should work both with ifort and gfortran. That should be the end.
One more patch adds gfortran-build-related files:
0002-Add-compilation-with-gfortran.patch.txt
Note:
1) It does not apply any optimization level
2) Only several features are tested*
3) openblas is used (can be changed manually to another BLAS/LAPACK implementation)
4) at noGUI_gfortran some additional sed-hacks are:
sed "s/directory=/file=/" *.f90 -i
sed "/kmp_[sg]et_stacksize_s/Id" Multiwfn.f90 -i
sed "/mkl_set_num_threads/Id" Multiwfn.f90 -i
*Tested features:
- Integration of rho, grad, lapl, G(r), some user-defined functions (not presented in the current build)
- Output of cube files
- Computation of functions along the line
- Reduced Density Functions
Do you have any non-manual tests of Multiwfn?
Best regards,
Igor
Dear Tian Lu,
Thank you so much!
The count of compilation errors is decreased significantly!
I found that issue (5) is not fixed in the current version of the Multiwfn code.
One more error continues to be in define.f90:
define.f90:360:52:
360 | character :: graphformat*4="png ",graphformatname*4(9)=(/ "png ","gif ","tiff","bmp ","ps ","eps ","pdf ","wmf ","svg " /)
| 1
Error: Syntax error in data declaration at (1)
I do not know why gfortran does not understand such constructions. It looks correct.
Anyway, Fortran 2003 Standard says that CHARACTER* is the obsolescent feature (see Annex B.2.7).
It can be replaced with
character(len=4) :: graphformat="png ",graphformatname(9)=(/ "png ","gif ","tiff","bmp ","ps ","eps ","pdf ","wmf ","svg " /)
Similar errors are at fileIO.f90. At line 5293:
character bondstr*6(ncenter),anglestr*6(ncenter),dihstr*6(center)
and at line 6666 (basname):
character :: method*20="PBE",basname*30(-10:30)=" ",PBCdir*4="XYZ "
These expressions can be replaced with:
character(len=6) bondstr(ncenter),anglestr(ncenter),dihstr(center)
and at line 6666 (basname):
character :: method*20="PBE",PBCdir*4="XYZ "
character(len=30) :: basname(-10:30)=" "
(`len=`) can be skipped.
Gfortran also found one more place where logical comparison is `==` at line 261 of basin.f90:
where (interbasgrid==0) cubmattmp=0
interbasgrid is logical variable. This error can be fixed as:
where (interbasgrid==.false.) cubmattmp=0
or even:
where (.not.interbasgrid) cubmattmp=0
Also, could you please declare `i` in defvar as `private` for avoiding spreading it in others modules? For example, right after `use` statement:
use deftype
integer, private :: i
Best regards,
Igor
Dear Tian Lu,
Array initialization is described in 4.7 on page 67 in Fortran 2003 standard.
Mostly, MultiWFN uses R465 statement.
array-constructor is (/ ac-spec /)
where `ac-spec` is
ac-spec is type-spec ::
or [type-spec ::] ac-value-list
So, for MultiWFN, most popular declaration is (/ ac-value-list /)
Then, the standard says: If `type-spec` is omitted, each `ac-value` expression in the array constructor shall have the same length type parameters.
That is the reason why gfortran says a lot of errors in array initializations where parameters do not have the same lengths.
Another possible fix of gfortran compilation is provide `type-spec` in each array declaration, where errors are. For example (see also note 4.72):
clrtransname(0:18)*50=(/ character(len=50) :: "Rainbow & white/black for out-of-limit data","Rainbow","Reversed rainbow","Rainbow starting from white","Spectrum","Reversed Spectrum","Grey","Reversed Grey","Blue-White-Red",&
"Red-White-Blue","Blue-Green-Red","Red-Green-Blue","White-Dark red","Black-Orange-Yellow","White-Dark green","Black-Green","White-Dark blue","Black-Blue-Cyan","Viridis" /)
> Using .eqv. and .neqv. heavily contradicts my habit and it is evidently not as convenient as simply using == and !=
By the way,
if(alive==.true.)
can be rewritten as
if(alive)
That is acceptable by the standard. I hope, you will find it useful.
Best regards,
Igor
Dear Tian Lu,
Thank you!
According to Fortran 2003 standard (draft is available here: https://j3-fortran.org/doc/year/04/04-007.pdf), for logical comparison, `.EQV.` or `.NEQV.` operators should be used. See 7.2.4 on page 135: there are no available `==` operators. That is the reason for the first two sed-hacks.
I will look for character array initialization in Fortran standard.
Best regards,
Igor
Dear Lian Lu,
I tried to compile MultiWFN (noGUI version) with gfortran compiler for non-x86 architecture since ifort is not available there.
I found some mistakes during the porting process:
1) `integer,allocatable :: skippair(:)` at excittrans.f90:1136 should be `logical,allocatable :: skippair(:)`
See at line excittrans.f90:1207:
`skippair=.false.`
2) `if (excdir(iexcitorb)==2) strtmp1=" <-"` at excittrans.f90:4379 should be `if (excdir(iexcitorb)==2) strdir=" <-"`
`strtmp1` is not declared as a character variable
3) `read(*,"(a)") radfilename` at population.f90:794 reads to `real*8` variable, since there is no type declaration of `radfilename` at the beginning of routine. `radfilename` should be declared as `character(len=200) :: radfilename`
Also, there is a couple of hard-to-understand errors that arise when someone tries to use gfortran:
4) at visweak.f90:326, the `\` is at the end of the line that leads to comment out the next line
`real*8,allocatable :: dg_intra(:,:,:) !delta-g_intra of fragments`
and as a result, `dg_intra` has only `real*8` type according to `implicit real*8`.
That is specific to the GCC preprocessor. Could you please remove that symbol?
5) at grid.f90:821, `integer function ifgridortho` is declared without parentheses. Could you please add them?
It should be `integer function ifgridortho()` at the end.
Additionally, most of the changes for making possible compilation with gfortran can be done by applying a couple sed-scripts:
sed -i "s/==.true./.eqv..true./" *.f90
sed -i "s/==.false./.eqv..false./" *.f90
sed -i 's/"A+B"," A"," B"/"A+B"," A "," B "/' GUI.f90 sub.f90 util.f90
That would be great if these scripts will be applied to MultiWFN source code.
Also, there is one more patch for compiling define.f90 using gfortran:
0001-Fix-compilation-errors-in-define.f90.patch.txt
That is not the full list of patches, which are required, but these will extremely decrease work for porting of new versions of MultiWFN.
Best regards,
Igor
Dear Tian Lu,
Thank you so much!
Best regards,
Igor
Dear Tian Lu,
I see that problem both in Ubuntu in WSL and in Fedora 34 with the source code package of MultiWFN 3.8(dev) from 31 January 2022.
I found that these files have specific charset:
$ file -i * | grep text/plain | grep iso
basin.f90: text/plain; charset=iso-8859-1
excittrans.f90: text/plain; charset=iso-8859-1
fuzzy.f90: text/plain; charset=iso-8859-1
hyper_polar.f90: text/plain; charset=iso-8859-1
otherfunc3.f90: text/plain; charset=iso-8859-1
population.f90: text/plain; charset=iso-8859-1
sub.f90: text/plain; charset=iso-8859-1
topology.f90: text/plain; charset=iso-8859-1
util.f90: text/plain; charset=iso-8859-1
But this charset is wrong: the source code has other specific encodings. For example, util.f90 has GBK encoding.
I have attached a patch that changes encodings in problem files to universal UTF-8 charset.
0001-Use-UTF-8-charset.patch.txt
You could apply that using `patch < 0001-Use-UTF-8-charset.patch.txt` in the root directory of MultiWFN.
Best regards,
Igor
Dear Tian Lu,
One of example is
$ grep "overlap" util.f90 -i
! *** Overlap ***
Binary file util.f90 matches
The fastest way to detect binary files is to run the following command:
$ grep "." * | grep "Binary file"
and it produces (slightly cleaned):
Binary file basin.f90 matches
Binary file excittrans.f90 matches
Binary file fuzzy.f90 matches
Binary file hyper_polar.f90 matches
Binary file otherfunc3.f90 matches
Binary file population.f90 matches
Binary file sub.f90 matches
Binary file topology.f90 matches
Binary file util.f90 matches
Best regards,
Igor
Dear Tian Lu,
I'm trying to implement some additional features for testing my own theory to Multiwfn.
Sometimes, I use grep for finding descriptions of routines. Unfortunately, if I forget to add -a flag to the grep command, sometimes I see:
Binary file sub.f90 matches
Binary file topology.f90 matches
Binary file util.f90 matches
It seems to me that the problem is with some specific characters that are not presented in the UTF-8 charset.
Could you please fix the encoding?
Additionally, I noticed that noGUI.sh copies dislin_d-11.0.a to noGUI directory and then it is not used.
Best regards,
Igor
Dear Prof. Lu,
Thank you for your reply!
So, in which way can I provide patches to MultiWFN?
Best regards,
Igor
Dear Prof Lu,
Thank you for making electron density analysis simple with your program!
I'm interested in the development of MultiWFN, mostly, now, in the support of compiling with gfortran.
I have a git repository (https://github.com/FulgurIgor/MultiWFN) where some patches are applied. For example, in https://github.com/FulgurIgor/MultiWFN/ … -gMultiWFN branch, MultiWFN, which can be compiled with gfortran, is.
What do you about creating a git repository from your side for adding patches from outside?
Best regards,
Igor