26 October 2018

654. Screen-casting on linux (debian 9)

Minipost:
I'm interested in making course videos where I show my desktop (I might have a full-screen presentation going), but where I also want to show my face.

I'm using debian.

Solution:
To screen-cast the desktop I'm using EasyScreenCast, which is a Gnome Extension: https://extensions.gnome.org/extension/690/easyscreencast/

Not much to say about it really, other than that it works very well.

To get my face on the desktop I use guvcview, which is in the repos.

To make guvcview stay on top even during a full-screen presentation I followed this: https://www.linuxquestions.org/questions/linux-general-1/how-to-make-guvcview-stay-always-on-top-4175541777/

My son's orca lecturing on the importance of experiments in formulating new theories
kdenlive seems like an interesting editor for post-production, but I haven't got that far yet.

20 August 2018

653. Energy decomposition analysis the manual/multiwfn way -- nwchem

I have a very large system (390 atoms, 3918 functions, 6474 primitives) where I want to analyse the bonding. Whereas I can reduce the size of the system a little bit, there's a large conjugated ad charged system in the middle which I can't really reduce. Either way, when I use GAMESS US to do NEDA, the calc seems to hang for days without ever progressing, and LMOEDA/CMOEDA keep running out of memory.

I recently had a look at Multiwfn, and section 4.100.8 in the manual shows how to do simple EDA as a multistep computation. The example uses multiwfn to input initial fragment wavefunctions to compute the DE_orb with Gaussian. Incidentally, this is something which is very easy to do with nwchem without using multiwfn.

I'll use NH3..BH3 as the example at RHF/6-31G*.


Nwchem:

1. Optimise NH3..BH3
scratch_dir /home/me/scratch Title "NH3BH3-nw" Start NH3BH3-nw charge 0 geometry noautosym noautoz units angstrom N 0.0720500 -0.00961700 -0.336156 H 0.871540 0.292859 -0.862886 H -0.685935 0.618297 -0.534511 H -0.187686 -0.922713 -0.663436 B 0.415920 -0.0366410 1.31774 H 0.709693 1.10584 1.58004 H -0.612009 -0.411733 1.83072 H 1.33214 -0.818018 1.41958 end basis "ao basis" cartesian print B library "6-31G*" H library "6-31G*" N library "6-31G*" END scf RHF nopen 0 end task scf optimize
Energy=-82.61181818

2. Run SE calcs on the BH3 and NH3 fragments:
scratch_dir /home/me/scratch Title "BH3-nw" Start BH3-nw charge 0 geometry noautosym noautoz units angstrom B 0.192902 -0.0151808 0.928551 H 0.486935 1.12724 1.19093 H -0.834959 -0.390362 1.44154 H 1.10930 -0.796437 1.03042 end basis "ao basis" cartesian print B library "6-31G*" H library "6-31G*" END scf RHF nopen 0 vectors output bh3.movecs end task scf energy
Energy=-26.368337779376
and
scratch_dir /home/me/scratch Title "NH3-nw" Start NH3-nw charge 0 geometry noautosym noautoz units angstrom N -0.150737 0.0117141 -0.725185 H 0.648571 0.314333 -1.25225 H -0.908696 0.639770 -0.923690 H -0.410582 -0.901249 -1.05260 end basis "ao basis" cartesian print N library "6-31G*" H library "6-31G*" END scf RHF nopen 0 vectors output nh3.movecs end task scf energy
Energy=-56.184296916045

3. Finally, use the two movecs created in step 2:
scratch_dir /home/andy/scratch Title "NH3BH3-nw" Start NH3BH3-nw charge 0 geometry noautosym noautoz units angstrom N 0.0720500 -0.00961700 -0.336156 H 0.871540 0.292859 -0.862886 H -0.685935 0.618297 -0.534511 H -0.187686 -0.922713 -0.663436 B 0.415920 -0.0366410 1.31774 H 0.709693 1.10584 1.58004 H -0.612009 -0.411733 1.83072 H 1.33214 -0.818018 1.41958 end basis "ao basis" cartesian print B library "6-31G*" H library "6-31G*" N library "6-31G*" END scf RHF nopen 0 vectors fragment nh3.movecs bh3.movecs output nh3bh3.movecs end task scf
4. Parse the output from step 4:
iter energy gnorm gmax time ----- ------------------- --------- --------- -------- 1 -82.5357150919 7.36D-01 2.88D-01 0.1 2 -82.6078664771 2.30D-01 5.23D-02 0.1 3 -82.6117699706 2.03D-02 7.47D-03 0.1 4 -82.6118181287 2.23D-04 5.79D-05 0.1 5 -82.6118181326 2.51D-06 7.28D-07 0.1 Final RHF results ------------------ Total SCF energy = -82.611818132574 One-electron energy = -190.292457149391 Two-electron energy = 67.248334359392 Nuclear repulsion energy = 40.432304657425 Time for solution = 0.1s
So, according to the Multiwfn Manual at 4.100.8, using the values from above:
DEtot=-82.61181818-(-26.368337779376-56.184296916045)= -37 kcal/mol (-155 kJ/mol)
DEorb=-82.611818132574-(-82.5357150919)= -48 kcal/mol (-200 kJ/mol)
DEsteric=DEtot-DEorb= 11 kcal/mol (45 kJ/mol)

This is essentially the Kitaura-Morokuma method.

See e.g. Frenking et al.in Energy Decomposition Analysis on page 44. Eq 2 defines Eint in the same way DEtot is defined above, and Eq 7 is the same Eorb as here.

DEstruc here is then DEelstat + DEPauli.

How to resolve these two factors from one another, is a problem for another day.
You can also run the calcs using a single input file:
scratch_dir /home/me/scratch Title "NH3BH3-nw-eda" Start NH3BH3-nw-eda echo charge 0 geometry molecule noautosym noautoz units angstrom N -0.150737 0.0117141 -0.725185 H 0.648571 0.314333 -1.25225 H -0.908696 0.639770 -0.923690 H -0.410582 -0.901249 -1.05260 B 0.192902 -0.0151808 0.928551 H 0.486935 1.12724 1.19093 H -0.834959 -0.390362 1.44154 H 1.10930 -0.796437 1.03042 end geometry ammonia noautosym noautoz units angstrom N -0.150737 0.0117141 -0.725185 H 0.648571 0.314333 -1.25225 H -0.908696 0.639770 -0.923690 H -0.410582 -0.901249 -1.05260 end geometry borohydride noautosym noautoz units angstrom B 0.192902 -0.0151808 0.928551 H 0.486935 1.12724 1.19093 H -0.834959 -0.390362 1.44154 H 1.10930 -0.796437 1.03042 end basis "ao basis" cartesian print N library "6-31G*" B library "6-31G*" H library "6-31G*" END set geometry ammonia scf vectors output ammonia.movecs end task scf set geometry borohydride scf vectors output borohydride.movecs end task scf set geometry molecule scf vectors input fragment ammonia.movecs borohydride.movecs output molecule.movecs end task scf

15 June 2018

652. N/EDA in GAMESS. 4. Running NEDA

Posts 1, 2 and 3.

For this you will need to have linked gamess and nbo.

Here's an example input that works:
andy@carbon:~$ less fast/gamess/mgme_tzvp/Mg_tzvp_opt_neda_2.inp ! File created by the GAMESS Input Deck Generator Plugin for Avogadro $CONTRL SCFTYP=RHF RUNTYP=energy DFTTYP=PBE0 ICHARG=1 MULT=1 NOSYM=1 $END ! $PCM SOLVNT=NEPTANE $END ! $PCMCAV RADII=SUAHF $END ! $SCF DIRSCF=.TRUE. $END $BASIS EXTFIL=.TRUE. GBASIS=DEF2SVP $END $system mwords=2000 memddi=500 $end $INTGRL NOPK=1 $END $NBO MOLUNIT <1> > <2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23> $END $DEL NEDA END $END $DATA Title C1 Mg 12.0 3.14572 1.02487 1.29474 N 7.0 4.95329 0.37304 1.62652 N 7.0 3.11530 2.89665 1.82263 C 6.0 5.44265 -0.98008 1.41792 C 6.0 5.80308 1.30078 2.07039 C 6.0 1.96130 3.78017 1.78886 C 6.0 4.28661 3.37927 2.23846 C 6.0 5.48149 2.64462 2.33178 H 1.0 6.31935 3.22840 2.68338 C 6.0 4.36331 4.81950 2.64988 H 1.0 5.37500 5.09552 2.93515 H 1.0 3.70056 5.01438 3.49762 H 1.0 4.03950 5.47541 1.83769 C 6.0 7.22682 0.90313 2.32491 H 1.0 7.68811 0.50750 1.41630 H 1.0 7.27827 0.11050 3.07627 H 1.0 7.81805 1.74612 2.67254 H 1.0 5.81529 -1.43220 2.34182 H 1.0 4.63475 -1.61377 1.04987 H 1.0 6.24793 -1.02060 0.67837 H 1.0 1.72108 4.18678 2.77556 H 1.0 2.10316 4.62224 1.10460 H 1.0 1.08587 3.22835 1.44552 $END


And here's the output:
Natural Energy Decomposition Analysis (Summary): Component Energy(wfn) Energy(wfn) (kcal/mol) ------------------------------------------------------------------------------ C7H13N2Mg(+) -583.0832392(scf) -582.9738665(loc) CT = -68.632 ES = -394.694 POL = -353.983 XC = -29.974 1. Mg(+2) -199.0566873(def) -199.0582918(cp) DEF(SE) = 1.007( 0.400) 2. C7H13N2(-) -382.6763191(def) -383.3176043(cp) DEF(SE) = 402.412(176.794) --------- E = -443.864 Electrical (ES+POL+SE) : -571.483 Charge Transfer (CT) : -68.632 Core (XC+DEF-SE) : 196.251 ------------ Total Interaction (E) : -443.864 ..... done with NBO analysis .....
A couple of things to note:
* It runs with PCM, but the results seem nonsensical, in addition to it finding a lot more fragments than without PCM (the latter thing can be amended with NAO)

* If I use DEF2TZVP with PBE0 and DIRSCF=.TRUE. It'll get stuck during the NBO run at
437. RY ( 5) H 23 0.00000 0.00000 0.00000 NEXT STEP: Perform one SCF cycle to evaluate the energy of the new density matrix constructed from the deleted NBO Fock matrix. ------------------------------------------------------------------------------ -------------------------- R-PBE0 SCF CALCULATION -------------------------- DENSITY MATRIX CONVERGENCE THRESHOLD= 2.00E-05 COARSE -> FINE DFT GRID SWITCH THRESHOLD= 3.00E-04 (SWITCH IN $DFT) HF -> DFT SWITCH THRESHOLD= 0.00E+00 (SWOFF IN $DFT) DIRECT SCF CALCULATION, SCHWRZ=T FDIFF=T, DIRTHR= 0.00E+00 NITDIR=10 NONZERO BLOCKS ITER EX DEM TOTAL ENERGY E CHANGE DENSITY CHANGE DIIS ERROR INTEGRALS SKIPPED
It's not consuming any CPU at this point (nor is nbo). I'm running w/o DIRSCF now, but it's very slow, and requires ca 30 Gb of scratch space even for a small molecule like this one.

MOLUNIT <1> >
<2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23>
is not necessary for this run. You can simply use NBO $END instead.