Complex polarization propagator in the X-ray region
Contents
Complex polarization propagator in the X-ray region¶
Objectives
Learn how to run a complex polarization propagator (CPP) calculation.
Keypoints
Run a CPP calculation.
Plot the absorption spectrum.
Perform scalability test of the CPP calculation.
Introduction¶
In this exercise we will use an efficient implementation of the complex polarization propagator approach (CPP) to compute the near-edge X-ray absorption fine-structure spectrum of free-base porphyrin.
Conventional response theory solves a generalized eigenvalue problem and provides excitation energies starting from the lowest excited states. It is therefore impractical to study spectral regions with high density-of-states. The CPP approach introduces a damping term which, from a purely computational perspective, removes the singularities of the response functions at resonance frequencies. The damped response theory can be applied to any frequency region of interest. You may read more in this paper [KN14]
The CPP solver in VeloxChem will solve multiple frequencies simultaneously. The complex response equations for a given frequency can be expressed in terms of a coupled set of linear equations for a real symmetric matrix
Here, \(\omega\) is the frequency, \(\gamma\) is the damping parameter, \(E^{[2]}\) and \(S^{[2]}\) are the Hessian and metric matrices, respectively, and \(G\) is the gradient vector. The \(R\)/\(I\) superscripts denote real/imaginary components, while the \(g\)/\(u\) subscripts denote gerade/ungerade symmetry.
System: free-base porphyrin¶
Input file¶
Below is the input file for a CPP calculation of free-base porphyrin. You can read more about the VeloxChem input keywords in this page.
@jobs
task: response
@end
@method settings
basis: def2-svp
@end
@response
property: absorption (cpp)
frequencies: 10.8 - 11.0 (0.002)
@end
@molecule
charge: 0
multiplicity: 1
xyz:
H 3.209599995 3.172309777 0.000000000
N 0.000000000 -2.113600613 0.000000000
N 2.031813914 0.000000000 0.000000000
N 0.000000000 2.113600613 0.000000000
N -2.031813914 0.000000000 0.000000000
C 1.126850920 -2.888627221 0.000000000
C -1.126850920 -2.888627221 0.000000000
C 1.126850920 2.888627221 0.000000000
C -1.126850920 2.888627221 0.000000000
C 2.850160984 -1.083939750 0.000000000
C 2.850160984 1.083939750 0.000000000
C -2.850160984 -1.083939750 0.000000000
C -2.850160984 1.083939750 0.000000000
C 0.683827200 -4.249372023 0.000000000
C -0.683827200 -4.249372023 0.000000000
C 0.683827200 4.249372023 0.000000000
C -0.683827200 4.249372023 0.000000000
C 4.248378966 -0.675836785 0.000000000
C 4.248378966 0.675836785 0.000000000
C -4.248378966 -0.675836785 0.000000000
C -4.248378966 0.675836785 0.000000000
C 2.433989580 -2.416542873 0.000000000
C -2.433989580 -2.416542873 0.000000000
C -2.433989580 2.416542873 0.000000000
C 2.433989580 2.416542873 0.000000000
H 1.341416542 -5.103998738 0.000000000
H -1.341416542 -5.103998738 0.000000000
H 1.341416542 5.103998738 0.000000000
H -1.341416542 5.103998738 0.000000000
H 5.096138011 -1.344322017 0.000000000
H 5.096138011 1.344322017 0.000000000
H -5.096138011 -1.344322017 0.000000000
H -5.096138011 1.344322017 0.000000000
H 3.209599995 -3.172309777 0.000000000
H -3.209599995 -3.172309777 0.000000000
H -3.209599995 3.172309777 0.000000000
H 0.000000000 -1.102285542 0.000000000
H 0.000000000 1.102285542 0.000000000
@end
You can download it with:
wget https://raw.githubusercontent.com/ENCCS/veloxchem-hpc/main/content/inputs/porphyrin.inp
You can set the timing
keyword in the response group if you
want to look at a breakdown of the total time by specific sub-tasks in the
calculation.
Exercise¶
Submit a job
Runs the above example on 2 nodes. On Dardel this will take around 2 minutes.
Plot and analyse the spectrum
The absorption spectrum will be printed at the end of the output file. Compare this to the results provided in this Jupyter notebook on MyBinder, where analysis of polarization dependence and the association of features to chemically unique atoms is also available. Results for a smaller system (vinylfluoride) are also available.
Investigate strong scalability for the CPP workload
Run the CPP calculation on different number of nodes. Plot the speedup with respect to the number of nodes.
Plotting your results
You can adapt this sample script.
import numpy as np
import plotly.graph_objs as go
# insert your data!
nnodes = np.array([1, 2, 3, 4])
# insert your data!
timings = np.array([1, 2, 3, 4])
speedup = timings[0] / timings
fig = go.Figure()
fig.add_trace(
go.Scatter(
name=f"SCF",
x=nnodes,
y=speedup,
mode="lines+markers",
hovertemplate="~%{y:.2f}x<extra></extra>",
)
)
fig.update_layout(
title="SCF Speedup",
xaxis_title="Number of nodes",
yaxis_title="Speedup",
height=500,
width=600,
)