-
Notifications
You must be signed in to change notification settings - Fork 216
QDET demo #1327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
QDET demo #1327
Changes from 93 commits
a76b064
72f5c15
5d88aaf
85a3b23
28b8c19
89dc812
3a73910
419fa62
90d95a7
4d5caea
c7ce50d
f08c4ba
e336aac
4dcbdeb
1613232
e8c6d1d
c5ff142
906bb1a
4535791
bf9510e
9ac57d6
f8bf9c1
b42e5c3
09a667a
35a9252
c265bc2
ad24ae8
62b39fc
235eabc
3f55f6a
b450a8f
3a1bb7d
1e11481
8e17edc
cf6ea83
bd9d75d
c815f83
50cc18d
2797710
d284e67
45761aa
c253095
06d2c9d
1ec48a4
61248d3
325b8d9
8611fc5
8e0a329
5f03f8a
1944b4b
0e63e8f
79c0682
85a4a7f
f3eb553
fc9f82c
bb5300a
651d0d7
8513fb7
e715a9e
4d37287
d8aca40
22aa8b1
09b3229
75e8069
8c9ae12
d3e42a1
b413b3f
09330a9
4180612
463f862
4c334dd
a021fcd
e0c7464
5adff53
1f7988b
7d591cf
7ec48c7
ecf5a81
412c9ce
1d256d0
3ff97ad
5771176
da663ba
3770219
c291233
1ab2fdd
c2a43e0
96846b6
b0a1542
754c16b
071bb0e
6c40715
8912790
8b938b7
15d9121
0a3e69e
b7cd4d4
609bc56
3dbb5d6
27e4e43
b36499b
4bffcfe
9283b34
8f77dc6
7454077
dd44d3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,351 @@ | ||||||||||
| r"""Quantum Defect Embedding Theory (QDET) | ||||||||||
| ========================================= | ||||||||||
| Many interesting problems in quantum chemistry and materials science feature a strongly correlated | ||||||||||
| region embedded within a larger environment. Example of such systems include point defects in | ||||||||||
| materials [#Galli]_, active site of catalysts [#SJRLee]_ and surface phenomenon such as adsorption | ||||||||||
| [#Gagliardi]_. Such systems can be accurately simulated with **embedding theories**, which effectively | ||||||||||
| capture the strong electronic correlations in the active region with high accuracy, while accounting | ||||||||||
| for the environment in a more approximate manner. | ||||||||||
|
|
||||||||||
| In this demo, we show how to implement quantum defect embedding theory (QDET) [#Galli]_. This method | ||||||||||
| has been successfully applied to study systems such as defects in calcium oxide [#Galli]_ and to calculate | ||||||||||
| excitations of the negatively charged nitrogen-vacancy defect in diamond [#Galli2]_. QDET can be used to calculate ground states, | ||||||||||
| excited states, and dynamic properties of materials. These make QDET a powerful method for affordable quantum simulation | ||||||||||
| of materials. Another important advantage | ||||||||||
| of QDET is the compatibility of the method with quantum algorithms as we explain in the following | ||||||||||
| sections. | ||||||||||
|
|
||||||||||
| .. figure:: ../_static/demo_thumbnails/opengraph_demo_thumbnails/OGthumbnail_how_to_build_qdet_hamiltonian.png | ||||||||||
| :align: center | ||||||||||
| :width: 70% | ||||||||||
| :target: javascript:void(0) | ||||||||||
|
|
||||||||||
| """ | ||||||||||
|
|
||||||||||
| ############################################# | ||||||||||
| # The main component of a QDET simulation is to construct an effective Hamiltonian that describes | ||||||||||
| # the impurity subsystem and its interaction with the environment. In second quantization, the | ||||||||||
| # effective Hamiltonian can be represented in terms of electronic creation, :math:`a^{\dagger}`, and | ||||||||||
| # annihilation , :math:`a`, operators as | ||||||||||
| # | ||||||||||
| # .. math:: | ||||||||||
| # | ||||||||||
| # H^{eff} = \sum_{ij} t_{ij}^{eff}a_i^{\dagger}a_j + \frac{1}{2}\sum_{ijkl} v_{ijkl}^{eff}a_i^{\dagger}a_{j}^{\dagger}a_ka_l, | ||||||||||
| # | ||||||||||
| # where :math:`t_{ij}^{eff}` and :math:`v_{ijkl}^{eff}` represent the effective one-body and | ||||||||||
| # two-body integrals, respectively, and the indices :math:`ijkl` span over the orbitals inside the impurity. | ||||||||||
| # This Hamiltonian describes a simplified representation of the quantum system that is more | ||||||||||
| # computationally tractable, while properly capturing the essential physics of the problem. | ||||||||||
| # | ||||||||||
ddhawan11 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| # Implementation | ||||||||||
ddhawan11 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| # -------------- | ||||||||||
| # A QDET simulation typically starts by obtaining a meanfield approximation of the whole system | ||||||||||
ddhawan11 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
| # using efficient quantum chemistry methods such as density functional theory (DFT). These | ||||||||||
| # calculations provide a set of orbitals that are partitioned into **impurity** and **bath** orbitals. | ||||||||||
| # The effective Hamiltonian is constructed from the impurity orbitals and is subsequently solved | ||||||||||
| # by using either a high accuracy classical method or a quantum algorithm. Let's implement these | ||||||||||
| # steps for an example! | ||||||||||
| # | ||||||||||
| # Mean field calculations | ||||||||||
| # ^^^^^^^^^^^^^^^^^^^^^^^ | ||||||||||
| # We implement QDET to compute the excitation energies of a negatively charged nitrogen-vacancy | ||||||||||
| # defect in diamond [#Galli2]_. We use DFT to obtain a mean field description of the whole system. | ||||||||||
| # The DFT calculations are performed with the `QUANTUM ESPRESSO <https://www.quantum-espresso.org/>`_ | ||||||||||
| # package. This requires downloading pseudopotentials [#Modji]_ for each atomic species | ||||||||||
| # in the system from the QUANTUM ESPRESSO `database <https://www.quantum-espresso.org/pseudopotentials/>`_. | ||||||||||
| # To prepare our system, the necessary carbon and nitrogen pseudopotentials can be downloaded by executing | ||||||||||
| # the following commands through the terminal or command prompt: | ||||||||||
| # | ||||||||||
| # .. code-block:: bash | ||||||||||
| # | ||||||||||
| # 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 | ||||||||||
ddhawan11 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| # | ||||||||||
| # Next, we need to create the input file for running QUANTUM ESPRESSO. This contains | ||||||||||
| # information about the system and the DFT calculations. More details on how to construct the input | ||||||||||
| # file can be found in QUANTUM ESPRESSO `documentation <https://www.quantum-espresso.org/Doc/INPUT_PW.html>`_ | ||||||||||
ddhawan11 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
| # page. For the system taken here, the input file can be downloaded with | ||||||||||
| # | ||||||||||
| # .. code-block:: bash | ||||||||||
| # | ||||||||||
| # wget -N -q https://west-code.org/doc/training/nv_diamond_63/pw.in | ||||||||||
| # | ||||||||||
| # DFT calculations can now be initiated using the `pw.x` executable in `WEST`, taking `pw.in` as the input file | ||||||||||
| # and directing the output to `pw.out`. This process is parallelized across 2 cores using mpirun. | ||||||||||
|
Comment on lines
+73
to
+74
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| # | ||||||||||
| # .. code-block:: bash | ||||||||||
| # | ||||||||||
| # mpirun -n 2 pw.x -i pw.in > pw.out | ||||||||||
ddhawan11 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| # | ||||||||||
| # Identify the impurity | ||||||||||
| # ^^^^^^^^^^^^^^^^^^^^^ | ||||||||||
| # Once we have obtained the mean field description, we can identify our impurity by finding | ||||||||||
| # the states that are localized around the defect region in real space. To do that, we compute the | ||||||||||
| # localization factor :math:`L_n` for each state ``n``, defined as: | ||||||||||
| # | ||||||||||
| # .. math:: | ||||||||||
| # | ||||||||||
| # L_n = \int_{V \in \Omega} d^3 r |\Psi_n(r)|^2, | ||||||||||
| # | ||||||||||
| # where :math:`V` is the identified volume including the impurity within the supercell volume | ||||||||||
| # :math:`\Omega` and :math:`\Psi` is the wavefunction [#Galli2]_. We will use the | ||||||||||
| # `WEST <https://pubs.acs.org/doi/10.1021/ct500958p>`_ program to compute the localization factor. | ||||||||||
| # This requires the westpp.in input file, example for which is shown below. Here, we specify the | ||||||||||
ddhawan11 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
| # This requires the westpp.in input file, example for which is shown below. Here, we specify the | |
| # This requires the ``westpp.in`` input file, example for which is shown below. Here, we specify the |
ddhawan11 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # in atomic units as [x_start, x_end, y_start, y_end, z_start, z_end]. | |
| # in atomic units as ``[x_start, x_end, y_start, y_end, z_start, z_end]``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't render nicely.
ddhawan11 marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ddhawan11 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # The calculation can now be performed by running the westpp.x executable from WEST using mpirun to | |
| # The calculation can now be performed by running the ``westpp.x`` executable from WEST using mpirun to |
ddhawan11 marked this conversation as resolved.
Show resolved
Hide resolved
ddhawan11 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
ddhawan11 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # :code:`wfreq_calculation` keyword. We choose `XWGQH` to ensure the full workflow is executed, which computes | |
| # :code:`wfreq_calculation` keyword. We choose ``XWGQH`` to ensure the full workflow is executed, which computes |
ddhawan11 marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't render nicely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue here with rendering
ddhawan11 marked this conversation as resolved.
Show resolved
Hide resolved
ddhawan11 marked this conversation as resolved.
Show resolved
Hide resolved
ddhawan11 marked this conversation as resolved.
Show resolved
Hide resolved
ddhawan11 marked this conversation as resolved.
Show resolved
Hide resolved
ddhawan11 marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also check this block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue here as well
ddhawan11 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
ddhawan11 marked this conversation as resolved.
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same rendering issue.

Uh oh!
There was an error while loading. Please reload this page.