APS 2026 Short Course Tutorial 1: Quantum Defect Embedding Theory (QDET)
This tutorial shows how to compute vertical excitation energies of the negatively charged nitrogen-vacancy center (NV\(^-\)) in diamond using quantum defect embedding theory (QDET). In QDET, the effective Hamiltonian that describes excitations within an active space consisting of selected Kohn-Sham (KS) orbitals is formulated as:
where \(t^{\text{eff}}\) and \(v^{\text{eff}}\) are the effective one- and two-body terms, respectively. An exact diagonalization of the effective Hamiltonian yields the energies and wavefunctions of the many-body states of the spin defect. More details about the method, and definitions for \(t^{\text{eff}}\) and \(v^{\text{eff}}\) can be found in Sheng et al., J. Chem. Theory Comput. 18, 3512 (2022) and Chen et al., J. Chem. Theory Comput. 21, 7797 (2025).
A QDET calculation is performed in four steps:
Perform a ground-state density functional theory (DFT) calculation.
Identify defect orbitals and define the active space.
Compute parameters \(t^{\text{eff}}\) and \(v^{\text{eff}}\) of the QDET effective Hamiltonian.
Diagonalize the Hamiltonian using full configuration interaction (FCI).
1. DFT
We perform a ground-state DFT calculation using Quantum ESPRESSO (QE).
Download the following files to your working directory:
[ ]:
%%bash
wget -N -q https://west-code.org/doc/training/nv_diamond_215/qdet/pw.in
wget -N -q http://www.quantum-simulation.org/potentials/sg15_oncv/upf/C_ONCV_PBE-1.2.upf
wget -N -q http://www.quantum-simulation.org/potentials/sg15_oncv/upf/N_ONCV_PBE-1.2.upf
The pw.in file is the input for the pw.x code:
[1]:
%%bash
cat pw.in
! NV- in diamond 3x3x3 supercell
! V 0 0 0
&CONTROL
calculation = 'scf'
pseudo_dir = './'
/
&SYSTEM
ibrav = 0
ntyp = 2
nat = 215
tot_charge = -1.0
ecutwfc = 60.0
nbnd = 600
occupations = 'from_input'
/
&ELECTRONS
diago_full_acc = .true.
/
ATOMIC_SPECIES
C 12.011 C_ONCV_PBE-1.2.upf
N 14.007 N_ONCV_PBE-1.2.upf
CELL_PARAMETERS angstrom
10.704 0.000 0.000
0.000 10.704 0.000
0.000 0.000 10.704
K_POINTS gamma
ATOMIC_POSITIONS angstrom
N 0.9796932824 0.9796932824 0.9796932824
C 0.0434671029 1.7828522451 1.7828522451
C 0.8965358600 2.6900606190 2.6900606190
C 1.7828522451 0.0434671029 1.7828522451
C 2.6900606190 0.8965358600 2.6900606190
C 1.7828522451 1.7828522451 0.0434671029
C 2.6900606190 2.6900606190 0.8965358600
C 0.0009075481 0.0009075481 3.5625457860
C 0.8926644107 0.8926644107 4.4605426143
C 0.0001676013 1.7829000123 5.3523635791
C 0.8912605508 2.6748036534 6.2457414429
C 1.7829000123 0.0001676013 5.3523635791
C 2.6748036534 0.8912605508 6.2457414429
C 1.7889231949 1.7889231949 3.5759326635
C 2.6781139357 2.6781139357 4.4647698246
C -0.0016764334 -0.0016764334 7.1396589398
C 0.8863865518 0.8863865518 8.0355672575
C -0.0111333645 1.7645485540 8.9334170944
C 0.8832242160 2.6584456291 9.8287624414
C 1.7645485540 -0.0111333645 8.9334170944
C 2.6584456291 0.8832242160 9.8287624414
C 1.7791863574 1.7791863574 7.1416044336
C 2.6709093363 2.6709093363 8.0339065551
C 0.0009075481 3.5625457860 0.0009075481
C 0.8926644107 4.4605426143 0.8926644107
C 0.0001676013 5.3523635791 1.7829000123
C 0.8912605508 6.2457414429 2.6748036534
C 1.7889231949 3.5759326635 1.7889231949
C 2.6781139357 4.4647698246 2.6781139357
C 1.7829000123 5.3523635791 0.0001676013
C 2.6748036534 6.2457414429 0.8912605508
C 0.0029636757 3.5735966336 3.5735966336
C 0.8923079612 4.4631682162 4.4631682162
C 0.0001801569 5.3516393679 5.3516393679
C 0.8906753763 6.2409271860 6.2409271860
C 1.7844052107 3.5682994522 5.3549374979
C 2.6752267959 4.4588782746 6.2463794468
C 1.7844052107 5.3549374979 3.5682994522
C 2.6752267959 6.2463794468 4.4588782746
C -0.0015410905 3.5686562692 7.1344743475
C 0.8902200594 4.4551822905 8.0320439847
C -0.0001968056 5.3500748577 8.9211968293
C 0.8907931865 6.2440057215 9.8120328555
C 1.7809370369 3.5569528827 8.9298327373
C 2.6751332478 4.4583041569 9.8141990704
C 1.7838646817 5.3492443000 7.1380104746
C 2.6751906698 6.2422933844 8.0283306482
C -0.0016764334 7.1396589398 -0.0016764334
C 0.8863865518 8.0355672575 0.8863865518
C -0.0111333645 8.9334170944 1.7645485540
C 0.8832242160 9.8287624414 2.6584456291
C 1.7791863574 7.1416044336 1.7791863574
C 2.6709093363 8.0339065551 2.6709093363
C 1.7645485540 8.9334170944 -0.0111333645
C 2.6584456291 9.8287624414 0.8832242160
C -0.0015410905 7.1344743475 3.5686562692
C 0.8902200594 8.0320439847 4.4551822905
C -0.0001968056 8.9211968293 5.3500748577
C 0.8907931865 9.8120328555 6.2440057215
C 1.7838646817 7.1380104746 5.3492443000
C 2.6751906698 8.0283306482 6.2422933844
C 1.7809370369 8.9298327373 3.5569528827
C 2.6751332478 9.8141990704 4.4583041569
C 0.0008758389 7.1301924135 7.1301924135
C 0.8873251254 8.0173783616 8.0173783616
C 0.0057639810 8.9213377814 8.9213377814
C 0.9327076956 9.7455490478 9.7455490478
C 1.7829629583 7.1348009419 8.9185672762
C 2.6797478833 8.0232292617 9.8136584772
C 1.7829629583 8.9185672762 7.1348009419
C 2.6797478833 9.8136584772 8.0232292617
C 3.5625457860 0.0009075481 0.0009075481
C 4.4605426143 0.8926644107 0.8926644107
C 3.5759326635 1.7889231949 1.7889231949
C 4.4647698246 2.6781139357 2.6781139357
C 5.3523635791 0.0001676013 1.7829000123
C 6.2457414429 0.8912605508 2.6748036534
C 5.3523635791 1.7829000123 0.0001676013
C 6.2457414429 2.6748036534 0.8912605508
C 3.5735966336 0.0029636757 3.5735966336
C 4.4631682162 0.8923079612 4.4631682162
C 3.5682994522 1.7844052107 5.3549374979
C 4.4588782746 2.6752267959 6.2463794468
C 5.3516393679 0.0001801569 5.3516393679
C 6.2409271860 0.8906753763 6.2409271860
C 5.3549374979 1.7844052107 3.5682994522
C 6.2463794468 2.6752267959 4.4588782746
C 3.5686562692 -0.0015410905 7.1344743475
C 4.4551822905 0.8902200594 8.0320439847
C 3.5569528827 1.7809370369 8.9298327373
C 4.4583041569 2.6751332478 9.8141990704
C 5.3500748577 -0.0001968056 8.9211968293
C 6.2440057215 0.8907931865 9.8120328555
C 5.3492443000 1.7838646817 7.1380104746
C 6.2422933844 2.6751906698 8.0283306482
C 3.5735966336 3.5735966336 0.0029636757
C 4.4631682162 4.4631682162 0.8923079612
C 3.5682994522 5.3549374979 1.7844052107
C 4.4588782746 6.2463794468 2.6752267959
C 5.3549374979 3.5682994522 1.7844052107
C 6.2463794468 4.4588782746 2.6752267959
C 5.3516393679 5.3516393679 0.0001801569
C 6.2409271860 6.2409271860 0.8906753763
C 3.5693630244 3.5693630244 3.5693630244
C 4.4605727856 4.4605727856 4.4605727856
C 3.5675070634 5.3524312312 5.3524312312
C 4.4596563238 6.2439887125 6.2439887125
C 5.3524312312 3.5675070634 5.3524312312
C 6.2439887125 4.4596563238 6.2439887125
C 5.3524312312 5.3524312312 3.5675070634
C 6.2439887125 6.2439887125 4.4596563238
C 3.5653902900 3.5653902900 7.1396442117
C 4.4585773004 4.4585773004 8.0289158346
C 3.5665650756 5.3503634702 8.9200719617
C 4.4605309439 6.2420438400 9.8123999025
C 5.3503634702 3.5665650756 8.9200719617
C 6.2420438400 4.4605309439 9.8123999025
C 5.3516005561 5.3516005561 7.1363858629
C 6.2441272062 6.2441272062 8.0282131099
C 3.5686562692 7.1344743475 -0.0015410905
C 4.4551822905 8.0320439847 0.8902200594
C 3.5569528827 8.9298327373 1.7809370369
C 4.4583041569 9.8141990704 2.6751332478
C 5.3492443000 7.1380104746 1.7838646817
C 6.2422933844 8.0283306482 2.6751906698
C 5.3500748577 8.9211968293 -0.0001968056
C 6.2440057215 9.8120328555 0.8907931865
C 3.5653902900 7.1396442117 3.5653902900
C 4.4585773004 8.0289158346 4.4585773004
C 3.5665650756 8.9200719617 5.3503634702
C 4.4605309439 9.8123999025 6.2420438400
C 5.3516005561 7.1363858629 5.3516005561
C 6.2441272062 8.0282131099 6.2441272062
C 5.3503634702 8.9200719617 3.5665650756
C 6.2420438400 9.8123999025 4.4605309439
C 3.5667948514 7.1360440964 7.1360440964
C 4.4596344287 8.0277204564 8.0277204564
C 3.5667130655 8.9195109136 8.9195109136
C 4.4575464231 9.8123217752 9.8123217752
C 5.3513394782 7.1357804292 8.9195676856
C 6.2422011628 8.0272515375 9.8116967479
C 5.3513394782 8.9195676856 7.1357804292
C 6.2422011628 9.8116967479 8.0272515375
C 7.1396589398 -0.0016764334 -0.0016764334
C 8.0355672575 0.8863865518 0.8863865518
C 7.1416044336 1.7791863574 1.7791863574
C 8.0339065551 2.6709093363 2.6709093363
C 8.9334170944 -0.0111333645 1.7645485540
C 9.8287624414 0.8832242160 2.6584456291
C 8.9334170944 1.7645485540 -0.0111333645
C 9.8287624414 2.6584456291 0.8832242160
C 7.1344743475 -0.0015410905 3.5686562692
C 8.0320439847 0.8902200594 4.4551822905
C 7.1380104746 1.7838646817 5.3492443000
C 8.0283306482 2.6751906698 6.2422933844
C 8.9211968293 -0.0001968056 5.3500748577
C 9.8120328555 0.8907931865 6.2440057215
C 8.9298327373 1.7809370369 3.5569528827
C 9.8141990704 2.6751332478 4.4583041569
C 7.1301924135 0.0008758389 7.1301924135
C 8.0173783616 0.8873251254 8.0173783616
C 7.1348009419 1.7829629583 8.9185672762
C 8.0232292617 2.6797478833 9.8136584772
C 8.9213377814 0.0057639810 8.9213377814
C 9.7455490478 0.9327076956 9.7455490478
C 8.9185672762 1.7829629583 7.1348009419
C 9.8136584772 2.6797478833 8.0232292617
C 7.1344743475 3.5686562692 -0.0015410905
C 8.0320439847 4.4551822905 0.8902200594
C 7.1380104746 5.3492443000 1.7838646817
C 8.0283306482 6.2422933844 2.6751906698
C 8.9298327373 3.5569528827 1.7809370369
C 9.8141990704 4.4583041569 2.6751332478
C 8.9211968293 5.3500748577 -0.0001968056
C 9.8120328555 6.2440057215 0.8907931865
C 7.1396442117 3.5653902900 3.5653902900
C 8.0289158346 4.4585773004 4.4585773004
C 7.1363858629 5.3516005561 5.3516005561
C 8.0282131099 6.2441272062 6.2441272062
C 8.9200719617 3.5665650756 5.3503634702
C 9.8123999025 4.4605309439 6.2420438400
C 8.9200719617 5.3503634702 3.5665650756
C 9.8123999025 6.2420438400 4.4605309439
C 7.1360440964 3.5667948514 7.1360440964
C 8.0277204564 4.4596344287 8.0277204564
C 7.1357804292 5.3513394782 8.9195676856
C 8.0272515375 6.2422011628 9.8116967479
C 8.9195109136 3.5667130655 8.9195109136
C 9.8123217752 4.4575464231 9.8123217752
C 8.9195676856 5.3513394782 7.1357804292
C 9.8116967479 6.2422011628 8.0272515375
C 7.1301924135 7.1301924135 0.0008758389
C 8.0173783616 8.0173783616 0.8873251254
C 7.1348009419 8.9185672762 1.7829629583
C 8.0232292617 9.8136584772 2.6797478833
C 8.9185672762 7.1348009419 1.7829629583
C 9.8136584772 8.0232292617 2.6797478833
C 8.9213377814 8.9213377814 0.0057639810
C 9.7455490478 9.7455490478 0.9327076956
C 7.1360440964 7.1360440964 3.5667948514
C 8.0277204564 8.0277204564 4.4596344287
C 7.1357804292 8.9195676856 5.3513394782
C 8.0272515375 9.8116967479 6.2422011628
C 8.9195676856 7.1357804292 5.3513394782
C 9.8116967479 8.0272515375 6.2422011628
C 8.9195109136 8.9195109136 3.5667130655
C 9.8123217752 9.8123217752 4.4575464231
C 7.1368489226 7.1368489226 7.1368489226
C 8.0287576956 8.0287576956 8.0287576956
C 7.1372007449 8.9213957561 8.9213957561
C 8.0307057068 9.8117668298 9.8117668298
C 8.9213957561 7.1372007449 8.9213957561
C 9.8117668298 8.0307057068 9.8117668298
C 8.9213957561 8.9213957561 7.1372007449
C 9.8117668298 9.8117668298 8.0307057068
OCCUPATIONS
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
1 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
We run pw.x.
[ ]:
%%bash
mpirun -n 4 pw.x -i pw.in > pw.out
2. Compute localization factor and define QDET active space
We show how to identify KS orbitals that are localized in real space. We will compute the localization factor, defined as
It describes the localization of the n-th KS wavefunction in a given volume \(V\) within the supercell \(\Omega\). We use the westpp.x code to compute localization factors within a sphere. We create the input file westpp.in:
[2]:
import yaml
d = {}
d["westpp_control"] = {}
d["westpp_control"]["westpp_calculation"] = "L"
d["westpp_control"]["westpp_range"] = [1, 600]
d["westpp_control"]["westpp_format"] = "S"
d["westpp_control"]["westpp_r0"] = [0, 0, 0] # center of the vacancy (Bohr)
d["westpp_control"]["westpp_rmax"] = 3 # radius (Bohr) of a sphere enclosing atoms that are nearest neighbors of the vacancy
with open("westpp.in", "w") as f:
yaml.dump(d, f, sort_keys=False)
The sphere is centered around the vacancy at \(\left(0, 0, 0 \right)\) Bohr as specified by westpp_r0, and has a radius of 3 Bohr as specified by westpp_rmax.
[3]:
%%bash
cat westpp.in
westpp_control:
westpp_calculation: L
westpp_range:
- 1
- 600
westpp_format: S
westpp_r0:
- 0
- 0
- 0
westpp_rmax: 3
We run westpp.x.
[ ]:
%%bash
mpirun -n 4 westpp.x -i westpp.in > westpp.out
westpp.x creates a file named west.westpp.save/westpp.json. If the reader does NOT have the computational resources to run the calculation, the file needed for the next step can be downloaded as:
[ ]:
%%bash
mkdir -p west.westpp.save
wget -N -q https://west-code.org/doc/training/nv_diamond_215/qdet/westpp.json -O west.westpp.save/westpp.json
We can now visualize the results:
[4]:
import json
import numpy as np
import matplotlib.pyplot as plt
with open("west.westpp.save/westpp.json", "r") as f:
data = json.load(f)
y = np.array(data["output"]["L"]["K000001"]["local_factor"])
x = np.array([i + 1 for i in range(y.shape[0])])
print("Bands with the largest localization:", x[y>=0.2])
plt.plot(x, y, "o")
plt.xlabel("Band index")
plt.ylabel("Localization factor")
plt.show()
Bands with the largest localization: [426 430 431 432]
The highest localization factors are obtained for bands 426, 430, 431, and 432, corresponding to the a\(_1\) and e defect orbitals of the NV\(^-\) center. These orbitals form the minimum model that describes the defect-to-defect excitations of the NV\(^-\) center. The minimum model should be systematically expanded to assess the convergence of QDET calculations with respect to the size of the active space.
In the next step, we will use an active space consisting of the a\(_1\) and e defect orbitals and all valence bands lying within 2 eV below the valence band maximum (VBM).
3. Build QDET effective Hamiltonian
We first use wstat.x to compute an eigendecomposition of the static dielectric screening, which is used as the basis set for the subsequent step. We then use wfreq.x to compute the partially screened Coulomb potential and the parameters of the effective Hamiltonian.
Download the following files to your working directory:
[ ]:
%%bash
wget -N -q https://west-code.org/doc/training/nv_diamond_215/qdet/wstat.in
wget -N -q https://west-code.org/doc/training/nv_diamond_215/qdet/wfreq.in
We can have a look at the input files:
[5]:
%%bash
cat wstat.in
input_west:
outdir: ./
wstat_control:
wstat_calculation: S
n_pdep_eigen: 2586
The input keyword n_pdep_eigen controls the accuracy of the eigendecomposition of the static dielectric screening and should be carefully tested for convergence.
[6]:
%%bash
cat wfreq.in
input_west:
outdir: ./
wstat_control:
wstat_calculation: S
n_pdep_eigen: 2586
wfreq_control:
wfreq_calculation: XWGQH
macropol_calculation: C
l_enable_off_diagonal: True
n_pdep_eigen_to_use: 2586
qp_bandrange: [414, 432]
The QDET calculation is triggered by the input keyword wfreq_calculation: H (for effective Hamiltonian). The KS orbitals that define the active space are selected with qp_bandrange (in our case bands 414 to 432, corresponding to the defect orbitals and all valence bands lying within 2 eV below the VBM). It is mandatory to set l_enable_off_diagonal: true.
We run wstat.x, then wfreq.x.
[ ]:
%%bash
mpirun -n 4 wstat.x -i wstat.in > wstat.out
mpirun -n 4 wfreq.x -i wfreq.in > wfreq.out
The parameters of the effective Hamiltonian are stored in a file named west.wfreq.save/wfreq.json. If the reader does NOT have the computational resources to run the calculation, the file needed for the next step can be downloaded as:
[ ]:
%%bash
mkdir -p west.wfreq.save
wget -N -q https://west-code.org/doc/training/nv_diamond_215/qdet/wfreq.json -O west.wfreq.save/wfreq.json
4. Diagonalize QDET effective Hamiltonian
The effective Hamiltonian is diagonalized using the WESTpy Python package.
[7]:
from westpy.qdet import QDETResult
effective_hamiltonian = QDETResult(filename="west.wfreq.save/wfreq.json")
# Diagonalize Hamiltonian using FCI
solution = effective_hamiltonian.solve()
_ _ _____ _____ _____
| | | | ___/ ___|_ _|
| | | | |__ \ `--. | |_ __ _ _
| |/\| | __| `--. \ | | '_ \| | | |
\ /\ / |___/\__/ / | | |_) | |_| |
\/ \/\____/\____/ \_/ .__/ \__, |
| | __/ |
|_| |___/
WEST version : 6.2.1
Today : 2026-02-11 17:31:04.933041
===============================================================
Diagonalizing QDET effective Hamiltonian...
nspin: 1
occupations: [[2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 1. 1.]]
solver: FCI
===============================================================
| diag[1RDM - 1RDM(GS)] | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| E [eV] | char | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | ... | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | |
| 0 | 0.000 | 3- | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | ... | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| 1 | 0.487 | 1- | -0.000 | 0.001 | 0.000 | 0.000 | 0.000 | -0.000 | -0.000 | -0.000 | ... | -0.000 | 0.000 | 0.000 | -0.013 | -0.008 | 0.002 | 0.001 | -0.082 | -0.000 | 0.100 |
| 2 | 0.488 | 1- | -0.000 | 0.000 | 0.001 | 0.000 | 0.000 | -0.000 | 0.000 | -0.000 | ... | -0.000 | 0.000 | 0.000 | -0.013 | -0.008 | 0.001 | 0.002 | -0.082 | 0.101 | -0.001 |
| 3 | 1.408 | 1- | -0.000 | 0.002 | 0.002 | 0.000 | 0.000 | -0.000 | -0.000 | 0.000 | ... | 0.000 | 0.000 | 0.000 | -0.023 | -0.011 | 0.003 | 0.003 | -0.086 | 0.054 | 0.055 |
| 4 | 2.051 | 3- | -0.003 | 0.000 | 0.003 | 0.000 | -0.000 | 0.000 | 0.000 | 0.000 | ... | 0.000 | 0.000 | 0.000 | -0.035 | -0.063 | 0.000 | 0.007 | -0.898 | 0.989 | 0.000 |
| 5 | 2.051 | 3- | -0.003 | 0.003 | 0.000 | -0.000 | 0.000 | 0.000 | 0.000 | -0.000 | ... | 0.000 | 0.000 | 0.000 | -0.035 | -0.063 | 0.007 | 0.000 | -0.898 | 0.000 | 0.989 |
| 6 | 3.239 | 1- | -0.007 | 0.001 | 0.003 | 0.000 | 0.000 | -0.000 | -0.000 | -0.000 | ... | 0.000 | 0.000 | -0.000 | -0.013 | -0.026 | 0.002 | 0.007 | -0.871 | 0.907 | -0.003 |
| 7 | 3.240 | 1- | -0.007 | 0.003 | 0.001 | 0.000 | 0.000 | -0.000 | -0.000 | -0.000 | ... | 0.000 | -0.000 | 0.000 | -0.013 | -0.026 | 0.007 | 0.002 | -0.871 | -0.003 | 0.907 |
| 8 | 4.872 | 1- | -0.005 | 0.003 | 0.003 | -0.000 | -0.000 | -0.000 | -0.000 | -0.000 | ... | 0.000 | -0.000 | -0.000 | -0.081 | -0.101 | 0.006 | 0.006 | -1.707 | 0.937 | 0.937 |
| 9 | 5.129 | 3- | -0.016 | 0.000 | 0.003 | 0.000 | 0.000 | 0.000 | 0.000 | -0.000 | ... | -0.000 | -0.000 | -0.000 | -0.880 | -0.048 | 0.000 | 0.007 | -0.056 | 0.989 | 0.001 |
10 rows × 21 columns
Calling the solve method of QDETResult invokes the FCI module in PySCF to diagonalize the QDET Hamiltonian. The vertical excitation energies (in eV), spin multiplicity, and electron occupation (relative to the ground state) are written to the screen.
The first excited state has an energy of 0.487 eV above the ground state, has spin multiplicity 2S + 1 = 1 (i.e., it is a singlet), and is two-fold degenerate, as the second excited state has the same energy. These are the \(^1\)E singlet excited states of the NV\(^-\) center. The next excited state at 1.408 eV is the \(^1\)A\(_1\) singlet excited state. The next pair of excited states at 2.051 eV are the \(^3\)E triplet excited states.
The symmetry of the excited states can be automatically identified using the point symmetry of the defect. In order to perform the symmetry analysis, we use westpp.x to write the KS wavefunctions to cube files. Create the input file westpp.in:
[8]:
import yaml
d = {}
d["westpp_control"] = {}
d["westpp_control"]["westpp_calculation"] = "W"
d["westpp_control"]["westpp_range"] = [1, 600]
d["westpp_control"]["westpp_format"] = "C"
d["westpp_control"]["westpp_sign"] = True
with open("westpp.in", "w") as f:
yaml.dump(d, f, sort_keys=False)
[9]:
%%bash
cat westpp.in
westpp_control:
westpp_calculation: W
westpp_range:
- 1
- 600
westpp_format: C
westpp_sign: true
We run westpp.x.
[ ]:
%%bash
mpirun -n 4 westpp.x -i westpp.in > westpp.out
The cube files of the wavefunctions are stored in a folder named west.westpp.save. The files are large and therefore not provided for readers who do not have the computational resources to run the calculations.
Now we define the point group, characterized by:
a set of symmetry operations (identity, reflection, and rotation operations)
a corresponding character table
[10]:
import numpy as np
from westpy.qdet.symm import PointGroup, PointGroupOperation, PointGroupRotation, PointGroupReflection
sq3 = np.sqrt(3)
origin = np.array([0, 0, 0])
point_group = PointGroup(
name="C3v",
operations={
"E": PointGroupOperation(T=np.eye(4)),
"C3_1": PointGroupRotation(rotvec=2 * np.pi / 3 * np.array([1 / sq3, 1 / sq3, 1 / sq3]), origin=origin),
"C3_2": PointGroupRotation(rotvec=4 * np.pi / 3 * np.array([1 / sq3, 1 / sq3, 1 / sq3]), origin=origin),
"Cv_1": PointGroupReflection(normal=(1, -1, 0), origin=origin),
"Cv_2": PointGroupReflection(normal=(0, -1, 1), origin=origin),
"Cv_3": PointGroupReflection(normal=(-1, 0, 1), origin=origin),
},
ctable={
"A1": [1, 1, 1, 1, 1, 1],
"A2": [1, 1, 1, -1, -1, -1],
"E": [2, -1, -1, 0, 0, 0]},
)
To add point group analysis to QDET, we pass the point group object defined above to the Hamiltonian object. Additionally, we provide the list of KS wavefunctions in cube files.
The code will apply the symmetry operations to the wavefunctions and determine the character of the wavefunctions. After the diagonalization of the effective Hamiltonian, the character of the many-body states can then be inferred from the character of the wavefunctions.
[11]:
from westpy.qdet import QDETResult
# List of cube files for the wavefunctions
qp_bands = list(range(414, 433))
wfc_names = [f"west.westpp.save/wfcK000001B{ib:06d}.cube" for ib in qp_bands]
effective_hamiltonian = QDETResult(filename="west.wfreq.save/wfreq.json", point_group=point_group, wfct_filenames=wfc_names)
# Diagonalize Hamiltonian using FCI
solution = effective_hamiltonian.solve()
PointGroupRep: rep matrices are orthogonal
Irrep of orbitals: ['A1(1.00)', 'E(1.00)', 'E(1.00)', 'E(1.00)', 'E(1.00)', 'A2(1.00)', 'A2(1.00)', 'E(1.00)', 'E(1.00)', 'A2(1.00)', 'E(1.00)', 'E(1.00)', 'A1(1.00)', 'A1(1.00)', 'E(1.00)', 'E(1.00)', 'A1(1.00)', 'E(1.00)', 'E(1.00)']
Solutions are projected onto irreps of C3v group
===============================================================
Diagonalizing QDET effective Hamiltonian...
nspin: 1
occupations: [[2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 1. 1.]]
solver: FCI
===============================================================
| diag[1RDM - 1RDM(GS)] | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| E [eV] | char | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | ... | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | |
| 0 | 0.000 | 3A2 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | ... | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
| 1 | 0.487 | 1E | -0.000 | 0.001 | 0.000 | 0.000 | 0.000 | -0.000 | -0.000 | -0.000 | ... | -0.000 | 0.000 | 0.000 | -0.013 | -0.008 | 0.002 | 0.001 | -0.082 | -0.000 | 0.100 |
| 2 | 0.488 | 1E | -0.000 | 0.000 | 0.001 | 0.000 | 0.000 | -0.000 | 0.000 | -0.000 | ... | -0.000 | 0.000 | 0.000 | -0.013 | -0.008 | 0.001 | 0.002 | -0.082 | 0.101 | -0.001 |
| 3 | 1.408 | 1A1 | -0.000 | 0.002 | 0.002 | 0.000 | 0.000 | -0.000 | -0.000 | 0.000 | ... | 0.000 | 0.000 | 0.000 | -0.023 | -0.011 | 0.003 | 0.003 | -0.086 | 0.054 | 0.055 |
| 4 | 2.051 | 3E | -0.003 | 0.000 | 0.003 | 0.000 | -0.000 | 0.000 | 0.000 | 0.000 | ... | 0.000 | 0.000 | 0.000 | -0.035 | -0.063 | 0.000 | 0.007 | -0.898 | 0.989 | 0.000 |
| 5 | 2.051 | 3E | -0.003 | 0.003 | 0.000 | -0.000 | 0.000 | 0.000 | 0.000 | -0.000 | ... | 0.000 | 0.000 | 0.000 | -0.035 | -0.063 | 0.007 | 0.000 | -0.898 | 0.000 | 0.989 |
| 6 | 3.239 | 1E | -0.007 | 0.001 | 0.003 | 0.000 | 0.000 | -0.000 | -0.000 | -0.000 | ... | 0.000 | 0.000 | -0.000 | -0.013 | -0.026 | 0.002 | 0.007 | -0.871 | 0.907 | -0.003 |
| 7 | 3.240 | 1E | -0.007 | 0.003 | 0.001 | 0.000 | 0.000 | -0.000 | -0.000 | -0.000 | ... | 0.000 | -0.000 | 0.000 | -0.013 | -0.026 | 0.007 | 0.002 | -0.871 | -0.003 | 0.907 |
| 8 | 4.872 | 1A1 | -0.005 | 0.003 | 0.003 | -0.000 | -0.000 | -0.000 | -0.000 | -0.000 | ... | 0.000 | -0.000 | -0.000 | -0.081 | -0.101 | 0.006 | 0.006 | -1.707 | 0.937 | 0.937 |
| 9 | 5.129 | 3E | -0.016 | 0.000 | 0.003 | 0.000 | 0.000 | 0.000 | 0.000 | -0.000 | ... | -0.000 | -0.000 | -0.000 | -0.880 | -0.048 | 0.000 | 0.007 | -0.056 | 0.989 | 0.001 |
10 rows × 21 columns
The symmetry of the ground state \(^3\)A\(_2\), singlet excited states \(^1\)E and \(^1\)A\(_1\), and triplet excited states \(^3\)E are identified correctly.