This is the wiki- intended to give an introduction and guidance to Crystal14 in the group.
Software computing electronic wave function and properties of periodic systems
To visualize and modify your structures you can use VESTA: https://jp-minerals.org/vesta/en/download.html
For more instructions about VESTA you can use: https://www.youtube.com/channel/UCmOHJtv6B2IFqzGpJakANeg/videos
CRYSTAL is a general-purpose program for the study of crystalline solids, and the first which has been distributed publicly. The CRYSTAL program computes the electronic structure of periodic systems within Hartree Fock, density functional or various hybrid approximations (global, range-separated and double-hybrids). The Bloch functions of the periodic systems are expanded as linear combinations of atom centred Gaussian functions. Powerful screening techniques are used to exploit real space locality. Restricted (Closed Shell) and Unrestricted (Spin-polarized) calculations can be performed with all-electron and valence-only basis sets with effective core pseudo-potentials. The program can automatically handle space symmetry (230 space groups, 80 two-sided plane groups, 99 rod groups, 45 point groups are available ). Point symmetries compatible with translation symmetry are provided for molecules. Helical symmetry is now available (up to order 48). Input tools allow the generation of a slab (2D system), or a cluster (0D system), from a 3D crystalline structure, or the creation of a supercell with a defect, or nanotubes (1D system) from a single-layer slab model (2D system).
Tutorials are available at: http://www.theochem.unito.it/crystal_tuto/mssc2013_cd/tutorials/index.html
Manual: http://www.crystal.unito.it/Manuals/crystal14.pdf
Many example are availble in:
/panfs/storage.local/home-3/jmendozacortes/CRYSTAL/PE
/panfs/storage.local/engineering/mendozagroup/crystal/v1_0_3/crystal14-1.0.3/test_cases
The general structure of the input for crystal (.d12 file) is given by (http://www.theochem.unito.it/crystal_tuto/mssc2013_cd/tutorials/index.html)
0 )Title
1) Geometry Input
2) Basis set Input
3) Hamiltonian, computational parameters and SCF input
#You can get your basis set from: http://www.crystal.unito.it/basis-sets.php
# or from here: https://bse.pnl.gov/bse/portal
#If you want to create your own basis set, you can consult this manual from Mike Towler and his code called Billy: "My Billy program used for optimizing valence basis functions and/or performing simple geometric optimizations with CRYSTAL95/98/03/06/09/14."
Example of Geometry input.
This is an example of polyethylene in orthorhombic lattice
CRYSTAL
0 0 1 #My reference for the crystal reference frame is No. 1, Check manual page 15 for more info
62 # Space group in numerical form (space group sequential number(1-230))
7.43200 2.54700 4.94300 90 90 90 # depending of the symmetry this is a b c alpha beta gamma
3
6 0.043000 0.250000 -0.930000 Biso 1.000000 C
1 0.167000 0.250000 -0.016000 Biso 1.000000 H
1 0.044000 0.250000 -0.678000 Biso 1.000000 H
OPTGEOM
FULLOPTG
MAXCYCLE
200
ENDOPT
END
6 8 # Here starts the basis part, which is copy/paste from website: http://www.crystal.unito.it/basis-sets.php
0 0 6 2.0 1.0
13575.349682 0.00022245814352
2035.2333680 0.00172327382520
463.22562359 0.00892557153140
131.20019598 0.03572798450200
42.853015891 0.11076259931000
15.584185766 0.24295627626000
0 0 2 2.0 1.0
6.2067138508 0.41440263448000
2.5764896527 0.23744968655000
0 0 1 0.0 1.0
0.4941102000 1.00000000000000
0 0 1 0.0 1.0
0.1644071000 1.00000000000000
0 2 4 2.0 1.0
34.697232244 0.00533336578050
7.9582622826 0.03586410909200
2.3780826883 0.14215873329000
0.8143320818 0.34270471845000
0 2 1 0.0 1.0
0.5662417100 1.00000000000000
0 2 1 0.0 1.0
0.2673545000 1.00000000000000
0 3 1 0.0 1.0
0.8791584200 1.00000000000000
1 4 # This is for hydrogen atom
0 0 3 1.0 1.0
34.061341000 0.00602519780
5.1235746000 0.04502109400
1.1646626000 0.20189726000
0 0 1 0.0 1.0
0.4157455100 1.00000000000
0 0 1 0.0 1.0
0.1795111000 1.00000000000
0 2 1 0.0 1.0
0.8000000000 1.00000000000
99 0
END
DFT
SPIN #This label will perform Unrestricted DFT
B3LYP
XLGRID
END
TOLINTEG
7 7 7 7 14
TOLDEE
7
SHRINK
0 20
20 20 20
BIPOSIZE
8000000
EXCHSIZE
8000000
MAXCYCLE
600
FMIXING #This value needs to be increased if SCF does not converge or when using surfaces (90 or larger, max=100).
80 #A good starting value is 60 and then increase as required. Remember the larger the value the longer the calculation.
ANDERSON
PPAN
END
GRIMME # Grimme D2, only H and C will be used, taken from Table 1: http://onlinelibrary.wiley.com/doi/10.1002/jcc.20495/full
1.05 20. 25.
4 # only H and C is used but is shown how to put other elements
1 0.14 1.001
6 1.75 1.452
235 12.47 1.749
238 24.67 1.606
END
For unrestricted DFT calculations:
DFT
SPIN #Unrestricted calculations
B3LYP
XLGRID
END
SPINLOCK #This assigns the total number of unpair spins
15 4 #Total unpair spins=15 for 4 SCF cyles
ATOMSPIN #This is to assigns the 'alignment of spins' from up or down
4 #4 atoms have unpair spins
1 1 5 1 11 1 15 1 #Spin in atom 1 is up, atom 5 up, atom 11 up, atom 15 up.
Example of Geometry input using predefined Basis Sets.
NaCl Fm-3m ICSD 240598
CRYSTAL
0 0 0
225
5.6401
2
11 0.0 0.0 0.0
17 0.5 0.5 0.5
BASISSET
POB-TZVP
DFT
EXCHANGE
PWGGA
CORRELAT
PWGGA
HYBRID
20
CHUNKS
200
END
TOLINTEG
7 7 7 7 14
SHRINK
8 8
END
Since CRYSTAL14, a set of internally stored pre-defined basis sets are available by using the keyword BASISSET (See the CRYSTAL Users's Manual for further details). The dataset of available basis sets includes (available atomic numbers in parentheses):
Keyword Description
POB-DZVP POB double-zeta valence + polarization set for solid state systems (Elements 1--35, 49, 74)
POB-DZVPP POB double-zeta valence basis set + a double set of polarization functions for solid state systems (Elements 1--35, 49, 83)
POB-TZVP POB triple-zeta valence + polarization basis set for solid state systems (1--35, 49, 83)
Paper: Peintinger, M. F., Oliveira, D. V. and Bredow, T. (2013), Consistent gaussian basis sets of Triple-Zeta valence with polarization quality for solid-State Calculations. J. Comput. Chem., 34: 451–459. doi: 10.1002/jcc.23153
More info: Manual Page 23 and https://sites.google.com/site/michaelpeintinger/basis-sets
Sometimes, you need a very tight convergence for the SCF or your electronic density. For such cases, you need to run a calculations that takes longer than usual. Some cases includes the optimization of organic molecular crystals, or the calculation of the IR or when the TS is hard to converge.
Optimization with very tight constrains when the opt. part gives you trouble (ex. for PE orthorhombic lattice)
CRYSTAL
0 0 1
62
7.43200 2.54700 4.94300 90 90 90
3
6 0.043000 0.250000 -0.930000 Biso 1.000000 C
1 0.167000 0.250000 -0.016000 Biso 1.000000 H
1 0.044000 0.250000 -0.678000 Biso 1.000000 H
OPTGEOM
FULLOPTG
MAXCYCLE
900 #It always works!!!! However use this only when necessary because the cycles needed are much more, see example to the left.
TOLDEG #More info about tight energy conversion, see page 120 of manual: http://www.crystal.unito.it/Manuals/crystal14.pdf
0.00003
TOLDEX
0.00004
FINALRUN
4
#MAXTRADIUS # To limit the maximum displacement in geometry cycle.
#0.01
#TRUSTRADIUS
#0.001
ENDOPT
END
6 8
.... # Everything else is the same as above
If you need to run IR, you need to calculate the dielectric tensor first, with the CPHF method, and add the output format SETPRINT, such that the dielectric tensor is printed in different formats. Example below.
CPHF calculation for getting the dielectric tensor (ex. for polyethylene, PE, orthorhombic lattice)
CRYSTAL
0 0 1
62
8.64992873 2.55236562 4.77040804 90.000000 90.000000 90.000000
3
6 4.219457125923E-02 2.500000000000E-01 4.260242859622E-02
1 1.581384601366E-01 2.500000000000E-01 -4.959642885797E-02
1 5.933897545132E-02 2.500000000000E-01 2.701567899197E-01
CPHF # Notice these are the lines we add to calculate the dielectric tensor
FMIXING
50
MAXCYCLE
150
ENDCPHF
END
6 8
0 0 6 2.0 1.0
13575.349682 0.00022245814352
2035.2333680 0.00172327382520
463.22562359 0.00892557153140
131.20019598 0.03572798450200
42.853015891 0.11076259931000
15.584185766 0.24295627626000
0 0 2 2.0 1.0
6.2067138508 0.41440263448000
2.5764896527 0.23744968655000
0 0 1 0.0 1.0
0.4941102000 1.00000000000000
0 0 1 0.0 1.0
0.1644071000 1.00000000000000
0 2 4 2.0 1.0
34.697232244 0.00533336578050
7.9582622826 0.03586410909200
2.3780826883 0.14215873329000
0.8143320818 0.34270471845000
0 2 1 0.0 1.0
0.5662417100 1.00000000000000
0 2 1 0.0 1.0
0.2673545000 1.00000000000000
0 3 1 0.0 1.0
0.8791584200 1.00000000000000
1 4
0 0 3 1.0 1.0
34.061341000 0.00602519780
5.1235746000 0.04502109400
1.1646626000 0.20189726000
0 0 1 0.0 1.0
0.4157455100 1.00000000000
0 0 1 0.0 1.0
0.1795111000 1.00000000000
0 2 1 0.0 1.0
0.8000000000 1.00000000000
99 0
END
DFT
B3LYP
XLGRID
END
TOLINTEG
7 7 7 7 14
TOLDEE
7
SHRINK
0 25
25 25 25
BIPOSIZE
8000000
EXCHSIZE
8000000
MAXCYCLE
600
FMIXING
80
ANDERSON
PPAN
SETPRINT #These lines print out the Dielectric Tensor in different formats (This is a very advance feature)
1
18 1
END
GRIMME # Grimme D2, only H and C will be used, taken from Table 1: http://onlinelibrary.wiley.com/doi/10.1002/jcc.20495/full
1.05 20. 25.
4 # only H and C is used but is shown how to put other elements
1 0.14 1.001
6 1.75 1.452
235 12.47 1.749
238 24.67 1.606
END
This input.d12 will generate .out with the following lines at the end. These lines will be used for the input to calculate IR.
DIELECTRIC TENSOR
TENSOR IN ORIGINAL CARTESIAN AXES
XX 1.930068E+00 YY 2.084255E+00 ZZ 1.931386E+00 XY 0.000000E+00 XZ 0.000000E+00 YZ 0.000000E+00
TENSOR IN PRINCIPAL AXES SYSTEM
AA 1.930068E+00 BB 2.084255E+00 CC 1.931386E+00
If you want to see the full output files, check the attachment below or go this link.
This dielectric tensor, then can be used for the input of the IR calculations. Remember that this optimized structure, if possible the tight convergence criteria mentioned above for the optimization for the structure needs to be used, specially for compounds that have a flat energy surface, for example molecular crystals and surfaces. (see more in: )
Example of IR calculation for PE orthorhombic lattice
CRYSTAL
0 0 1
62
8.64992873 2.55236562 4.77040804 90.000000 90.000000 90.000000
3
6 4.219457125923E-02 2.500000000000E-01 4.260242859622E-02
1 1.581384601366E-01 2.500000000000E-01 -4.959642885797E-02
1 5.933897545132E-02 2.500000000000E-01 2.701567899197E-01
FREQCALC # This is the block that will calculate the IR.
INTENS
DIELTENS # This is where the dielectric tensor is used. It is comparable to exp. literature values.
1.930068 0 0
0 2.084255 0
0 0 1.931386
IRSPEC
REFRIND
DIELFUN
DAMPFAC
5.0
GAUSS
ENDIR
ENDFREQ
END
6 8
0 0 6 2.0 1.0
13575.349682 0.00022245814352
2035.2333680 0.00172327382520
463.22562359 0.00892557153140
131.20019598 0.03572798450200
42.853015891 0.11076259931000
15.584185766 0.24295627626000
0 0 2 2.0 1.0
6.2067138508 0.41440263448000
2.5764896527 0.23744968655000
0 0 1 0.0 1.0
0.4941102000 1.00000000000000
0 0 1 0.0 1.0
0.1644071000 1.00000000000000
0 2 4 2.0 1.0
34.697232244 0.00533336578050
7.9582622826 0.03586410909200
2.3780826883 0.14215873329000
0.8143320818 0.34270471845000
0 2 1 0.0 1.0
0.5662417100 1.00000000000000
0 2 1 0.0 1.0
0.2673545000 1.00000000000000
0 3 1 0.0 1.0
0.8791584200 1.00000000000000
1 4
0 0 3 1.0 1.0
34.061341000 0.00602519780
5.1235746000 0.04502109400
1.1646626000 0.20189726000
0 0 1 0.0 1.0
0.4157455100 1.00000000000
0 0 1 0.0 1.0
0.1795111000 1.00000000000
0 2 1 0.0 1.0
0.8000000000 1.00000000000
99 0
END
DFT
B3LYP
XLGRID
END
TOLINTEG
8 8 8 8 16
TOLDEE
11
SHRINK
0 20
20 20 20
BIPOSIZE
8000000
EXCHSIZE
8000000
MAXCYCLE
600
FMIXING
80
ANDERSON
PPAN
END
GRIMME # Grimme D2, only H and C will be used, taken from Table 1: http://onlinelibrary.wiley.com/doi/10.1002/jcc.20495/full
1.05 20. 25.
4 # only H and C is used but is shown how to put other elements
1 0.14 1.001
6 1.75 1.452
235 12.47 1.749
238 24.67 1.606
END
If you want to see the full output file, check the attachment below or go this link.
The use posted in: https://rcc.fsu.edu/software/crystal14 is outdated. The new submission script is show below. For this script to work and be organized, you need to create your scratch directory inside:
/panfs/storage.local/engineering/mendozagroup/scratch/crystal/username
where username needs to be substituted with the user you use in hpc.
Submission Script, Parallel version (hpc)
#!/bin/bash
#SBATCH -J JOBNAME
#SBATCH -o JOBNAME
#SBATCH -N 1
#SBATCH --ntasks-per-node=16
#SBATCH -p mendoza_q
#SBATCH -t 201:00:00
#SBATCH --mail-type=ALL
# remove the following line if already in your .bashrc file
export PATH=/panfs/storage.local/engineering/mendozagroup/crystal/v1_0_4b/bin/Linux-ifort_XE_emt64/v1.0.4:$PATH
export JOB=JOBNAME
export DIR=$SLURM_SUBMIT_DIR
#If the directory does not exist in the scratch, remove the comment in the next line
#mkdir /panfs/storage.local/engineering/mendozagroup/scratch/crystal/${USER}
export scratch=/panfs/storage.local/engineering/mendozagroup/scratch/crystal/${USER}
echo "submit directory: "
echo $SLURM_SUBMIT_DIR
module purge
module load intel-openmpi
mkdir -p $scratch/$JOB
# the following line need be modified according to where your input is located
cp $DIR/${JOB}.d12 $scratch/$JOB/INPUT
cd $scratch/$JOB
touch hostfile
rm hostfile
for i in `scontrol show hostnames $SLURM_JOB_NODELIST`
do
echo "$i slots=16" >> hostfile
done
# in the following, -np parameters should be equal to those specified above.
mpirun -np 16 -machinefile hostfile Pcrystal >& $DIR/${JOB}.out
# If you want to run properties, assuming you have created the .d3 file, remove comment below
#mpirun -np 16 -machinefile hostfile Pproperties >& $DIR/${JOB}.out
cp fort.9 ${DIR}/${JOB}.f9
cp fort.25 ${DIR}/${JOB}.f25
cp SCFOUT.LOG ${DIR}/${JOB}.SCFOUT
# uncomment the next 5 lines if you want to remove the scratch directory
#if [ $? -eq 0 ]
#then
# cd ${DIR}
# rm -rf $scratch/${JOB}
#fi
Then save it as slurm_submission.sh
To submit to the queue in hpc, just do
> sbatch slurm_submission.sh
Alternate Parallel version(hpc)
This version uses scripts runmpi14 and runmpi_prop14. please download these script to your submission directory. Runmpi14 and runmpi_prop14 are only tested on hpc.
#!/bin/bash
#SBATCH -J NbAs
#SBATCH -o crys14-%J.o
#SBATCH -N 1
#SBATCH -n 16
#SBATCH -p mendoza_q
#SBATCH -t 100:30:00
# remove the following line if already in your .bashrc file
export PATH=/panfs/storage.local/engineering/mendozagroup/crystal/v1_0_4b/bin/Linux-ifort_XE_emt64/v1.0.4:$PATH
module purge
module load intel-openmpi
export JOB=NbAs
export DIR=$SLURM_SUBMIT_DIR
export scratch=/panfs/storage.local/engineering/mendozagroup/scratch/crystal/${USER}
echo "submit directory: "
echo $SLURM_SUBMIT_DIR
mkdir -p $scratch/$JOB
# copy file into scratch directory
# the following line need be modified according to where your input is located
cp $DIR/${JOB}* $scratch/$JOB/
cd $scratch/$JOB
#The following few lines are necessary to run script runmpi14 runmpi_prop14. DO NOT make changes
touch machines.LINUX
rm machines.LINUX
for i in `scontrol show hostnames $SLURM_JOB_NODELIST`
do
echo "$i slots=16" >> machines.LINUX
done
touch nodes.par
rm nodes.par
for i in `scontrol show hostnames $SLURM_JOB_NODELIST`
do
echo "$i " >> nodes.par
done
#Run Pcrystal and Pproperties parallelly. Modify according to your own needs
${DIR}/runmpi14 8 ${JOB}
#${DIR}/runmpi_prop14 8 ${JOB} ${JOB}
#copy all outputs back into ${DIR}/results, adjust according to your own needs
mkdir ${DIR}/results
cp * ${DIR}/results
# uncomment the next 5 lines if you want to remove the scratch directory
if [ $? -eq 0 ]
then
cd ${DIR}
rm -rf $scratch/${JOB}
fi
Submission Script, single processor (hpc):
#!/bin/bash
#SBATCH -J NbAs
#SBATCH -o crys14-%J.o
#SBATCH -n 1
#SBATCH -p mendoza_q
#SBATCH -t 12:30:00
export JOB=MgO
export DIR=$SLURM_SUBMIT_DIR
#If the directory does not exist in the scratch, remove the comment in the next line
#mkdir /panfs/storage.local/engineering/mendozagroup/scratch/crystal/${USER}
export scratch=/panfs/storage.local/engineering/mendozagroup/scratch/crystal/${USER}
echo "submit directory: "
echo $SLURM_SUBMIT_DIR
# remove the following line if already in your .bashrc file
export PATH=/panfs/storage.local/engineering/mendozagroup/crystal/v1_0_4b/bin/Linux-ifort_XE_emt64/v1.0.4:$PATH
module purge
module load intel-openmpi
mkdir -p $scratch/$JOB
# the following line need be modified according to where your input is located
cp $DIR/${JOB}.* $scratch/$JOB/
#cp $DIR/${JOB}.d3 $scratch/$JOB/${JOB}.d3
cd $scratch/$JOB
touch hostfile
rm hostfile
for i in `scontrol show hostnames $SLURM_JOB_NODELIST`
do
echo "$i slots=16" >> hostfile
done
# in the following, -np parameters should be equal to those specified above.
#mpirun -np 4 -machinefile hostfile Pcrystal 2>&1 > $DIR/${JOB}.out
#cp fort.9 ${DIR}/${JOB}.f9
#alternative way of running Pcrystal and Pproperties
${CRY14_UTILS}/runcry14 ${JOB}
mkdir ${DIR}/results
cp ${JOB}.* ${DIR}/results
cp ${JOB}_* ${DIR}/results
# you can also copy *doss.ps and *band.ps from scratch file.
#cp ${JOB}_doss.ps ${DIR}/
#cp ${JOB}_band.ps ${DIR}/
# uncomment the next 5 lines if you want to remove the scratch directory
if [ $? -eq 0 ]
then
cd ${DIR}
rm -rf $scratch/${JOB}
fi