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

Doesn't work for 2d triangular lattice #2

Closed
iintSjds opened this issue Feb 7, 2022 · 1 comment
Closed

Doesn't work for 2d triangular lattice #2

iintSjds opened this issue Feb 7, 2022 · 1 comment

Comments

@iintSjds
Copy link

iintSjds commented Feb 7, 2022

Use code:

import SymmetryReduceBZ.Symmetry: calc_bz, calc_ibz
import SymmetryReduceBZ.Plotting: plot_2Dconvexhull
using PyPlot
real_latvecs = [1 0; 1/2 sqrt(3)/2]' # produce a triangular lattice
convention="ordinary"
atom_types=[0]
atom_pos = Array([0 0]')
coords = "Cartesian"
ibzformat = "convex hull"
makeprim=false
bz = calc_bz(real_latvecs,atom_types,atom_pos,coords,ibzformat,makeprim,convention)
ibz = calc_ibz(real_latvecs,atom_types,atom_pos,coords,ibzformat,makeprim,convention)
ax = plot_2Dconvexhull(bz,facecolor="deepskyblue",linewidth=3,edgecolor="cyan",alpha=0.2)
ax = plot_2Dconvexhull(ibz,ax;facecolor="coral",linewidth=3,edgecolor="magenta",alpha=0.4)

The result is not fully reduced.
download

@jerjorg
Copy link
Owner

jerjorg commented Feb 8, 2022

The problem lies in the calculation of the point group where all the lattice points within a circle/sphere are needed to compute the symmetries. The radius of the circle (in this case) was just barely too small and lattice points that lay on the boundary of the circle were being excluded due to finite precision. I've introduced a tolerance that fixes the issue in the latest commit.

import SymmetryReduceBZ.Symmetry: calc_bz, calc_ibz
import SymmetryReduceBZ.Plotting: plot_2Dconvexhull
using PyPlot
real_latvecs = [1 0; 1/2 sqrt(3)/2]' # produce a triangular lattice
coordinates = "lattice"
convention="ordinary"
atom_types=[0]
atom_pos = Array([0 0]')
coords = "Cartesian"
ibzformat = "convex hull"
makeprim=false
bz = calc_bz(real_latvecs,atom_types,atom_pos,coords,ibzformat,makeprim,convention)
ibz = calc_ibz(real_latvecs,atom_types,atom_pos,coords,ibzformat,makeprim,convention)
ax = plot_2Dconvexhull(bz,facecolor="deepskyblue",linewidth=3,edgecolor="cyan",alpha=0.2)
ax = plot_2Dconvexhull(ibz,ax;facecolor="coral",linewidth=3,edgecolor="magenta",alpha=0.4)

image

@jerjorg jerjorg closed this as completed Feb 8, 2022
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