molden2qmc

General discussion of the Cambridge quantum Monte Carlo code CASINO; how to install and setup; how to use it; what it does; applications.
Katharina Doblhoff
Posts: 84
Joined: Tue Jun 17, 2014 6:50 am

Re: molden2qmc

Post by Katharina Doblhoff »

Hi Vladimir!
Congratulations! Sounds as if your did a great job here! You will make life easier for many more to come! Thanks,
Katharina
Vladimir_Konjkov
Posts: 165
Joined: Wed Apr 15, 2015 3:14 pm

Re: molden2qmc

Post by Vladimir_Konjkov »

Mike Towler wrote:Hi Vladimir,

OK - to me it sounds that from the CASINO perspective the best way to fix this is as follows:

(1) Make sure that the CASINO documentation (manual plus the stuff on the website) is absolutely clear about the need to
recompile Cfour - having added in the modified reorderedf.f routine - before its output can be used to generate a CASINO wave function file.

(2) We further modify the downloadable modified reorderedf.f routine so that it writes 'THIS FILE HAS BEEN MODIFIED' (or words to that effect) into the Cfour molden output file. We include this 'reorderedf2.f' routine in the utils/wfn_converters/cfour directory of the CASINO distribution. This assumes we can get permission to do so, and I don't see why not as it's only a 47 line bit of Fortran which makes their program give the right answer.

(3) When CASINO's molden2qmc reads a Cfour-produced molden file, it checks for a 'THIS FILE HAS BEEN MODIFIED' string and refuses to run unless it can find one.

The only issue with this is if the error is only in certain versions of Cfour - is that the case? If so, it would be helpful if the Cfour molden output contained version information. I'm guessing it doesn't?

Mike
Thanks for the tips Mike. They certainly are very reasonable, but until Saturday I will not have free time to do it.

Vladimir.
In Soviet Russia Casino plays you.
Vladimir_Konjkov
Posts: 165
Joined: Wed Apr 15, 2015 3:14 pm

Re: molden2qmc

Post by Vladimir_Konjkov »

Hi, all.

My roadmap for molden2qmc development were to implement one external code, as standard for comparison with another. Orca Implementation is now such a standard.
Further I can using molden2qmc functionality to compare MO-coefficients from two different external programs (both calculated the same molecule with C1 sym), this allows me to see
which one of ~10,000 MO-coefficients differ and how much. Thereby I can quite easy to implement support for those external programs whose developers have read the MOLDEN specification or even whose didn't (oh, those CFOUR developers).
For CFOUR, ORCA and Turbomole RHF conversion now implemented up to g-orbitals. For Psi4 it was implemented in previous version of script.
For CFOUR one need to recompile source code with modified reorderdf.f taken from:
https://github.com/Konjkov/molden2qmc/b ... eorderdf.f
unlike http://people.smu.edu/wzou/program/reorderdf.zip, it uses DCOPY instead of SCOPY and didn't truncate small MO-coefficients to zero.

If Mike Deible want me to implement Q-Chem let him send me the Molden file in spherical format for any molecule in def2-SVP or cc-pVDZ or
any standard basis, so I could check common structure of the file and GTO contraction coeff., after that I need def2-SVP, cc-pVTZ and cc-pVQZ
outputs for the next geometry (in angstroms) to check MO-coefficients conversion procedure:
N 0.5200 0.5300 0.5100
N -0.5200 -0.5200 0.5200
N -0.5200 0.5200 -0.5200
N 0.5200 -0.5200 -0.5200


If I have free time I'll try to implement Dalton. (I should re-register my Dalton2013 license to Dalton2015).

NWCHEM is an exceptional case. It does not create the Molden file but create ascii formated file with MO-coefficients by mov2asc util, together with the output file it allows to get all the necessary information to generate QMC input.
I also know that a similar procedure is implemented in the QWALK project http://www.qwalk.org/docs/docs/nwchem2q ... ource.html. I checked out it works.

If it's not difficult could you describe me the procedure of preparation the input files for calculations with a pseudopotential.
Let's say someone wants to calculate forces in QMC for methane molecule. So it should used pseudopotential for all atoms including hydrogen.
Whether it should use PP from http://vallico.net/casinoqmc/pplib/ or any PP available in external code?
Most external programs has no PP for hydrogen, is it efficiently to use a mixed set of PPs?
Often noted the importance of the correspondence between PP and gaussian basis set involved in calculations, which gaussian basis set correspond to Dirac-Fock AREP Trail & Needs?
may be this http://www.tcm.phy.cam.ac.uk/~mdt26/pse ... ussian.txt ?

Upd.
I have found that the use of Dirac-Fock AREP Trail & Needs easiest way (in ORCA).

Vladimir.
Attachments
orca_pp1.txt.gz
Dirac-Fock AREP Trail & Needs PP in ORCA format
(16.05 KiB) Downloaded 2324 times
Last edited by Vladimir_Konjkov on Sat May 16, 2015 4:39 pm, edited 4 times in total.
In Soviet Russia Casino plays you.
Vladimir_Konjkov
Posts: 165
Joined: Wed Apr 15, 2015 3:14 pm

Re: molden2qmc

Post by Vladimir_Konjkov »

Hi, Kevin.
I've got the following cartesian->spherical transformations for Turbomole:
https://github.com/Konjkov/molden2qmc/b ... mc.py#L682

and slightly different for Cfour:
https://github.com/Konjkov/molden2qmc/b ... mc.py#L802

Like you said cartesians within a shell are scaled before transformation, but factors are strange to me.

What do you think about this, where'd such coefficients come from.

Vladimir.
In Soviet Russia Casino plays you.
Vladimir_Konjkov
Posts: 165
Joined: Wed Apr 15, 2015 3:14 pm

Re: molden2qmc

Post by Vladimir_Konjkov »

Hi, Mike.

In the case of UHF calculation is not clear in what order should be placed in gwfn.data alpha and beta orbitals.
The first all alpha, then all beta orbitals or all orbitals in order of increasing energy or another way?

with respect, Vladimir.
In Soviet Russia Casino plays you.
Mike Towler
Posts: 239
Joined: Thu May 30, 2013 11:03 pm
Location: Florence
Contact:

Re: molden2qmc

Post by Mike Towler »

Hi Vladimir,
In the case of UHF calculation is not clear in what order should be placed in gwfn.data alpha and beta orbitals.
The first all alpha, then all beta orbitals or all orbitals in order of increasing energy or another way?
When writing out the vector of orbital coefficients denoted by CK in the gwfn.data specification in the manual, spin is the outer loop, then k point, then orbital in order of increasing energy, then basis function in a standard order. Obviously systems with no periodic boundary conditions are considered to have one k point. To quote the manual:

Code: Select all

  ORBITAL COEFFICIENTS
  --------------------

  & CK(NUM_REAL_K*NUM_AO*NUM_AO + NUM_COMPLEX_K*NUM_AO*NUM_AO)
    block as follows
     ----spin (spin-polarized calcs only)---------------------------------
    /                                                                     \
     ----k (for solids)-------------------------------
    /                                                 \
     ----bands-(solids)-or MOs (molecules) in order of increasing energy------
    /                                           \
     -AO-basis functions grouped by shell-
    /                                     \

    Complex coefficients are given as 2 adjacent real numbers (real,imaginary).
    Ordering of d orbital coefficients;
    z2, xz, yz, x2-y2, xy
    Ordering of f,g,..: m=0,1,-1,2,-2,3,-3,4,-4.....
Examples of how these things are written and read can be found in the various other converters in utils/wfn_converters in the CASINO distribution.

Hope that's clear.

Mike
Mike Towler
Posts: 239
Joined: Thu May 30, 2013 11:03 pm
Location: Florence
Contact:

Re: molden2qmc

Post by Mike Towler »

If it's not difficult could you describe me the procedure of preparation the input files for calculations with a pseudopotential.
Let's say someone wants to calculate forces in QMC for methane molecule. So it should used pseudopotential for all atoms including hydrogen.
Whether it should use PP from http://vallico.net/casinoqmc/pplib/ or any PP available in external code?
What's important is that CASINO and the external code use the same pseudopotential. If you use the Trail-Needs pseudopotentials which were designed for use with CASINO, then you need to input that into the external code. The TN pseudos are given on a radial grid for input into CASINO; input pseudopotentials to Gaussian basis set quantum chemistry programs are generally given as an expansion in Gaussians times powers of r. Corresponding expansions are given in the online library only for the programs GAUSSIAN, CRYSTAL, and GAMESS. The GAUSSIAN and CRYSTAL data is the same data in different formats. The GAMESS data is a less accurate parametrization since the code won't accept a sufficiently wide range of powers of r. If other programs accept the same kind of input, then the GAUSSIAN/CRYSTAL/GAMESS data will need to be transformed into the appropriate input format for the other program. That data could in principle be incorporated into the online library, or one could write a utility to do the transformation which could be included in the CASINO distribution in the utils/pseudo_converters directory.

If you want to use some other pseudopotential available in the external code, then you need to transform the expansion into CASINO x_pp.data radial grid format. This is what the utility 'ptm' included with the CASINO distribution is for.
Most external programs has no PP for hydrogen, is it efficiently to use a mixed set of PPs?
There is no problem to use all-electron hydrogens together with heavier pseudoatoms in CASINO when using Gaussian basis sets. Remember angular integrations of non-local pseudopotentials are very expensive in QMC and avoiding them where possible is good for efficiency. The use of such things is also a significant extra source of (pseudopotential localization) error particularly in transition elements. All-electron is therefore a good thing in general and should be used where possible (though it becomes very difficult to do for heavier atoms for the obvious reasons).
Often noted the importance of the correspondence between PP and gaussian basis set involved in calculations, which gaussian basis set correspond to Dirac-Fock AREP Trail & Needs? may be this http://www.tcm.phy.cam.ac.uk/~mdt26/pse ... ussian.txt ?
About ten of the Trail-Needs pseudopotentials in the online library have corresponding gaussian basis set data (courtesy of Mike D. and his collaborators, as outlined in the paper cited in your link above). This is clearly not enough, and we should really should pay someone to fill in the gaps (it's very hard to find someone with the time and patience to do repetitive tasks like that for which they get no official 'credit'!). For the others you would therefore need to 'design your own basis set'. Though this is resolutely unfashionable in the quantum chemistry community I do that by using a shell script to repeatedly run the external code -- starting with a 'good guess' basis set of sufficient flexibility and varying the basis set parameters (Gaussian exponents and possibly contraction coefficients) to minimize the energy and thereby to create a basis set 'optimized' with respect to that pseudopotential (this is also useful in all-electron cases). There are two scripts included with CASINO which do this - my 'billy' script (the first computer program I ever write back in 1992) and Pablo Lopez Rios's 'optimize_crystal' script. Both of these use the CRYSTAL program as the energy calculating code. For your regular quantum chemist, this would clearly not be the obvious choice but it does do finite atoms and molecules Hartree-Fock DFT which is enough for this purpose. I appreciate you probably don't have a copy of it?

You continue to do a great job. Your hard work is appreciated..

Cheers,
Mike
Vladimir_Konjkov
Posts: 165
Joined: Wed Apr 15, 2015 3:14 pm

Re: molden2qmc

Post by Vladimir_Konjkov »

I added support for Dalton2013 in molden2qmc script version 2.5.2, available from https://github.com/Konjkov/molden2qmc.

Two bad news:
In Dalton's MOLDEN file all occupation numbers of HF and DFT MOs are zero values by mistake. You should correct 'Number of electrons per primitive cell' in gwfn.data file by hand.
Dalton does not handle UHF calculations at all (only RHF or ROHF).

One good news:
I completely rewrote the algorithm of MO coefficients loading for all external codes. It became more elegant.

I want to support MOLPRO and QCHEM, but I do not have the appropriate licenses.

If someone has the license, I'll be very grateful if he generates test MOLDEN-files for the following geometry in the bases def2-SVP, def2-TZVP, def2-QZVP, RHF, charge = 0, mult = 1

Code: Select all

N 0.5200 0.5300 0.5100
N -0.5200 -0.5200 0.5200
N -0.5200 0.5200 -0.5200
N 0.5200 -0.5200 -0.5200
E (def2-SVP) = -217.314008041678
E (def2-TZVP) = -217.599340274266
E (def2-QZVP) = -217.608435955024

and one file for the same-geometry in basis def2-SVP, UHF, charge = 1, mult = 2
here it is important only format Alpha and Beta orbitals.

Also, It's matter what type of bases generally used in the programs - GENERAL CONTRACTED or SEGMENTED CONTRACTED.

Vladimir.
In Soviet Russia Casino plays you.
Vladimir_Konjkov
Posts: 165
Joined: Wed Apr 15, 2015 3:14 pm

Re: molden2qmc

Post by Vladimir_Konjkov »

I downloaded the trial version of MOLPRO, once again was shocked by originality of conversion algorithm from cartesian to the spherical basis. :shock:
RHF case works.
UHF case - two input MOLPRO files generated, oh my god, MOLPRO developers do not like simple solutions.
In Soviet Russia Casino plays you.
Vladimir_Konjkov
Posts: 165
Joined: Wed Apr 15, 2015 3:14 pm

Re: molden2qmc

Post by Vladimir_Konjkov »

Hi, All.

I've found that something had changed in molden file generation mechanism in PSI4 code since https://github.com/psi4/psi4public/comm ... 190b409c49
"Normalized contraction coefficients" in [GTO] section are differ and now gwfn.data file generated from PSI4 MASTER HAED with version 2.6.0 is wrong.

UPDATE: version 2.6.1 of molden2qmc support this.

Vladimir.
In Soviet Russia Casino plays you.
Post Reply