Skip to content
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

Fix boundary conditions #106

Merged
merged 7 commits into from
Dec 9, 2021

Conversation

timcallow
Copy link
Contributor

The matrix diagonalization routine which is used to compute the KS orbitals and their eigenvalues does not give exactly the boundary conditions desired.

  • For the dirichlet condition, it fixes the value of the eigenfunctions to zero at the ngrid +1 grid point; we want them equal to zero at the ngrid grid point
  • For the neumann condition, it correctly sets the derivative to zero at the ngrid point, but is unable to resolve the eigenfunction at that point and returns a junk value

Although these only produced very small numerical errors, it is better to fix them. Their behaviour might also be more critical when we consider higher-order properties and more advanced features.

This PR introduces several fixes to ensure the correct behaviour of both bcs. Notably, the dirichlet grid is modified to first ensure the zero occurs at the ngrid point. For both bcs, the final point is determined via manual integration of the numerov formula.

@DanielKotik DanielKotik merged commit eb32c10 into atomec-project:develop Dec 9, 2021
@timcallow timcallow deleted the boundary_conds_fix branch December 9, 2021 11:01
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.

None yet

2 participants