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

Boolean regions #129

Merged
merged 4 commits into from
Nov 5, 2020
Merged

Boolean regions #129

merged 4 commits into from
Nov 5, 2020

Conversation

pablosanjose
Copy link
Owner

@pablosanjose pablosanjose commented Nov 5, 2020

Closes #121

This introduces boolean operators &, I, xor and ! for RegionPresets.Regions

This also fixes a little bug in supercell that could lead to empty lattices when searching for sites did not immediately turn up a candidate.

It also introduces convenience aliases LP for LatticePresets, HP for HamiltonianPresets and RP for RegionPresets

Usage example

h = LatticePresets.honeycomb() |> hamiltonian(hopping(-1)) |> 
    unitcell(region = xor(RP.circle(10), RP.circle(6, (3,0)), RP.circle(6, (-3,0))))

Screen Shot 2020-11-05 at 09 54 03

@pablosanjose pablosanjose mentioned this pull request Nov 5, 2020
@codecov-io
Copy link

codecov-io commented Nov 5, 2020

Codecov Report

Merging #129 into master will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #129      +/-   ##
==========================================
+ Coverage   59.98%   60.04%   +0.05%     
==========================================
  Files          16       16              
  Lines        2804     2808       +4     
==========================================
+ Hits         1682     1686       +4     
  Misses       1122     1122              
Impacted Files Coverage Δ
src/Quantica.jl 100.00% <ø> (ø)
src/lattice.jl 81.81% <100.00%> (ø)
src/presets.jl 36.84% <100.00%> (+4.76%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eed5544...0a33155. Read the comment docs.

@pablosanjose pablosanjose merged commit e9c7c51 into master Nov 5, 2020
@pablosanjose pablosanjose deleted the combineregs branch November 5, 2020 17:52
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.

Combine Regions
2 participants