Wednesday, December 1, 2021

 Something new for me in 2021, Q-Chem! Ok, well not exactly new as I have been using it for the past 3 years, but only in little bits and pieces.

 

The goal is to create a series of files with slightly different bond lengths (frozenscan can do this, but the resulting table pulls in the SCF energies instead of the CCSD energies), and then pull out the energies easily.

Creating the files using a template, no-A-sp-eomeaccsdft-avdz-c.qin. The 00 in the for loop helps with the file naming so 1.01 A does not end up as 1.1 in the file name. The general idea is to create the bond length using the loop counter and bc, copy the template to a new file name, and then use sed replace the bond length (this needs to be a unique name or number) with the desired one.

for i in {00..30} ; do j=$(echo "1+$i*0.01" | bc) ; echo $j ; cp /cluster/n2-no/no-A-sp-eomeaccsdft-avdz-c.qin /cluster/n2-no/no-A-sp-eomeaccsdft-avdz-1pt${i}-c.qin ; sed -i "s/1.060669/${j}/g" /cluster/n2-no/no-A-sp-eomeaccsdft-avdz-1pt${i}-c.qin ; done

 

Pulling out the A state CCSD-EA energies (the ground state is degenerate, so the first excited state is #3 in EA when no symmetry is used. EE would be state #2 because the degenerate ground state would be #1) using the for loop below with grep and gawk.

for i in $( ls no-A-sp-*1pt*-c.qout* ) ; do grep "EOMEA transition 3/A" ${i} -A1 | grep "Total energy" | gawk '{print $4}' ; done

 

Now on to the triples contribution using (fT):

for i in $( ls no-A-sp-*1pt*-c.qout* ) ; do grep "EOMEA-CCSD transition 3/A" ${i} -A1 | grep "(fT)" | gawk '{print $4}' ; done


The same process forks for totally ground state calculations using non-EOM CCSD, but the grep terms need to be adjusted.