Softwares

You will find here a list of the softwares used in the lab, with some tutorials and example of scripts.


ADF

documentation

To use ADF on HPC: module load -s adf/adf2013.01

Example of script on HPC:

#! /bin/bash
# 4 nodes and 4 cores per node for 240 hours
#SBATCH -N 2
#SBATCH -n 32
#SBATCH -A qoschimie
#SBATCH -t 240:00:00
#SBATCH -p pri2013
#SBATCH -o fichier_sortie
#SBATCH -e fichier_erreur
#SBATCH -J adf-tg

source ${HOME}/.bashrc

filename='opt'

module load adf/adf2013.01   

export NSCM=$SLURM_NTASKS
export SCM_TMPDIR=/scratch/job.${SLURM_JOB_ID}

source $filename.inp

chmod a+r TAPE21

mv logfile $filename.log
mv fichier_sortie $filename.out
mv TAPE21 $filename.t21

rm t21*
rm TAPE41

Input for geometry optimisation: opt.inp

Input for excited states / absorption spectrum TDDFT: tddft.inp


Gaussian

documentation

To use Gaussian on HPC: module load -s gaussian/g16c01

Example of script on quantilene:

#!/bin/bash
#

# Comments by Pablo ROSEIRO: 06.10.2023

# This allows to have proper error files output
echo $shell
set -xv

# Name of the Project, this is read by OpenMolcas
export Project="h2"
# Personal directory in /ilene/ containing your datas
export MyDir="/ilene/user-login/data_directory"
# Programs often read $CurrDir
export CurrDir=$MyDir
# Working directory (created on the node)
# The .$$ generates a random number, this allows to have nicely defined WorkDirs
export WorkDir="/tmp/user-login.$$" 

# Environment variables: DO NOT MODIFY the three next lines
export GAUSS_SCRDIR=$WorkDir
export g09root=/common/GAUSSIAN/g09d
# Profile G09
. $g09root/g09/bsd/g09.profile

#-------------------------------------------
# GAUSSIAN 
#-------------------------------------------
# Infile = Input file / Outfile = Output file

# Create the WorkDir
mkdir $WorkDir
# Enter it (on the node)
cd $WorkDir

# GAUSSIAN
Infile=$MyDir/$Project.opt.in
Outfile=$MyDir/$Project.opt.out

g09 < $Infile > $Outfile


# This allows to delete the WorkDir to free space
# Comment it if you need to use the data for further calculations
rm -rf $WorkDir

# Quit the script
exit

Input for H2 in Tetrahydrofuran: h2.opt.in


MCTDH

documentation

To use mctdh on HPC: module load -s mctdh/mctdh86.3


MOLPRO

documentation

To use Molpro on HPC: module load -s moplro/molpro2012

Example of script on quantilene:

#!/bin/bash
#
#-------------------------------------
#      script sample to run Molpro
#-------------------------------------
#echo $shell
#set -xv

#
#   add Molpro's binaries to the PATH
#
export PATH=$PATH:/common/MOLPRO/molpro2009.1/bin
#
#     Project  name
#
export Project=project-name

#
#   directory where you store your input and result files
#
export CurrDir=/ilene/login-name/directory
#
#   Directory where you wish to save the files from the $WorkDir at
#   job's end, this is optional can be the same as $CurrDir, a directory
#   on /nosave/login-name, on /users/login-name, on /ilene/login-name
#

export $SaveDir=/the-directory
#
#
#  by default Molpro stores its temporary file in /tmp
#
export WorkDir=/tmp/login-name.$$

#   create work directory
mkdir $WorkDir
cd $WorkDir

#
#   run Molpro
#  -d $WorkDir : the scratch files are to be located in $WorkDir instead of /tmp
#  $CurrDir/$Project.inp: input file
#  $CurrDir/$Project.out: ouput file

molpro -d $WorkDir   $CurrDir/$Project.inp > $CurrDir/$Project.out 2>&1

# if needed copy the files from the $WorkDir to your $SaveDir

cp $WorkDir/$Project.* $SaveDir
#
# remove all files left in your $WorkDir

rm -Rf $WorkDir

exit

Openmolcas

documentation

To use OpenMolcas on HPC: module load -s openmolcas/openmolcas-23.02.i23

Example of script on quantilene:

#!/bin/bash
#

# Comments by Pablo ROSEIRO: 06.10.2023

# This allows to have proper error files output
echo $shell
set -xv

# Name of the Project, this is read by OpenMolcas
export Project="h2"
# Personal directory in /ilene/ containing your datas
export MyDir="/ilene/user-login/datas_directory"
# Programs often read $CurrDir
export CurrDir=$MyDir
# Working directory (created on the node)
# The .$$ generates a random number, this allows to have nicely defined WorkDirs
export WorkDir="/tmp/user-login.$$" 

# OpenMolcas v.23 is installed, do not modify these seven lines if not to change the version
MOLCAS="/ilene/grouaut/build_OpenMolcas"
export pymolcas="$MOLCAS/pymolcas"
export MOLCAS
PATH=$PATH:.:/usr/local/bin/python3.8
LD_LIBRARY_PATH="$LD_LIBRARY_PATH":/ilene/roseiro/usr/lib64
export LD_LIBRARY_PATH
export PATH=$PATH:.:/common/COST2/cost/bin

# This creates INPORB files with 4 columns (by default, ..VERSION=2.2, INPORB files with 5 columns)
# This is useful if one need to do a CASDI calculation further
export MOLCAS_INPORB_VERSION=1.1 

#-------------------------------------------
# OPEN MOLCAS
#-------------------------------------------
# Infile = Input file / Outfile = Output file

# Create the WorkDir
mkdir $WorkDir
# Enter it (on the node)
cd $WorkDir


# SEWARD: integral calculations
Infile=$MyDir/$Project.seward.in 
Outfile=$MyDir/$Project.seward.out
$pymolcas auto $Infile > $Outfile



# CAS2_2SCF: CAS(2,2)SCF calculation
Infile=$MyDir/$Project.cas2_2scf.in 
Outfile=$MyDir/$Project.cas2_2scf.out
$pymolcas auto $Infile > $Outfile

cp $WorkDir/$Project.RasOrb $MyDir/$Project.RasOrb
# It is important to save the Molecular Orbitals
# the prefix change depending on the type of calculation
# CASSCF: *.RasOrb
# SCF: *.ScfOrb

# This allows to delete the WorkDir to free space
# Comment it if you need to use the data for further calculations
rm -rf $WorkDir

# Quit the script
exit

Input for H2 CAS2_2SCF calculation: h2.cas2_2scf.in

Input for H2 seward integral calculation: h2.seward.in


Orca

documentation

To use Orca on HPC: module load -s orca/orca-5.0.3

Example of script on HPC:

#! /bin/bash
#SBATCH -N 1
#SBATCH -n 16 
#SBATCH -t 240:00:00
#SBATCH -p pri2013
#SBATCH -A qoschimie
#SBATCH -J orca
#SBATCH --mem=48000

source ~/.bashrc

dir=
f=

 # loading OpenMPI environment
module load openmpi/openmpi-1.6.5.i13 

 # loading Orca environment
module load orca/orca-5.0.3

cd $dir
`which orca` $f.inp > $f.out
rm *tmp

Input for geometry optimisation: opt.inp

Input for excited states / absorption spectrum TDDFT: tddft.inp


Psi4

documentation

To use Psi4 on HPC: module load -s psi4/psi4-1.9.1

Example of use of Psi4 to compute the potential energy surface of the H4 molecule in the STo-3G basis:

import numpy as np
import psi4
import matplotlib.pyplot as plt

def RUN_FCI_PSI4( string_geo, basisset, num_roots ):
    '''
    A function to run a FCI method with the Psi4 package
    '''
    psi4.geometry( string_geo )
    psi4.set_options({  'basis'       : basisset,
                        'num_roots'   : num_roots,
                        'S'           : 0.0,
                        'DIAG_METHOD' : 'SEM' })
    fci, fcici_wfn = psi4.energy('fci',return_wfn=True)

    E_FCI = []
    for root in range(num_roots):
        E_FCI += [ psi4.variable('CI ROOT {} TOTAL ENERGY'.format(root)) ]

    return E_FCI

E_FCI = []
basisset = 'sto-3g'
MAX_ROOT = 15
list_theta = np.linspace(num = 30, start=20. * np.pi/180., stop=160. * np.pi/180., endpoint=True)

dim_parameter = len(list_theta)
Energies_FCI    = np.zeros((dim_parameter,MAX_ROOT))

# for r in tqdm(list_r):
elem = 0
for theta in (list_theta):
    r = 1.

    XYZ_geometry = """ H   {0}   {1}  0.
                       H   {0}  -{1}  0.
                       H  -{0}   {1}  0.
                       H  -{0}  -{1}  0.  """.format( r*np.cos(theta/2.), r*np.sin(theta/2.) )

    Energies_FCI[elem,:] = RUN_FCI_PSI4( XYZ_geometry  + '\n' + 'symmetry c1', basisset, MAX_ROOT )

    elem += 1

# plotting the result:

plt.rc('font',  family='serif')
plt.rc('font',  serif='Times New Roman')
plt.rc('font',  size='14')
plt.rc('xtick', labelsize='x-large')
plt.rc('ytick', labelsize='x-large')
plt.rc('lines', linewidth='2')

# Plotting the resulting energies
fig, ( ax1 ) = plt.subplots( nrows=1, ncols=1, figsize=(8, 6)  )
for i in range(3):
     if i ==0:
        ax1.plot( list_theta, Energies_FCI[:,i], color='red' , label='Psi4 (Singlet states only)' )
     else:
        ax1.plot( list_theta, Energies_FCI[:,i], color='red'   )
ax1.grid()
ax1.set_ylabel('Energy (Ha)', size=24)
ax1.set_xlabel('Angle (rad.)', size=24)
ax1.legend(fontsize='large', ncol=1)

plt.tight_layout()
plt.show()

QuantNBody

documentation

Example of script for the implementation of a FCI method on a Fermi-hubbard ring:

# ==========================================================================================
# ==========================================================================================
# 
# A code to demonstrate how to implement a FCI method with 
# the QuantNBody package on a Fermi-Hubbard ring with 2 electrons in 2 orbitals. 
#
# Author : Dr Saad Yalouz - Laboratoire de Chimie Quantique de Strasbourg, France
# ==========================================================================================
# ==========================================================================================

import quantnbody as qnb
import numpy as np   
import scipy 
import matplotlib.pyplot as plt 

#========================================================|
# Parameters for the simulation 
n_elec =  2   #   Number of electrons  
n_mo   =  2   #   Number of molecular orbitals

# Building the Many-body basis            
nbody_basis = qnb.fermionic.tools.build_nbody_basis( n_mo, n_elec  )

# Building the matrix representation of the adagger_a operator in the many-body basis                       
a_dagger_a  = qnb.fermionic.tools.build_operator_a_dagger_a( nbody_basis )

# Building the matrix representation of several interesting spin operators in the many-body basis  
S_2, s_z, s_plus = qnb.fermionic.tools.build_s2_sz_splus_operator( a_dagger_a )
 
# List of on-site repulsion terms U
list_U = np.linspace(0, 6, 20)
 
# Hopping terms
h_MO = np.zeros((n_mo,n_mo))
for site in range(n_mo-1): 
    h_MO[site,site+1] =  h_MO[site+1,site] = -1  
    
# Loop over the U terms to build PES
E_0_qnb = []
E_1_qnb = []
for U in  list_U : 
    U_MO = np.zeros((n_mo,n_mo,n_mo,n_mo))
    for site in range(n_mo):
        U_MO[site,site,site,site] = U
    
    # Building the matrix representation of the Hamiltonian operators 
    H  = qnb.fermionic.tools.build_hamiltonian_fermi_hubbard(  h_MO,
                                                               U_MO,
                                                               nbody_basis,
                                                               a_dagger_a,
                                                               S_2=S_2,
                                                               S_2_target=0)
    # Diagonalizing the Hamiltonian
    eig_en, eig_vec = scipy.sparse.linalg.eigsh( H,   which='SA', k=2 ) 
    E_0_qnb += [ eig_en[0]  ]
    E_1_qnb += [ eig_en[1]  ]

#========================================================|
# Plotting ground and first excited states PES
plt.rc('font',  family='Helvetica') 
plt.rc('xtick', labelsize='xx-large')
plt.rc('ytick', labelsize='xx-large')
plt.rc('lines', linewidth='2')

fig, (ax1) = plt.subplots(nrows=1, ncols=1, figsize=(8, 6))  
ax1.plot( list_U,  E_0_qnb, color='blue',  marker='o', label='$E_0^{qnb}$')
ax1.plot( list_U,  E_1_qnb, color='red',  marker='o', label='$E_1^{qnb}$')
ax1.set_xlabel(' U ', size=22)
ax1.set_ylabel('Energy', size=22)
ax1.autoscale(enable=True, axis='y', tight=None)
ax1.legend(fontsize='x-large')
ax1.grid()
plt.show()

SHARC

documentation

To use SHARC on HPC: module load -s sharc/sharc-3.0.2


TheoDORE

documentation

Example of input for organometallic compound analysis:

rtype='adf'
rfile='../td.t21'
at_lists=[[fragment1],[fragment2],[fragment3]]
Om_formula=2
eh_pop=1
comp_ntos=True
comp_dntos=False
prop_list=['Om', 'POSi', 'POSf', 'PR', 'CT', 'MC', 'LC', 'MLCT', 'LMCT', 'LLCT', 'PRNTO', 'Z_HE', 'RMSeh']