Program to simulate anisotropic CD spectra starting from the rotational strength tensors computed with a quantum chemistry code and for computing the SVD spectra from either the calculated or experimental data.
The folder src contains two programs:
-
spectrum.f90: given in input the RS tensors (either total, mu.m or mu.q), computes a user-defined number of simulated CD spectra in a random orientation. This is done by rotating all the tensors with a randomly generated unitary matrix and then using the zz component of the rotated tensor as rotatory strenght. The spectra are then produced as the convolution of gaussians centered at the transition frequencies.
INPUT:
-
a formatted file named either tensors.dat (total RS), tensors-Rm.dat (mu.m), or tensors-Rq.dat (mu.q) containing the number of transitions, the frequencies of each transition and then the RS tensors for each transition. Note that a script (script.csh) that extracts the relevant information from a gaussian output file is provided.
-
from command line, the minimum and maximum wavelength desired (lmin and lmax, in nm), the number of random spectra to be computed (ns), the half width at half maximum (HWHM, in eV) of the gaussian functions used for the convolution and the data to be used for the simulation (1: total RS, 2: mu.m only RS, 3: mu.q only RS).
The following command
./spectrum 100 400 100 0.5 1
produces 100 spectra between 100 and 400 nm using 0.5eV HWHM gaussians for the convolution and using the total RS tensor.
OUTPUT:
a formatted file "data.txt" that contains the wavelengths in the first column and then all the simulated spectra as subsequent columns
COMPILING:
spectrum.f90 just requires a fortran compiler, for instance:
gfortran -o spectrum spectrum.f90
-
-
cdsvd.f90: given in input a file containing a collection of spectra in a formatted file named "data.txt", computes the SVD spectra.
INPUT:
-
a formatted file named "data.txt" containing the spectra. Such a file must contain in the first column the wavelengths and in the following ones the spectra. The file generated by the spectrum program can be used with the cdsvd program without modifications.
-
from command line, the number of points in the spectrum and the number of spectra (they correspond to the number of rows and columns of the matrix that has to be decomposed using the SVD.).
The following command
./cdsvd 301 100
produces the SVD spectra starting from 100 spectra each with 301 values and corresponds to the output produced by the spectrum program as in the previous example.
OUTPUT:
-
sing_val.dat: a formatted file containing the singular values of the spectra matrix.
-
sing_cd.dat: a formatted file containing, for each singular value, the corresponding SVD spectrum
-
average.dat: a formatted file containing the average spectrum.
COMPILING:
cdsvd.f90 requires to be linked to a lapack library, for instance:
gfortran -o cdsvd -lblas -llapack
-
In the example directory, the input file for the spectrum program, and subsequently the cdsvd one, are given, and can be used to run the examples described above. The output files produced by both programs are given as a reference in the example/ref_files folder.