Search This Blog

Wednesday, June 28, 2006

gaussfield.sh v0.1

It can be very useful to obtain value of some molecular properties in electric field. I.e. you can get dipole moment of excited states from energies in fields F and -F, hyperpolarizability from analytic polarizability etc. But it's quite annoying to create many very similar Gaussian input files, so I wrote short script to created this files:
#!/usr/bin/env bash
for i in $*
do
        name=`basename $i .com`
        sed -e '/^%/d; /^#/s/$/ Field=X-10/' $i > ${name}-x.com
        sed -e "/^%/d; /^#/s/$/ Field=X+10/" $i > ${name}+x.com
done

Monday, June 05, 2006

No CIS(D) in solvent [Gaussian]

I tried to calculate excitation energy with CIS(D) method in solvent (PCM method). I found that the CIS resalts from CIS and CIS(D) outout are different. I checked and CIS with Direct and without this option gave another results. I wrote to Gaussian Help and got replay: Yes, there are differences and the CIS=Direct results are correct.The non-direct methods, both CIS and CIS(D) use MO integrals where the solvent effects are not present and thus neither of them will give the correct results. Starting with G03 Rev. D the program correctly forces the use of CIS=Direct when combined with solvation. There is no option for doing CIS(D) with solvent and I don't expect this to change. Sorry for any confusion.

Thursday, May 25, 2006

Deleting needless pbs files

When PBS queue system's finished your calculation was leaving two info file: [name].o[number] and [name].e[number]. If results were correct you don't need them. To delete all pbs file (and only them*) use this command:
rm -f *.[eo]*
* Of course if you have file with e or o after dot it will be delete too. In this situation you can upgrade command to
rm -f *.[eo][0-9]*
. However, if can fail too if there is number after o or e letter ;). But It's rather unusual situation. You can add this line to your .bashrc file:
 alias pbsdel="rm -f *.[eo][0-9]"
. Now you can use pbsdel to deleting pbs file.

Thursday, May 18, 2006

Massive changes in input files

Imagine, you have to change basis set in 10 files. It is a lot of work. Not really, sed will be your friend. For example, I would like to change 6-31+G(d) into 6-311++G(2d,p) basis set in Gaussian, so I did:
sed -i.bak *.com -e " s/6-31+G(d)/6-311++G(2d,p)/"
. This command created backup of my file. If you would like to change the level of theory in gamess you should write:
sed scf.inp =e "s/scftyp=rhf/scftyp=rhf mplevl=2/" > mp2.inp
Of course you can change much more thinks in any of quantum chemical program.

Friday, May 05, 2006

FujiFilm S5600 digital camera and [not only] Crux

My FujiFilm S5600 (S5200 in US) works out of box with my Crux. The only inconvenience is that the mount point can depend on presences of other usb stuff. I read the udev rules manual and wrote this rule.
BUS=="scsi", KERNEL=="sd*", SYSFS{vendor}=="FUJIFILM",  NAME="%k",SYMLINK="fuji"
It makes the /dev/fuji link, which use as mount point:
/dev/fuji /media/aparat vfat  user,noauto   0    0
To edit pictures from raw format im using UFRaw. It can be GIMP plugin, what is it's big advantage. But when I have more photos I'm using this small bash script to prepare preview in jpg:
#!/bin/sh
dcraw -w *.raf
for i in *.ppm
do
    j=`basename $i .ppm`.jpg
    echo $j
    convert $i $j
    mogrify -resize 800x600 $j
done
rm *.ppm
I found that it is very important to use dcraw with -w option.

Sunday, April 30, 2006

NLO in Gaussian 98/03

Sometime ago Damian Gregory published very nice article about NonLinear Optical (NLO) properties in Gaussian. Later he moved his website into wordress and forgot to transfer this article. Right now "Gaussian98/03 Nonlinear Optical (NLO) Response" is back. BTW. Damian's blog is very nice place for all interesting in so called NanoThechnology. His Nanotechnology Gallery is beautiful.

Friday, April 28, 2006

Molekel

I've just check the website of Molekel one of the most interesting program to visualization Quantum Chemistry date. An there are good news. Yes, they are working on the new version. And Yes, it is GPL program now!

Wednesday, April 26, 2006

How to convert color pdf (ps) to b&w file

I have a pdf file, where foreground color is blue. It is very nice when you look at it at your monitor, but no so nice when you have to print it on b&w printer. Today I found the way how to convert a color pdf (or rather ps) into a b&w file. First you have to convert a pdf into a ps
pdf2ps file.ps
Printing into a file from Acrobat Reader doesn't work. Next you have to download this small perl script and use it
 bw_convert -b file.ps file-bw.ps
Now you have file ready to print on your b&w printer.
I found link to bw_convert script on this FAQu. There are more interesting advices.

Wednesday, April 12, 2006

Regular expression [βzzz from Dalton]

Very often you need only one number from whole output. Going through all the file is boring, especially if you have more then one file. In these situation regular expression are a great help. For example: I needed to find out the value of βzzz. I figured out from an output file that I needed lines with 3 ZDIPLEN words. I prepared the command which should work:
grep "Z.*Z.*Z" *.out
But I got more than I wanted:
betaccs_rhb-631+gd.out:  PUT TRIPLE: ZDIPLEN  ZDIPLEN  ZDIPLEN ON THE LIST. 
betaccs_rhb-631+gd.out: ZDIPLEN  (unrel.) 0.0000  ZDIPLEN (unrel.) 0.0000  ZDIPLEN (unrel.) 0.0000  -383.12517
So I modified my expression (brackets are only in wanted lines):
Z.*(.*Z.*Z" *.out
BTW. If you want to obtaine the correct value of β you'll have to multiply value from output file by -1.

rsp_zfs and gcc 3.4.x [Dalton]

In Dalton FAQ it is written that "g77-3.4.2 (Fedora Core 3) miscompiles DLAMC3 routine from gp_zlapack.F file leading to apparent hang in rsp_zfs test". I had the same problem (hangs of rsp_zfs) on my CRUX with gcc-3.4.4. Adding of -ffloat-store option helps. Moreover, after adding this option Dalton has been build without and failed tastes on Athlon.

Saturday, April 08, 2006

Points style in Gnuplot - part II

My friend Paweł Kędzierski showed me another (better?) way how to present points style in gnuplot. It is describe in docs. (Shame on me!) The ps_symbols.gpi script can be found in gnuplot docs directory or hear. Below you see output from it: BTW I would like to add link to another nice site with gnuplot images. It was created by Petr Mikulik.

Thursday, April 06, 2006

Points style in Gnuplot

It's quite annoying to find the best points styles for your postscript output from gnuplot. I tried to find the site with list of all points style, but I failed, so made my own:
set term postscript
set output "test.ps"
set xrange [0:30]
set yrange [0:30]
set key right bottom
plot   x+1   with linespoints pt 1 title "1",  
       x+2   with linespoints pt 2 title "2",
       x+3   with linespoints pt 3 title "3",
       x+4   with linespoints pt 4 title "4",
       x+5   with linespoints pt 5 title "5",
       x+6   with linespoints pt 6 title "6",
       x+7   with linespoints pt 7 title "7",
       x+8   with linespoints pt 8 title "8",
       x+9   with linespoints pt 9 title "9",
       x+10  with linespoints pt 10 title "10",
       x+11  with linespoints pt 11 title "11",
       x+12  with linespoints pt 12 title "12",
       x+13  with linespoints pt 13 title "13",
       x+14  with linespoints pt 14 title "14",
       x+15  with linespoints pt 15 title "15",
       x+16  with linespoints pt 16 title "16",
       x+17  with linespoints pt 17 title "17",
       x+18  with linespoints pt 18 title "18",
       x+19  with linespoints pt 19 title "19",
       x+20  with linespoints pt 20 title "20"
The result is below. It was obtained by: convert test.ps test.png (and next rotated):

Monday, April 03, 2006

Vim/Vi Cheat Sheet and Tutorial

Deelopers of ViEmu published very nice help for Vim. I've missed something like this.

Saturday, April 01, 2006

Medical Computing

Alex Amies is writing the blog about Medical Computing. It can be interesting for some people hitting my webpage.

Dipole moment in excited state [Gaussian]

To get values of dipole moment obtain with CIS method using Gaussian program you can use this bash command:
egrep "Tot*=|Population" *.log
From all of line you need only the line after Population analysis using the CI density. You can automate it. For example to get the total value of dipole moment use this script (you can write it in one line):
grep "Tot*=" *.log|
 gawk '  BEGIN { currline = 1 }
  {if (currline%3==0){print $9}
  currline = currline + 1}'

Wednesday, March 22, 2006

CESTC 2006

It's quite hard to find any info about Central European Symposium on Theoretical Chemistry 2006. So I'm adding link to the website: http://tiger.chem.uw.edu.pl/cestc/.

Monday, February 27, 2006

Great site about Gnuplot

Gnuplot is very good data and function plotting utility. There are a lot of demos what can you do with in at official website. But advises prepared by Toshihiko Kawano from Los Alamos National Laboratory are amazing. Check this link and learn what you can do with gnuplot!

Friday, February 24, 2006

exit code 139 [Dalton & Bash]

After building dalton program, you should test it. If something is going wrong you'll get Exit Codes. Quite often it is code 139, what means Invalid memory reference (signal SIGSEGV 11 = 139- 128 ).

Wednesday, February 15, 2006

Orbiton - gallery of orbitals

I've just found Orbitron . It is a gallery of atomic orbitals and molecular orbitals on the WWW. The pictures are really nice, but animation of creating of molecular orbitals are great.

New icons in OO2 [not only in Crux]

I was quite upset because standard Crux OpenOffice2 (and 1) port provide default, not so nice, icons. I prefer Ximian ones included i.e. in Debian and Ubuntu. Quite long I tried to find how to change my icons. Finally I did this! I took images_industrial.zip, from /usr/lib/openoffice/lib/config/ (from debian machine). Of course you can choose another one, there are images_crystal.zip (KDE) and images_hicolor.zip. Transfer into me Crux machine and copy on default OO icons set /usr/lib/openoffice/lib/config/images.zip.