09 July 2012

203. Gimme a desktop I can use and love...the OTHER reason why I use the terminal

* The first, obvious reason for using the terminal is that it's the most efficient way of processing data -- the DE is good for presenting data but is awful at handling data input, the terminal is great at input but is often found wanting at presentation. 

[this is a fairly meandering post without any real purpose -- originally it was meant to show how to set up a quick E17 DE which wouldn't feel too foreign for a GNOME refugee, but that was not to be]

I like gnome. It works. It's pretty. I know how to use it and I can be productive with GNOME. Also, I do think GNOME 3 make GNOME 2.3X look dated. Functionality-wise, once I've installed enough extensions, GNOME 3 works as well or better than GNOME 2.3. Almost... 

 The problem is: it often feels like my trust has been betrayed and I constantly dread the what features the next update are going to remove. The problem lies very much with the applications that combine to make up what we know as gnome:

+ Evolution is constantly breaking. In particular, whether you'll be able to use google calendar or not is always a gamble. Actually, almost EVERYTHING to do with the calendar functionality of evolution tends to be problematic: at the moment I can't see the names of my calendars, I can't select a default view (e.g. day/week/month) of calendars and more...

+ A direct insult was what recently happened to gnome-screenshot. Screw that.

And yes: this probably means that I can stick with gnome but look for other pieces of software instead e.g. use thunderbird instead of evolution etc. In fact, I already do...

At any rate, not trusting the GNOME project anymore, instead of waiting for the disaster to strike, like many of us I'm constantly exploring alternative desktops.

First of all familiarise yourself with: 
sudo update-alternatives --config x-session-manager 
sudo update-alternatives --config x-window-manager 

The first command changes what starts (in the absence of a ~/.xinitrc) when you do startx. The second command select the window manager. 

Anyway.

Xmonad always seems like the logical destination for me since I spend most of my time working in the terminal. The whole idea of having a completely keyboard driven DE is awesome -- yes, it makes the learning curve steeper, but ponder this: you should never ever select a tool because it's easy to learn how to use, you should select a tool that is easy to USE (for your intended purpose etc. etc.). After all, you may spend a week learning a new skill, but you'll be spending the next 10 years using that skill.

In spite of everything about xmonad that sounds so, so right, somehow I just can't warm to it.

XFCE and LXDE are ok, but I'm feeling a bit lukewarm about XFCE in particular -- remember that my issues with GNOME aren't really about their focus on eye-candy, but about the removal of features: essentially treating the users like something verging on idiots. 

Be a bit careful about what you're doing windows manager wise -- e.g. openbox and metacity will create two completely different LXDE experiences out of the box. Metacity is what underpinned gnome 2.3. Openbox doesn't seems to be associate with a default menu bar or anything along those line.

I won't comment much on KDE. That's for some other day. Suffice to say that for you should make sure to do
sudo update-alternatives --config x-window-manager 
and make sure to select kwin, or you will not be able to switch between virtual desktops in KDE. KDE is pretty, but it's different enough that you should devote a reasonable fair amount of time to learning the proper workflow before making your mind up.

Enlightment: I've had a look at it over the years, and it's looked fast, and responsive. Checking it out again today on two different desktops., it proceeded to eat up all my ram, then all my swap (8+16 GB) and then die an undignified death. Of course it might just be a temporary bug, but it does make me think twice. And here, since I tired it out on two very different systems, I think the problem lies squarely with E17.

So after my little safari I'm back in the familiar gnome shell. Maybe we'll switch tomorrow instead...

05 July 2012

202. Reproducing the paper: computing organic reduction potentials

This post is not altogether finished yet -- will be updated with additional results as they come in

This isn't as much as a straight reproduction as a test of the authors' thesis that the SCFE+solvation energies can be used vs the results from using a classic adiabatic thermodynamic cycle.

The paper by Speelman and Gillmore can be found here:
http://pubs.acs.org/doi/abs/10.1021/jp800782e

Again, I'm doing this in large part to deepen my understanding of the practical aspects of computational chemistry. It's not a critical evaluation of the authors' approach -- I don't possess that kind of expertise.

0. Exploring solvation
Because NWChem implements one implicit solvation model (COSMO) and Gaussian implements three, it may be worth quickly exploring what they yield in terms of predicting solvation energies. In particular for processes like reduction or oxidation, solvation is highly important.

Benzene:
The structure of benzene was optimised at 3-21G in vacuo in both software packages. 3-21G was used throughout since it's a matter of making a crude comparison. The solvent was set to be water for all calcs. Note that benzene is neutral, so the solvation energy will be much smaller than for e.g. a cation.

Programme   Solvation model Energy (hartree)    Relative energy to gas phase
NWChem     none                      -230.9757626747    0
NWChem     COSMO               -230.9820692591    3.96 kcal/mol
G09               none                     -230.97576997        0
G09               PCM                    -230.9795649          2.38 kcal/mol
G09               cPCM                  -230.9796073          2.41 kcal/mol
G09               iPCM                   -230.9810728          3.33 kcal/mol

Basically, the gas phase energies are very similar for both G09 and NWChem. The differences lie in the solvation model energies, which iPCM and COSMO yielding the values closest to each other. Ultimately, the energy of solvation spans a fairly small region.

What about frequency calculations?
Well, without PCM I get an enthalpy correction of 0.106934 and with PCM I get 0.106976, a difference of .026355126 hartree. We're talking about a precision beyond that of the method itself. The entropy varies similarly: 68.754 w/o PCM, 68.764 cal/MolK with or ca 0.003 kcal/mol at 298.15 K.

1. Thermodynamic cycle of compound 5 (1,2,4,5-tetracyano-benzene)

A. G09 was used to optimise the structure first using b3lyp/3-21G, then using b3lyp/6-31+G* while applying a solvation model using PCM (water). The optimised structure was then used with IPCM. Also, the frequencies were calculated in vacuo.

(species:   gas phase E/IPCM E/Free Energy corr)
Neutral:   -601.2211700670/-601.2223222/0.057097
Reduced: -601.3655493120/-601.3680354/0.054093

Absolute potential: 
[(-601.3680354+0.054093)-(-601.2223222+0.057097)]*27.2107 eV/hartree= -4.0469 eV
The paper we're following gives 4.12 as the SCE absolute potential.
4.0469-4.12=-0.0731 V

Not close at all...one obvious problems is the reference potential though -- is this really applicable to acetonitrile? Our ideal reference potential should be somewhere around  4.05+0.7=4.75 eV in order to give the desired value of -0.7 V.

IUPAC gives SHE in acetonitrile as 4.60 eV (as mentioned here by Davis and Fry). Also, Pavlishchuck and Addison discuss different reference electrodes in acetonitrile in Inorg. Chim. Acta 200, 298, 97-102 and recommend subtracting 244 mV from SHE to yield the SCE potential. This still leaves us with 4.60-0.24=4.36 V. That in turn gives 4.05-4.36=-0.31 V as the potential. An improvement, certainly, but still 360 mV off.

If we use the old trick of optimising in one level, but using single-point and solvation energies from another level of theory (see section 3 for the origin of the values):

cpcm: [(-601.513973+0.054093)-(-601.3684665+0.057097)]*27.2107= -4.0411/(-1 e)
ipcm: [(-601.5166797+0.054093)-(-601.3698362+0.057097)]*27.2107=-4.0775/(-1 e)

It hardly changes it at all. Also, it quite clear that solvation effectsdominate over thermochemical correction terms here.

B. NWChem was used to optimise the structure at b3lyp/6-31+G* (gas phase) starting with the b3lyp/3-21G structure obtained from G09. 

(species:   gas phase opt/COSMO E/Enthalpy corr/Entropy Corr)
Neutral:    -601.1996294139/-601.2262889216/66.800 kcal/105.187 cal (times/2 cores: 15 min + 4 min +2h 10 min)
Reduced:  -601.2988217652/-601.373759558/65.498 kcal/105.799 cal (times/2 cores: 15 min + 4 min + 2h 30 min)

Absolute potential:
((-601.373759558+(65.498-298.15*105.799/1000)/627.503)-(-601.2262889216+(66.8-298.15*105.187/1000)/627.503))*27.2107=-4.077 eV

Basically the same as we saw with gaussian (ipcm).

2. The proposed method using 6-311++G**
Instead of using MIDI! I optimised the structures with ub3lyp/6-31+G*/PCM.

(species:  cpcm/ipcm energies in hartree)
Neutral:   -601.3684665/-601.3698362
Reduced: -601.513973/-601.5166797
EQM: -3.959 eV /-3.99571
PotCPCM: (-3.959+4.6067)/(-1.0886)    = -0.5949 eV; reported (comp.) -0.604 V
PotIPCM: (-3.99571+4.6291)/(-1.0508) = -0.603 eV

3. Reality
-0.74 V vs SCE in acetonitrile.

4. Summary
From the computational chemist's point of view anions are difficult. Metals are difficult. Radicals are difficult. What I didn't appreciate is quite how difficult anions really are. There should be no appreciable difference between the computation of an oxidation potential and a reduction potential since they are each other's conjugate-- the difference in these particular examples is only in the nature of the product when starting with a neutral parent species.
Empirically we've been getting excellent results in the lab calculating the oxidation potential of neutral organic compounds, and awful results for the reduction potential. This can't really be blamed on the reference potentials used either since they should be the same for both processes. Instead the challenge must be more fundamental.

04 July 2012

201. ...not like linux or anything...

The linux community is even more marginalised in Australia than in the US

In
http://www.theage.com.au/technology/technology-news/taxtime-mac-attack-gains-momentum-20120703-21enx.html

there's this little gem:
"..it isn't as if we're asking for  Linux or anything like that, Mac OS is a major operating system."