Skip to content

Conversation

@ahxbcn
Copy link
Contributor

@ahxbcn ahxbcn commented Oct 16, 2025

Dipole correction is allowed in the tool to calculate work function for asymmetric slabs.
If dipole correction is used, the plot of averaged electrostatic potential will have 2 plateaus and there will be two work functions for 2 surfaces of the slab respectively. Two work functions are calculated in this case, and the key of returned dict of abacus_cal_work_function is changed. The key work_function is changed to work_function_results, and the value of it is a list of dict, where each dict contains 3 keys:

  • 'work_function': calculated work function
  • 'plateau_start_fractional': Fractional coordinate of start of the identified plateau in the given vacuum direction
  • 'plateau_end_fractional': Fractional coordinate of end of the identified plateau in the given vacuum direction

@ahxbcn
Copy link
Contributor Author

ahxbcn commented Oct 17, 2025

Update: add a paremeter dipole_correction to abacus_cal_work_function, which determines whether to use dipole correction along the given vacuum direction.

@ahxbcn
Copy link
Contributor Author

ahxbcn commented Oct 20, 2025

Update: ABACUS can find the vacuum region in the structure automatically using positions along efield_dir. The implementation is in https://github.com/deepmodeling/abacus-develop/blob/be120f114df564662f3423e34fccb9e7f6c5d828/source/module_elecstate/potentials/efield.cpp#L323. So there's no need to find the vacuum region in this tool.

@pxlxingliang pxlxingliang merged commit b58f37d into deepmodeling:develop Oct 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants