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

documentation: add example of non-orthogonal lattice #23

Open
sp94 opened this issue May 21, 2021 · 2 comments
Open

documentation: add example of non-orthogonal lattice #23

sp94 opened this issue May 21, 2021 · 2 comments

Comments

@sp94
Copy link
Owner

sp94 commented May 21, 2021

We should add examples of non-orthogonal lattices to the documentation, with some pictures

Interface

Assuming both lattice vectors a1 and a2 should have length == 1

In this case it is only necessary to specify the angles of the lattice vectors:
geometry = Geometry(epf, muf, th1, th2, d1, d2)
where th1 and th2 are scalars

More generally

If the lattice vector lengths should not be equal to 1, then use
geometry = Geometry(epf, muf, a1, a2, d1, d2) where a1 and a2 are 2-vectors

Example

Triangular lattice example:
geometry = Geometry(epf, muf, 0, 60, d1, d2)
or equivalently
geometry = Geometry(epf, muf, [cosd(0),sind(0)], [cosd(60),sind(60)], d1, d2)

To do

Add an example from Joannopoulos' book, such as the TE and TM modes of triangular array of air columns in dielectric substrate

@kabume
Copy link
Contributor

kabume commented May 21, 2021

Hi @sp94 , I have built a model of triangle lattice by changing the function wu_ep(...). But the bandgap diagram is not exact for the K point is not degeneracy. The codes are attached:

using Peacock
a1 = [1, 0]; a2 = [1/2, sqrt(3)/2]

function epf(x, y)
#    angles=[60n for n in 0:5]
    angles = [30 210]
    ep_bg = 1
    ep_cyl = 15
    Rs = 1/3
    d1s = d2s = 2Rs/3
    if length(Rs) == 1
        Rs = fill(Rs[1], length(angles))
    end
    if length(d1s) == 1
        d1s = fill(d1s[1], length(angles))
    end
    if length(d2s) == 1
        d2s = fill(d2s[1], length(angles))
    end
    @assert length(Rs) == length(d1s) == length(d2s) == length(angles)
    # Triangular lattice sites
    lx, ly = 1, 1*sqrt(3)
    sites = [
        (0, 0),
        (-lx, 0),
        (+lx, 0),
        (-lx/2, -ly/2),
        (+lx/2, -ly/2),
        (+lx/2, +ly/2),
        (-lx/2, +ly/2),
    ]
    # Hexagonal ring of cylinders at each site
    for (x0,y0) in sites
        for (R,d1,d2,th) in zip(Rs,d1s,d2s,angles)
            x_, y_ = [cosd(th) sind(th); -sind(th) cosd(th)] * [(x-x0); (y-y0)]
            x_ = (x_-R) / (d1/2)
            y_ = (y_-0) / (d2/2)
            if x_^2 + y_^2 <= 1
                return ep_cyl
            end
        end
    end
    return ep_bg
end

muf(x, y) = 1

#G = BrillouinZoneCoordinate(  0,   0, "Γ")
#M = BrillouinZoneCoordinate(  0, 1/2, "M")
#K = BrillouinZoneCoordinate(1/3, 1/3, "K")
G = [0,0]; M = [0,2*pi/sqrt(3)]; K = 2*pi*[1/3,1/sqrt(3)]
ks = [G, M, K, G]

d1, d2 = 0.01, 0.01

geometry = Geometry(epf, muf, a1, a2, d1, d2)
plot(geometry)

solver_PWE =  Solver(geometry, 7)
figure(figsize=(4,3))
plot_band_diagram(solver_PWE, ks, TM, color="blue"; bands=1:2, dk=0.1, frequency_scale=1/2pi)

@sp94
Copy link
Owner Author

sp94 commented May 21, 2021

Hi @kabume, for a simple triangular lattice you only need one cylinder per unit cell so it is quite simple

I think you were trying to reproduce the figure from Joannopoulos book where it is air cylinders in dielectric background so I also swapped those

using Peacock, PyPlot

th1 = 0;
th2 = 120;

epf(x,y) = x^2 + y^2 < 1/3^2 ? 1 : 15
muf(x,y) = 1
d1, d2 = 0.01, 0.01

geometry = Geometry(epf, muf, th1, th2, d1, d2)
plot(geometry)

G = BrillouinZoneCoordinate(  0,   0, "Γ")
M = BrillouinZoneCoordinate(  0, 1/2, "M")
K = BrillouinZoneCoordinate(1/3, 1/3, "K")
ks = [G, M, K, G]

solver_PWE =  Solver(geometry, 7)
figure(figsize=(4,3))
plot_band_diagram(solver_PWE, ks, TM, color="blue"; bands=1:2, dk=0.1, frequency_scale=1/2pi)

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

No branches or pull requests

2 participants