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

Remove dangling bonds with mincoordination #131

Merged
merged 3 commits into from
Nov 9, 2020
Merged

Conversation

pablosanjose
Copy link
Owner

@pablosanjose pablosanjose commented Nov 9, 2020

Closes #130

Introduces a new mincoordination kwarg in unitcell(::Hamiltonian,...). This removes sites until all remaining have at least mincoordination neighbors. The way this works is we iterate over the mask of the supercell to eliminate any sites that have too few neighbors. This pass is repeated until no more sites are removed. As the neighbor searching reused a large part of non-trivial hamiltonian unitcell code, I had to refactor the latter so that functionality could be shared.

Example from tests:

h = LP.honeycomb() |> hamiltonian(hopping(1)) |> unitcell(10, region = !RP.circle(2, (0,8)))
h´ = h |> unitcell(1, mincoordination = 2)
vlplot(h, size = 300, maxdiameter = 6)
vlplot(h´, size = 300, maxdiameter = 6)

Screen Shot 2020-11-09 at 21 18 48

Screen Shot 2020-11-09 at 21 18 59

mincoordination

fix periodic case
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.

Avoiding dangling bonds
1 participant