.. tip:: All input files can be downloaded: :download:`Files `. .. tip:: For detailed tutorials of MSDFT, please refer to the following ones: - :doc:`../tutorials/msdft1` - :doc:`../tutorials/msdft2` - :doc:`../tutorials/msdft3` - :doc:`../tutorials/msdft4` msdft ====== .. contents:: :local: This option defines the implementation details of multi-state density functional theory (MSDFT) for excited and diabaitc states. .. option:: offdiag_correlation .. list-table:: :stub-columns: 1 :widths: 5 20 * - Value - ``overlap_weighted`` Will use overlap weighted method * - - ``energy_weighted`` Will use energy weighted method * - - ``correlation_potential`` Will use correlation functional method, given by the ``xc_functional`` option * - Default - ``overlap_weighted`` Define the off-diagonal correlation method. .. option:: single_ex .. list-table:: :stub-columns: 1 :widths: 5 20 * - Value - Single excitations to be considered * - Default - None This option indicates what single excitations are considered. The input format is: ``single_ex occupied_MO_incides : virtual_MO_indices`` For example, ``single_ex 1 5-6 9 : 10-13 15`` considers the following single excitations: - 1 → 10 - 1 → 11 - 1 → 13 - 1 → 15 - 5 → 10 - 5 → 11 - 5 → 13 - 5 → 15 - 6 → 10 - 6 → 11 - 6 → 13 - 6 → 15 - 9 → 10 - 9 → 11 - 9 → 13 - 9 → 15 .. option:: double_ex .. list-table:: :stub-columns: 1 :widths: 5 20 * - Value - Double excitations to be considered * - Default - None This option indicates what double excitations are considered. The input format is: ``double_ex occupied_MO_incides : virtual_MO_indices`` For example, ``double_ex 1 5-6 9 : 10-13 15`` considers the following double excitations: - 1 → 10 - 1 → 11 - 1 → 13 - 1 → 15 - 5 → 10 - 5 → 11 - 5 → 13 - 5 → 15 - 6 → 10 - 6 → 11 - 6 → 13 - 6 → 15 - 9 → 10 - 9 → 11 - 9 → 13 - 9 → 15 Theoretical Background ------------------------- XXXXXX Input Examples -------------------- .. tip:: For detailed tutorials of MSDFT, please refer to the following ones: - :doc:`../tutorials/msdft1` - :doc:`../tutorials/msdft2` - :doc:`../tutorials/msdft3` - :doc:`../tutorials/msdft4` Example: Excited States of (E)-Dimethyldiazene (Automatically) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ In this example, we will calculate the ground state and 2 singlet excited states of (E)-Dimethyldiazene with MSDFT methods. We will use B3LYP/cc-pVTZ level of theory. .. tip:: Acutally, in Qbics, the calculation of excited states using MSDFT is close to (but **NOT** the same as) TSO+NOSI. See :doc:`scfguess` and :doc:`nosi` for details. The input file is: .. code-block:: bash :linenos: :caption: msdft-1.inp basis cc-pvtz end scf charge 0 spin2p1 1 type U end mol N -0.11855722 0.06367877 -0.00010027 N 1.11855814 -0.06366086 -0.00010026 C 1.81864333 1.22402113 0.00009549 H 1.12816980 2.07452976 0.00011126 H 2.46787129 1.25512096 0.88302715 H 2.46820089 1.25538193 -0.88260363 C -0.81864582 -1.22402070 0.00009559 H -0.12816015 -2.07453667 0.00011125 H -1.46787530 -1.25512668 0.88303320 H -1.46820496 -1.25538766 -0.88260977 end msdft single_ex 15 16 : 17 end task msdft b3lyp end Here, ``single_ex 15 16 : 17`` indicates that 1 electron in the 15th or 16th MO is excited to the 17th MO, i.e.: - 15 → 17 - 16 → 17 In ``msdft...end``, there is no ``offdiag_correlation`` option. This means that the off-diagonal correlation will be calculated using the (default) overlap weighted method. After calculation, we will obtain the output file ``msdft-1.out`` and wavefunction files ``msdft-1-gs.mwfn``, ``msdft-1-15-to-17-se.mwfn``, ``msdft-1-16-to-17-se.mwfn``. etc. Their names are self-explaining. For example, ``msdft-1-15-to-17-se.mwfn`` is the wavefunction file for the single excitation from 15th to 17th MO. In the output file ``msdft-1.out``, we can find the following information: .. code-block:: bash :linenos: :caption: msdft-1.out Read non-orthogonal determinants: 0 msdft-1-gs.mwfn 1 msdft-1-15-to-17-se.mwfn Spin flipped: msdft-1-15-to-17-se.mwfn 2 msdft-1-16-to-17-se.mwfn Spin flipped: msdft-1-16-to-17-se.mwfn ---- NOSI Overlap Matrix ---- ============================= 0 1 2 3 4 0 1.00000000 0.00000000 0.00004807 0.00000000 0.00000778 1 0.00000000 1.00000000 0.00000000 0.00000000 0.00000000 2 0.00004807 0.00000000 1.00000000 0.00000000 0.00000000 3 0.00000000 0.00000000 0.00000000 1.00000000 0.00000000 4 0.00000778 0.00000000 0.00000000 0.00000000 1.00000000 ---- NO Hamiltonian Matrix Functional ---- ========================================== 0 1 2 3 4 0 -189.34737100 0.00000019 -0.00909719 -0.00000028 -0.00147274 1 0.00000019 -189.11479500 0.09271220 -0.00000307 -0.00000741 2 -0.00909719 0.09271220 -189.11479500 -0.00000741 -0.00000307 3 -0.00000028 -0.00000307 -0.00000741 -189.24112500 0.02098466 4 -0.00147274 -0.00000741 -0.00000307 0.02098466 -189.24112500 ---- NOSI Coefficients Matrix (column vectors are eigenvectors) ---- ==================================================================== 0 1 2 3 4 0 -1.00000000 -0.00000085 -0.00000551 -0.00001218 -0.00002378 1 -0.00000820 0.00005595 0.00003731 -0.70710678 0.70710678 2 0.00002264 -0.00005595 0.00003731 0.70710678 0.70710678 3 -0.00000330 -0.70710678 0.70710678 -0.00005595 -0.00003731 4 0.00000328 0.70710678 0.70710678 0.00005595 -0.00003731 ---- Singlet and Triplet Excitation Energies ---- ================================================= Eigenstate 0: -189.34737100 Hartree; Excitation energy: 0.00000000 eV Eigenstate 1: -189.26210966 Hartree; Excitation energy: 2.32008047 eV Eigenstate 2: -189.22014034 Hartree; Excitation energy: 3.46212432 eV Eigenstate 3: -189.20750727 Hartree; Excitation energy: 3.80588786 eV Eigenstate 4: -189.02208273 Hartree; Excitation energy: 8.85154931 eV ---- Singlet State Weights ---- =============================== 0 1 2 3 4 0 1.00000000 -0.00000000 0.00000000 -0.00000000 -0.00000000 1 0.00000000 0.00000000 0.00000000 0.50000000 0.50000000 2 -0.00000000 0.00000000 0.00000000 0.50000000 0.50000000 3 0.00000000 0.50000000 0.50000000 0.00000000 0.00000000 4 -0.00000000 0.50000000 0.50000000 0.00000000 0.00000000 ---- NOSI Results ---- ====================== State NOSI Energies Excited Energy Osc. Str. DX DY DZ (Hartree) (eV) (a.u.) (a.u.) (a.u.) 0 -189.34737100 0.00000000 0.00000000 42.82334 0.00028 0.00212 1 -189.26210966 2.31996110 0.00000000 0.00000 -0.00000 -0.00001 2 -189.22014034 3.46194620 0.00000000 -0.00000 0.00005 0.00001 3 -189.20750727 3.80569205 0.00000000 -0.00000 -0.00000 -0.00000 4 -189.02208273 8.85109391 0.94030373 2.85146 0.75306 0.00000 In ``Read non-orthogonal determinants:``, the determinants are shown: - :math:`\phi_0` msdft-1-gs.mwfn - :math:`\phi_1` msdft-1-15-to-17-se.mwfn - :math:`\phi_2` msdft-1-15-to-17-se.mwfn (spin flipped) - :math:`\phi_3` msdft-1-16-to-17-se.mwfn - :math:`\phi_4` msdft-1-16-to-17-se.mwfn (spin flipped) In ``NOSI Overlap Matrix``, the matrix elements :math:`\left\langle\phi_i\middle|\phi_j\right\rangle` are calculated. In ``NO Hamiltonian Matrix Functional``, the matrix elements :math:`\left\langle\phi_i\left|\hat{H}\right|\phi_j\right\rangle` are calculated. In ``NOSI Coefficients Matrix``, the column vectors are eigenvectors of the NOSI Hamiltonian matrix. For example, in column ``1``, we have: .. math:: \left|\psi_1\right\rangle = -0.00000085 \left|\phi_0\right\rangle + 0.00005595 \left|\phi_1\right\rangle -0.00005595 \left|\phi_2\right\rangle - 0.70710678\left|\phi_3\right\rangle + 0.70710678 \left|\phi_4\right\rangle When a determinant and its spin flipped counterpart are combined with out-of-phases (``-0.70710678`` and ``-0.70710678``), this is a **triplet** state. When a determinant and its spin flipped counterpart are combined with in-phases (``0.70710678`` and ``0.70710678``), this is a **singlet** state. The excited energies are shown in ``NOSI Results``. A CI coefficient file and a spectrum file are generated. For example, ``msdft-1-ci.txt`` and ``msdft-1-spectrum.txt``. You can see that the energies are slightly different from the results obtained by TSO+NOSI in :doc:`nosi`. This is because the MSDFT method applied triplet correction, which should be more accurate. .. list-table:: * - State - MSDFT (eV) - TSO+NOSI (eV) (see :doc:`nosi`) * - S\ :sub:`0` - 0.00000000 - 0.00000000 * - T\ :sub:`1` - 2.31996110 - 2.32371833 * - S\ :sub:`1` - 3.46194620 - 3.45818894 * - T\ :sub:`2` - 3.80569205 - 3.82320418 * - S\ :sub:`2` - 8.85109391 - 8.83363623 Example: N and O K-Edge XAS of N\ :sub:`2`\ O ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ In this example, we will calculate the K-edge XAS of N\ :sub:`2`\ O with MSDFT methods. We will use B3LYP/cc-pCVTZ level of theory. Here, "K-edge" means that the excitation is from 1s orbital to virtual ones. We use aug-cc-pCVTZ instead of aug-cc-pVTZ because the "pCVTZ" is highly optimized for core orbitals. First, we do a standard SCF calculation for N\ :sub:`2`O to see orbitals. The input file is: .. code-block:: bash :linenos: :caption: n2o-gs.inp basis aug-cc-pCVTZ end scf charge 0 spin2p1 1 type U end mol N 0. 0. -0.14168067 N 0. 0. 0.97956073 O 0. 0. 2.16211994 end task energy b3lyp end Now we can visualize the molecular orbitals. Open `Qbics-MolStar `_, and drag ``n2o-gs.mwfn`` into explorer, and it will be automatically loaded. Right-click :guilabel:`n2o-gs.mwfn` and select :guilabel:`View Molecular Orbitals`. Click the MOs and see below: .. figure:: figs/msdft-1.jpg Obviously, the MO 1 is the 1s orbitals for oxygen, and the MO 2,3 are the 1s orbitals for nitrogen. The N and O K-edge XAS are quiet separated, so it is better (but not necessary) to calculate them separately with MSDFT methods. The input files for O and N K-edge XAS are: .. tabs:: .. tab:: msdft-2-O.inp .. code-block:: bash :linenos: :caption: msdft-2-O.inp basis aug-cc-pCVTZ end scf charge 0 spin2p1 1 type U end mol N 0. 0. -0.14168067 N 0. 0. 0.97956073 O 0. 0. 2.16211994 end msdft single_ex 1 : 12-18 end task msdft b3lyp end .. tab:: msdft-2-N.inp .. code-block:: bash :linenos: :caption: msdft-2-N.inp basis aug-cc-pCVTZ end scf charge 0 spin2p1 1 type U end mol N 0. 0. -0.14168067 N 0. 0. 0.97956073 O 0. 0. 2.16211994 end msdft single_ex 2 3 : 12-18 end task msdft b3lyp end Here, ``single_ex 1 : 12-18`` indicates that 1 electron in the 1st MO is excited to the 12th to 18th MO; ``single_ex 2 3 : 12-18`` indicates that 1 electron in the 2nd and 3rd MO is excited to the 12th to 18th MO. You can excite them to higher virtual MOs to get more accurate results. After calculation, we will obtain the output files ``msdft-2-O.out`` and ``msdft-2-N.out``. The excited state MWFN files are also available. There are also files for spertrum plotting: ``msdft-2-O-spectrum.txt`` and ``msdft-2-N-spectrum.txt``. For example, in ``msdft-2-N.out``, we can find the following information: .. code-block:: bash :linenos: :caption: msdft-2-N.out ---- NOSI Results ---- ====================== State NOSI Energies Excited Energy Osc. Str. DX DY DZ (Hartree) (eV) (a.u.) (a.u.) (a.u.) 0 -184.74191466 0.00000000 0.00000000 -0.00000 0.00001 62.02962 1 -170.03989460 400.04196592 0.00000000 0.00000 -0.00000 0.00000 2 -170.03502387 400.17449843 0.00000000 -0.00000 0.00000 -0.00000 3 -170.01752034 400.65076950 0.05261600 0.06433 0.08133 0.00000 4 -170.01547342 400.70646604 0.05144446 0.08040 -0.06362 -0.00000 5 -169.92447560 403.18251673 0.00000000 0.00000 -0.00000 0.00000 6 -169.91893969 403.33314900 0.00000000 0.00000 -0.00000 -0.00000 7 -169.91191435 403.52430858 0.00000000 -0.00000 0.00000 0.00000 8 -169.91076621 403.55554928 0.00534389 0.00000 -0.00000 0.03293 9 -169.88759854 404.18594177 0.06488836 -0.07104 -0.08999 0.00000 10 -169.88267696 404.31985772 0.06490275 0.08998 -0.07104 0.00000 11 -169.83564482 405.59960229 0.00000000 -0.00000 -0.00000 0.00000 12 -169.82950253 405.76673395 0.00925187 -0.00000 0.00000 0.04321 13 -169.81735744 406.09720202 0.00000000 0.00000 0.00000 0.00000 14 -169.81567589 406.14295698 0.00498163 -0.02593 -0.01821 0.00000 15 -169.81376836 406.19486083 0.00000000 -0.00000 0.00000 -0.00000 16 -169.81204070 406.24187047 0.00494890 0.01812 -0.02586 0.00000 17 -169.80681991 406.38392818 0.00000000 -0.00000 -0.00000 0.00000 18 -169.79772608 406.63137137 0.01209756 0.00000 -0.00000 -0.04935 19 -169.74853637 407.96982327 0.00000000 -0.00000 0.00000 -0.00000 20 -169.74401565 408.09283219 0.00113590 0.00000 0.00000 0.01510 21 -169.67330415 410.01689210 0.00000000 0.00000 -0.00000 0.00000 22 -169.67060344 410.09037844 0.00107912 0.00000 -0.00000 -0.01468 23 -169.65887737 410.40944479 0.00000000 0.00000 -0.00000 0.00000 24 -169.63235011 411.13125137 0.00601950 0.00000 0.00000 -0.03462 25 -169.07874371 426.19488170 0.00004203 0.00000 -0.00000 -0.00284 26 -169.07628789 426.26170433 0.00000000 0.00000 0.00000 -0.00000 27 -166.93991246 484.39247991 0.00003223 -0.00000 -0.00000 0.00233 28 -166.93767426 484.45338124 0.00000000 0.00000 -0.00000 -0.00000 You can identify the states from output files. For example, the coefficients of state ``4`` are: .. code-block:: bash :linenos: :caption: msdft-2-N.out ---- NOSI Coefficients Matrix (column vectors are eigenvectors) ---- ==================================================================== 0 1 2 3 4 0 0.99999900 0.00000000 -0.00000000 0.00000000 -0.00000000 1 -0.00000000 -0.00573951 -0.00000102 0.00074472 -0.00000001 2 -0.00000000 0.00573951 0.00000102 0.00074472 -0.00000001 3 -0.00000000 0.00000132 0.00527620 -0.00000167 -0.00020742 4 -0.00000000 -0.00000132 -0.00527620 -0.00000167 -0.00020742 5 -0.00009224 -0.00000000 0.00000000 0.00000000 -0.00000000 6 -0.00009224 0.00000000 -0.00000000 0.00000000 -0.00000000 7 -0.00005050 0.00000004 -0.00000004 -0.00000003 0.00000003 8 -0.00005050 -0.00000004 0.00000004 -0.00000003 0.00000003 9 -0.01938433 0.00000002 0.00000006 0.00000027 0.00000011 10 -0.01938443 -0.00000002 -0.00000006 0.00000027 0.00000011 11 -0.01615554 -0.00000011 0.00000024 -0.00000053 0.00000224 12 -0.01615584 0.00000011 -0.00000024 -0.00000053 0.00000224 13 -0.00408296 0.00000017 -0.00000022 0.00000078 -0.00000210 14 -0.00408276 -0.00000017 0.00000022 0.00000078 -0.00000210 15 0.00000000 0.70440082 0.00016811 -0.70886826 0.00029439 16 0.00000000 -0.70440082 -0.00016811 -0.70886826 0.00029439 17 0.00000000 0.00007913 -0.70442320 0.00045204 0.70883620 18 0.00000000 -0.00007913 0.70442320 0.00045204 0.70883620 19 -0.00027387 0.00000004 -0.00000009 -0.00000007 0.00000003 20 -0.00027386 -0.00000004 0.00000009 -0.00000007 0.00000003 21 -0.00036762 0.00000357 -0.00000375 -0.00000369 0.00000380 22 -0.00036762 -0.00000357 0.00000376 -0.00000369 0.00000380 23 -0.00000001 -0.01231909 -0.00528893 -0.00894872 -0.00371633 24 -0.00000001 0.01231909 0.00528893 -0.00894872 -0.00371633 25 0.00000002 0.00424293 -0.01251586 0.00260869 -0.00878159 26 0.00000002 -0.00424293 0.01251586 0.00260869 -0.00878159 27 0.00040798 -0.00000375 0.00000392 0.00000362 -0.00000376 28 0.00040798 0.00000376 -0.00000392 0.00000362 -0.00000376 The largest coefficients for state ``4`` is :math:`0.70883620\phi_{17}+0.70883620\phi_{18}`, which is the combination of ``msdft-2-N-3-to-13-se.mwfn`` and its spin flipped one. So, this state is mainly the 3→13 single excitation, i.e. terminal-nitrogen :math:`1s\rightarrow\pi^*` excitation (see below for MO 13, which is a :math:`\pi^*` MO) .. figure:: figs/msdft-2.jpg To plot the spectrum, you can use the script ``tools/plotspec.py`` provided by Qbics (or any tools you like). Assume you want to plot ```` First, copy this file to the same directory as the input file, and modify the following parameters: .. code-block:: python :linenos: :caption: plotspec.py if __name__ == "__main__": fn = "msdft-2-N-spectrum.txt" # Spectrum file name. eL_eV = 400 # Lower energy limit. eH_eV = 410 # Higher energy limit. sigma_eV = 0.2 # Sigma value. num_ps = 500 # Number of points. use_angle = False # Whether to use angle dependence. Here, we want to plot the spectrum from 400 (``eL_eV``) to 410 (``eH_eV``) eV, with a sigma value of 0.2 (``sigma_eV``) and 500 (``num_ps``) points. You can change these parameters to get the desired spectrum. .. tip:: Please cite this paper, if you use this script and formular in it: - `J. Phys. Chem. C 2022, 126, 8720 `_ The N and O K-edge XAS spectra as well as experimental data are shown below: .. figure:: figs/msdft-3.jpg We can see that, MSDFT can give quite good results for N and O K-edge XAS!