Giter Site home page Giter Site logo

brillouin.jl's Introduction

Brillouin

Stable Dev Build Status Coverage

Brillouin.jl is a Julia package that provides tools to generate and visualize k-space paths and Brillouin zones for eigenvalue problems in crystals. The k-path functionalities are inspired by the Python SeeK-path package (and return equivalent paths in 3D).

Examples

Wigner-Seitz cells & Brillouin zones

To generate the Brillouin zone of a crystal in space group 147 (Hermann-Mauguin symbol, P-3; Bravais type, hP), we first define its reciprocal basis Gs (e.g., using Bravais.jl) and then call Brillouin's wignerseitz:

julia> using Brillouin, 
julia> using Bravais: reciprocalbasis
julia> Rs = ([1.0, 0.0, 0.0], [-0.5, sqrt(3)/2, 0.0],   [0, 0, 1.25]) # direct basis for space group 147
julia> Gs = reciprocalbasis(Rs) # using Bravais to create the reciprocal basis
julia> cell = wignerseitz(Gs)   # construct associated Brillouin zone
Cell{3} (8 faces, 12 vertices):
  verts: [0.666667, -0.333333, -0.5]
         [0.333333, -0.666667, -0.5]
         [0.666667, -0.333333, 0.5]
         [0.333333, 0.333333, 0.5]
         [0.333333, 0.333333, -0.5]
         [0.333333, -0.666667, 0.5]
         [-0.333333, 0.666667, -0.5]
         [-0.666667, 0.333333, -0.5]
         [-0.333333, -0.333333, -0.5]
         [-0.333333, -0.333333, 0.5]
         [-0.666667, 0.333333, 0.5]
         [-0.333333, 0.666667, 0.5]
  faces: [5, 4, 3, 1]
         [8, 9, 10, 11]
         [2, 1, 3, 6]
         [2, 6, 10, 9]
         [7, 5, 1, 2, 9, 8]
         [4, 12, 11, 10, 6, 3]
         [4, 5, 7, 12]
         [11, 12, 7, 8]
  basis: [6.283185, 3.627599, -0.0]
         [0.0, 7.255197, 0.0]
         [0.0, -0.0, 5.026548]

The returned vertices are in the coordinates of the reciprocal basis (to convert, see cartesianize(!)); this is the default behavior in Brillouin. The basis is accessible with basis(cell).

The Brillouin zone can be plotted using e.g. PlotlyJS.jl (or 3D-capable backends of Makie.jl such as GLMakie.jl):

julia> using PlotlyJS
julia> plot(cell)

Examples of interactive visualizations are included in the documentation.

Minimal k-paths in the irreducible Brillouin zone

Given a symmetry setting and a lattice, specified by a space group number sgnum and a conventional direct basis Rs (respecting the conventions of the International Tables of Crystallography, Volume A), irrfbz_path will return a "minimal" k-path in the irreducible Brillouin zone. E.g.,

julia> sgnum = 147
julia> kp = irrfbz_path(sgnum, Rs)
KPath{3} (7 points, 3 paths, 13 points in paths):
 points: :M => [0.5, 0.0, 0.0]
         :A => [0.0, 0.0, 0.5]
         :H => [0.333333, 0.333333, 0.5]
         :K => [0.333333, 0.333333, 0.0]
          => [0.0, 0.0, 0.0]
         :L => [0.5, 0.0, 0.5]
         :H₂ => [0.333333, 0.333333, -0.5]
  paths: [, :M, :K, , :A, :L, :H, :A]
         [:L, :M]
         [:H, :K, :H₂]
  basis: [6.283185, 3.627599, -0.0]
         [0.0, 7.255197, 0.0]
         [0.0, -0.0, 5.026548]

Returned k-vector coordinates are referred to the basis of the primitive reciprocal cell (in the CDML setting). The associated transformation matrix between conventional and primitive bases can be obtained via Bravais.jl's primitivebasismatrix.

The resulting object kp can be interpolated, using either interpolate(kp, N) or splice(kp, N) which return a KPathInterpolant iterable whose values interpolate the connected paths (and enable convenient plotting of band structure diagrams). See also visualization examples in documentation.

brillouin.jl's People

Contributors

thchr avatar jaemolihm avatar samuelkim314 avatar mfherbst avatar github-actions[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.