Comments (5)
@jaemolihm I added this in 933853e with the name reduce_to_wignerseitz
, which takes a point and a basis as arguments.
Let me know if you feel another name is more suitable: otherwise I'll probably tag a new version in a day or so.
Here's a quick visualization of the results:
Unreduced points | Reduced points |
---|---|
The implementation itself is quite simple[edit: a little tricky]: first, reduce the input point to the "rectangular" reduced unit cell with coordinates in [-1/2, 1/2)
; next, check all immediately neighboring point to see if there's a point with smaller norm in cartesian space; [edit: then do that recursively until convergence]; finally, return point with minimum norm.
reduce_to_symmetric_unitcell(x::Real) = mod(x + 1//2, 1) - 1//2
reduce_to_symmetric_unitcell(v::AbstractVector{<:Real}) = reduce_to_symmetric_unitcell.(v)
function reduce_to_wignerseitz(v::StaticVector{D, <:Real}, Vs::BasisLike{D}) where D
# reduce `v` to "rectangular" unit cell with coordinates in [-1/2, 1/2)
v₀ = reduce_to_symmetric_unitcell(v)
v₀ᶜ = cartesianize(v₀, Vs)
d₀ = norm(v₀ᶜ)
# check whether `v₀` has the smallest norm of all adjacent equivalent points; if not,
# we initiate a recursive search the new possible minimum until convergence
return search_shortest_norm_among_neighbors_recursive(v₀, d₀, Vs)
end
function search_shortest_norm_among_neighbors_recursive(
v₀::StaticVector{D, <:Real}, d₀::Real, Vs::BasisLike{D}) where D
for I in CartesianIndices(ntuple(_->-1:1, Val(D)))
iszero(I) && continue
v′ = v₀ .+ Tuple(I)
v′ᶜ = cartesianize(v′ᶜ, Vs)
d′ = norm(v′ᶜ)
if d′ < d₀
return search_shortest_norm_among_neighbors_recursive(v′, d′, Vs)
end
end
return v₀
end
I'm sure there is a faster way, but this doesn't seem likely to occur in performance sensitive contexts.
Edit 2: If a faster version of this is ever needed, I think the best way forward would be to define a function is_reduced_in_wingerseitz
that performs an inclusion test using the convex hull structure of a provided Wigner-Seitz cell, e.g. via its facets normal vectors & origins (as here) and then use that to test whether the current candidate is actually already the right one before searching for alternatives.
from brillouin.jl.
Thanks a lot for this feature! The visualization is also very nice 😄 The name reduce_to_wignerseitz
seems adequate to me.
from brillouin.jl.
Can't you just convert to reduced coordinates, use modulo and then convert back?
from brillouin.jl.
Hmm, that would just transform the point back to the "cubic" (reduced) unit cell though, not necessarily the associated Wigner-Seitz cell - right?
There is indeed a function in SymmetryReduceBZ: seems it first reduces to the "cubic" (reduced coordinates) unit cell and then searches through the immediately neighboring points for whichever one has the shortest Cartesian norm. That seems sound.
from brillouin.jl.
Closed by 933853e
from brillouin.jl.
Related Issues (15)
- TagBot trigger issue HOT 29
- Plot symbols like high symmetry points HOT 4
- Does it really require Julia v1.5 to install? HOT 7
- latticize!(kp::KPath{D}, Gs::BasisLike{D}) not implemented HOT 2
- high-symmetry k path for arbitrary lattice HOT 15
- Using Brillouin assumes scipy is installed if system python is used HOT 3
- Illegal instruction error HOT 33
- Make PyCall an optional dependency HOT 9
- A request to update dependency `Spglib.jl` to the latest version HOT 12
- Use artifacts system for data generated during build stage HOT 1
- Should paths for plane group 2 include parts of the BZ boundary? HOT 1
- Make basis choices in `irrfbz_path` and `wignerseitz` agree
- Implement Munro et al. paths?
- Use RelocatableFolders.jl for referencing data files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brillouin.jl.