Giter VIP home page Giter VIP logo

Comments (1)

thchr avatar thchr commented on June 28, 2024

Here's some code for visualizing the 2D situation, with some additional points included.

function prep_bz_path(Rs)
    Gs = reciprocalbasis(Rs)
    cell = wignerseitz(Gs)
    kp = irrfbz_path(2, Rs)

    a, b = norm(Rs[1]), norm(Rs[2])
    cosβ = dot(Rs[1], Rs[2])/(a*b)
    sinβ = sin(acos(cosβ))
    Y = ((((1 + (b / a) * cosβ) / 2) / sinβ) / sinβ)
    N = (1 / 2 + (Y * a * cosβ) / b)
    pts = Dict(
         => [0, 0], 
        :B => [1/2, 0], 
        :Y => [0, 1/2,], 
        :A => [1/2, 1/2],
        # not included in path:
        :H => [1-N, -Y],
        :H₂ => [N, -1+Y],
        :H₄ => [-N, -Y],
        :H′ => [-1+N, Y],
        :H₂′ => [-N, 1-Y],
        :H₄′ => [N, Y],
        )

    merge!(kp.points, pts)
    return cell, kp
end

b = 1.0
β = π/2 + π/3
Rs = crystal(1.0, b, β)
cell, kp = prep_bz_path(Rs)

f = Figure();
ax = Axis(f[1,1]; aspect=1.0)

plot!(ax, cell)
plot!(ax, kp)
f

The additional points e.g., don't match when β<π/2 (but if b≠1 it also fails in other cases).

When it works, it looks like this (β = π/2 + π/3):
image

When it doesn't work, it looks like this (β = π/2 - π/7):
image

The situation can be explored a bit better by tuning a parameter continuously and following the BZ shape and points: (this produces a bunch of REPL errors for me, but still works, somehow)

sl_β = Slider(f[1, 2], range = range(0.0+π/10, π-π/10, 100), startvalue = β, horizontal = false)
on(sl_β.value) do β
    Rs = crystal(1.0, b, β)
    cell, kp = prep_bz_path(Rs)
    empty!(ax)
    plot!(ax, cell)
    plot!(ax, kp)
end
f

In general, it looks quite painful: many cases to control for. Probably related to Rs no longer being a "minimal" choice of the basis.

from brillouin.jl.

Related Issues (15)

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.