# How to confirm the XPS simulation in AIIDA-QE tutorial?

**URL:** <https://aiida.discourse.group/t/how-to-confirm-the-xps-simulation-in-aiida-qe-tutorial/520>\
**Category:** New to AiiDA\
**Tags:** plugin\
**Created:** [January 11, 2025, 10:10am UTC](https://aiida.discourse.group/t/how-to-confirm-the-xps-simulation-in-aiida-qe-tutorial/520 "2025-01-11T10:10:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hlim12](https://avatars.discourse-cdn.com/v4/letter/h/cc9497/32.png) [@hlim12](https://aiida.discourse.group/u/hlim12)\
**Post date:** [January 11, 2025, 10:10am UTC](https://aiida.discourse.group/t/how-to-confirm-the-xps-simulation-in-aiida-qe-tutorial/520/1 "2025-01-11T10:10:16Z")

</div>

Dear AiiDA developers and users. I’m interested in running the XPS simulation using AiiDA-Quantum Espresso calculation. I followed the tutorial in here: [How to calculate XPS spectra — Quantum ESPRESSO App v24.10.0a4-dev documentation](https://aiidalab-qe.readthedocs.io/howto/xps.html). But before using AiiDA further, I want to confirm on how to get the result for the ETFA XPS simulation as shown in the tutorial.

I did the calculation manually without AiiDA and try to compare the results. However, my calculation of core level shift are very different with the one shown in the tutorial.

Below is the DFT energy of excited C element (from site 0 to site 3).

```auto
#exc-0/espresso.pwo:! total energy = -312.61997023 Ry
#exc-1/espresso.pwo:! total energy = -312.96008875 Ry
#exc-2/espresso.pwo:! total energy = -312.90152087 Ry
#exc-3/espresso.pwo:! total energy = -313.00777866 Ry

```

Converting to eV, and substracting with the minimum value give me:

```auto
peak at site 0: 5.27640245
peak at site 1: 0.64885428
peak at site2: 1.44571087
peak at site3: 0.    

```

It’s very different from the tutorial result.

 ![image](https://global.discourse-cdn.com/free1/uploads/aiida/original/1X/ec05150c5e7f30a7a2b1b4c46bcf3e48281f59db.png)

Can anyone explain how the XPS calculated in the AiiDA?

Below is the QE input script, for instance, to calculate the DFT energy of Carbon atom at site 3 of ETFA molecule.

```auto
&CONTROL
   calculation = 'scf'
   tprnfor = .true.
   outdir = './'
/
&SYSTEM
   nbnd = 42
   ecutwfc = 60.0
   ecutrho = 480.0
   occupations = 'smearing'
   degauss = 0.01
   smearing = 'mp'
   input_dft = 'pbe'
   ntyp = 5
   nat = 14
   ibrav = 0
/
&ELECTRONS
   conv_thr = 1e-08
   mixing_beta = 0.1
   diagonalization = 'david'
/
&IONS
/
&CELL
/

ATOMIC_SPECIES
C 12.011 C.pbe-n-kjgipaw_psl.1.0.0.UPF
Cs 12.011 C.star1s.pbe-n-kjgipaw_psl.1.0.0.UPF
F 18.998403163 F.pbe-n-rrkjus_psl.1.0.0.UPF
O 15.999 O.pbe-n-kjpaw_psl.0.1.UPF
H 1.008 H.pbe-rrkjus_psl.1.0.0.UPF

K_POINTS gamma

CELL_PARAMETERS angstrom
12.30241974000000 0.00000000000000 0.00000000000000
0.00000000000000 14.64017572000000 0.00000000000000
0.00000000000000 0.00000000000000 15.46505195000000

ATOMIC_POSITIONS angstrom
C 6.2189937000 8.3983226900 5.5567933700
C 6.3442198800 8.4203581700 7.1119071900
C 6.3462649300 7.0415223800 9.0438014700
Cs 6.2420992100 5.5697645900 9.3783997600
F 6.3623351200 9.6401757200 5.0534170800
F 7.1712495900 7.6003106200 5.0000000000
F 5.0000000000 7.9227956700 5.1774266900
O 6.5009882400 9.4360605700 7.7509590400
O 6.2466305600 7.1689095300 7.5819583800
H 7.3024197400 7.4805570500 9.3529809200
H 5.5377544500 7.6355094900 9.4867992600
H 5.2850603900 5.1549876400 9.0435207100
H 7.0537106000 5.0000000000 8.9128193100
H 6.3108719400 5.4401213400 10.4650519500

```

---

<div class="post-metadata">

**Author:** ![Xing](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/xing/32/10_2.png) [@Xing](https://aiida.discourse.group/u/Xing)\
**Post date:** [January 11, 2025, 10:37am UTC](https://aiida.discourse.group/t/how-to-confirm-the-xps-simulation-in-aiida-qe-tutorial/520/2 "2025-01-11T10:37:59Z")

</div>

A short answer, you can find all details of the xps workflow inside this WorkChain: [aiida-quantumespresso/src/aiida\_quantumespresso/workflows/xps.py at main · aiidateam/aiida-quantumespresso · GitHub](https://github.com/aiidateam/aiida-quantumespresso/blob/main/src/aiida_quantumespresso/workflows/xps.py)

I will write another answer when I have my computer.

---

<div class="post-metadata">

**Author:** ![Xing](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/xing/32/10_2.png) [@Xing](https://aiida.discourse.group/u/Xing)\
**Post date:** [January 11, 2025, 6:29pm UTC](https://aiida.discourse.group/t/how-to-confirm-the-xps-simulation-in-aiida-qe-tutorial/520/3 "2025-01-11T18:29:13Z")

</div>

Hi @hlim12 , the discrepancy likely arises from the different core-hole treatments used between your input and the AiiDA WorkChain for the ETFA molecule.

There are two main approaches for core-hole treatments:

- excited core-hole (used in your input): the excited core electron is promoted to the HUMO (or the Fermi level for metallic systems). the system remains neutral. the binding energy is referenced to the HUMO. This is commonly applied to extended solid systems.

- full core-hole (or half core-hole): the core electron is effectively moved to the vacuum, resulting in a +1 charged system. The binding energy is referenced to the vacuum energy. This is commonly used for isolated molecular systems, as it aligns with experimental conditions.

To test the full core-hole treatment, you can modify your input file as follows:

```plaintext
tot_charge = 1
assume_isolated = 'mt'

```

Let me know if this resolves the issue or if you need further clarification!

---

<div class="post-metadata">

**Author:** ![hlim12](https://avatars.discourse-cdn.com/v4/letter/h/cc9497/32.png) [@hlim12](https://aiida.discourse.group/u/hlim12)\
**Post date:** [January 12, 2025, 7:31am UTC](https://aiida.discourse.group/t/how-to-confirm-the-xps-simulation-in-aiida-qe-tutorial/520/4 "2025-01-12T07:31:59Z")

</div>

Thanks so much for the kind reply!  
I confirm that I can reproduce the core-level shift perfectly.  
However, I have follow up questions on the use of this plugin.

1. We need to specify the pseudopotentials both in `Advanced` and `XPS` tab. Should they be consistent? Or does the work chain already consider this?
2. How to determine the treatment for core-hole? For instance, I want to use it for calculating XPS of adsorbates on surface. What should I change in the QE-app? Is choosing between `crystal` and `molecule` sufficient?
3. How to get exact binding energy? I tried to calculate the energy differences between ground state and excited states, but it does not match the BE tutorial. Do I need to upload some references value?
4. When I run the plugin, it seems it runs parallel calculations. Is it possible to control how many calculations run at a time?

I’m sorry for asking many questions. I really appreciate your help…

---

<div class="post-metadata">

**Author:** ![Xing](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/xing/32/10_2.png) [@Xing](https://aiida.discourse.group/u/Xing)\
**Post date:** [January 12, 2025, 8:06am UTC](https://aiida.discourse.group/t/how-to-confirm-the-xps-simulation-in-aiida-qe-tutorial/520/5 "2025-01-12T08:06:42Z")

</div>

Glad to hear that you reproduced the the core-level shift.

1. yes, you need to specify both pseudopotentials in `Advanced` and `XPS`. They should be consistent. In the future, we plan to implement a feature that raises an error if the pseudopotentials are inconsistent.
2. since you have a 2d surface, so you have to use the `crystal` option. But this may give the wrong result for the adsorbates. I would suggest you try the `crystal` for a simple test system. At the same time, you can run another calculation manually: full core-hole for an extended system (without `assume_isolated`). And compare both with the experimental result. I will also do some test calculations when I have time and improve the app by adding more options.
3. for the absolute binding energy, there are two corrections: 1) core energy correction (a constant value for each core-hole pseudo), 2) offset-correction energy (fitting from experimental value), you can check the `WorkChain` and find details. Please refer to this [paper](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.94.041112) for the offset-correction energy. The data used in the app is in this [repo](https://github.com/superstar54/xps-data/blob/main/pseudo_demo/pseudo_demo_pbe/datas.py)
4. to limit the number of running job, please refer to this [post](https://aiida.discourse.group/t/run-only-one-job-on-local-machine/459)

We would greatly appreciate your feedback, especially on the second point, as it will help us refine the app to support more use cases effectively.

---

<div class="post-metadata">

**Author:** ![hlim12](https://avatars.discourse-cdn.com/v4/letter/h/cc9497/32.png) [@hlim12](https://aiida.discourse.group/u/hlim12)\
**Post date:** [January 15, 2025, 12:21pm UTC](https://aiida.discourse.group/t/how-to-confirm-the-xps-simulation-in-aiida-qe-tutorial/520/6 "2025-01-15T12:21:59Z")

</div>

Thanks so much for the reply!.  
I found that one alternative is to use the surface cluster to make a kind of isolated system. However the binding energy depends on the size of the cluster: too small cluster will result in the poor screening.  
I based my benchmark on this paper: [Core electron binding energies of adsorbates on Cu(111) from first-principles calculations - Physical Chemistry Chemical Physics (RSC Publishing)](https://pubs.rsc.org/en/content/articlelanding/2018/cp/c8cp04955f).

This kind of calculation is quite heavy (at least for me) since it requires huge number of atom. Now I’m not sure the plain plane-wave calculations are suitable for this task…

I will do more research on this…

Thanks again for your kind answers…
