In [1]:
import seekpath as sp
import numpy as np
import spglib as spg
import matplotlib.pyplot as plt

In [2]:
lattice = np.array([
    [ np.sqrt(3)/2, -0.5, 0.0],
    [ 0.0, 1.0,  0.0],
    [ 0.0, 0.0, 1.65]])*3.25

positions = np.array([
    [0.0, 0.0, 0.0],
    [2/3, 1/3, 1/2],
    [2/3, 1/3, 1/8],
    [0.0, 0.0, 5/8]])

numbers = [8, 8, 30, 30]

In [3]:
path = sp.get_path((lattice, positions, numbers), False, "hpkot", 1e-5)
path


Out[3]:
{'augmented_path': True,
 'bravais_lattice': 'hP',
 'bravais_lattice_extended': 'hP2',
 'conv_lattice': array([[ 3.25      ,  0.        ,  0.        ],
        [-1.625     ,  2.81458256,  0.        ],
        [ 0.        ,  0.        ,  5.3625    ]]),
 'conv_positions': array([[ 0.66666667,  0.33333333,  0.        ],
        [ 0.33333333,  0.66666667,  0.5       ],
        [ 0.33333333,  0.66666667,  0.125     ],
        [ 0.66666667,  0.33333333,  0.625     ]]),
 'conv_types': array([ 8,  8, 30, 30], dtype=int32),
 'has_inversion_symmetry': False,
 'inverse_primitive_transformation_matrix': array([[1, 0, 0],
        [0, 1, 0],
        [0, 0, 1]]),
 'path': [('GAMMA', 'M'),
  ('M', 'K'),
  ('K', 'GAMMA'),
  ('GAMMA', 'A'),
  ('A', 'L'),
  ('L', 'H'),
  ('H', 'A'),
  ('L', 'M'),
  ('H', 'K'),
  ('GAMMA', "M'"),
  ("M'", "K'"),
  ("K'", 'GAMMA'),
  ('GAMMA', "A'"),
  ("A'", "L'"),
  ("L'", "H'"),
  ("H'", "A'"),
  ("L'", "M'"),
  ("H'", "K'")],
 'point_coords': {'A': [0.0, 0.0, 0.5],
  "A'": [-0.0, -0.0, -0.5],
  'GAMMA': [0.0, 0.0, 0.0],
  'H': [0.3333333333333333, 0.3333333333333333, 0.5],
  "H'": [-0.3333333333333333, -0.3333333333333333, -0.5],
  'H_2': [0.3333333333333333, 0.3333333333333333, -0.5],
  "H_2'": [-0.3333333333333333, -0.3333333333333333, 0.5],
  'K': [0.3333333333333333, 0.3333333333333333, 0.0],
  "K'": [-0.3333333333333333, -0.3333333333333333, -0.0],
  'L': [0.5, 0.0, 0.5],
  "L'": [-0.5, -0.0, -0.5],
  'M': [0.5, 0.0, 0.0],
  "M'": [-0.5, -0.0, -0.0]},
 'primitive_lattice': array([[ 3.25      ,  0.        ,  0.        ],
        [-1.625     ,  2.81458256,  0.        ],
        [ 0.        ,  0.        ,  5.3625    ]]),
 'primitive_positions': array([[ 0.66666667,  0.33333333,  0.        ],
        [ 0.33333333,  0.66666667,  0.5       ],
        [ 0.33333333,  0.66666667,  0.125     ],
        [ 0.66666667,  0.33333333,  0.625     ]]),
 'primitive_transformation_matrix': array([[1, 0, 0],
        [0, 1, 0],
        [0, 0, 1]]),
 'primitive_types': array([ 8,  8, 30, 30], dtype=int32),
 'reciprocal_primitive_lattice': [[1.9332877868244882,
   1.1161842241441342,
   0.0],
  [0.0, 2.2323684482882684, 0.0],
  [0.0, 0.0, 1.171689567772417]],
 'spacegroup_international': 'P6_3mc',
 'spacegroup_number': 186,
 'volume_original_wrt_conv': 1.0,
 'volume_original_wrt_prim': 1.0}

In [4]:
points = path['point_coords']

In [35]:


In [29]:
path


Out[29]:
{'augmented_path': True,
 'explicit_kpoints_abs': array([[ 0.        ,  0.        ,  0.        ],
        [ 0.96664389,  0.55809211,  0.        ],
        [ 0.64442926,  1.11618422,  0.        ],
        [ 0.        ,  0.        ,  0.        ],
        [ 0.        ,  0.        ,  0.58584478],
        [ 0.96664389,  0.55809211,  0.58584478],
        [ 0.64442926,  1.11618422,  0.58584478],
        [ 0.        ,  0.        ,  0.58584478],
        [ 0.96664389,  0.55809211,  0.58584478],
        [ 0.96664389,  0.55809211,  0.        ],
        [ 0.64442926,  1.11618422,  0.58584478],
        [ 0.64442926,  1.11618422,  0.        ],
        [ 0.        ,  0.        ,  0.        ],
        [-0.96664389, -0.55809211,  0.        ],
        [-0.64442926, -1.11618422,  0.        ],
        [ 0.        ,  0.        ,  0.        ],
        [ 0.        ,  0.        , -0.58584478],
        [-0.96664389, -0.55809211, -0.58584478],
        [-0.64442926, -1.11618422, -0.58584478],
        [ 0.        ,  0.        , -0.58584478],
        [-0.96664389, -0.55809211, -0.58584478],
        [-0.96664389, -0.55809211,  0.        ],
        [-0.64442926, -1.11618422, -0.58584478],
        [-0.64442926, -1.11618422,  0.        ]]),
 'explicit_kpoints_labels': ['GAMMA',
  'M',
  'K',
  'GAMMA',
  'A',
  'L',
  'H',
  'A',
  'L',
  'M',
  'H',
  'K',
  'GAMMA',
  "M'",
  "K'",
  'GAMMA',
  "A'",
  "L'",
  "H'",
  "A'",
  "L'",
  "M'",
  "H'",
  "K'"],
 'explicit_kpoints_linearcoord': array([  0.        ,   1.11618422,   1.76061349,   3.04947201,
          3.63531679,   4.75150102,   5.39593028,   6.68478881,
          6.68478881,   7.27063359,   7.27063359,   7.85647837,
          7.85647837,   8.9726626 ,   9.61709186,  10.90595038,
         11.49179517,  12.60797939,  13.25240865,  14.54126718,
         14.54126718,  15.12711196,  15.12711196,  15.71295675]),
 'explicit_kpoints_rel': array([[ 0.        ,  0.        ,  0.        ],
        [ 0.5       ,  0.        ,  0.        ],
        [ 0.33333333,  0.33333333,  0.        ],
        [ 0.        ,  0.        ,  0.        ],
        [ 0.        ,  0.        ,  0.5       ],
        [ 0.5       ,  0.        ,  0.5       ],
        [ 0.33333333,  0.33333333,  0.5       ],
        [ 0.        ,  0.        ,  0.5       ],
        [ 0.5       ,  0.        ,  0.5       ],
        [ 0.5       ,  0.        ,  0.        ],
        [ 0.33333333,  0.33333333,  0.5       ],
        [ 0.33333333,  0.33333333,  0.        ],
        [ 0.        ,  0.        ,  0.        ],
        [-0.5       ,  0.        ,  0.        ],
        [-0.33333333, -0.33333333,  0.        ],
        [ 0.        ,  0.        ,  0.        ],
        [ 0.        ,  0.        , -0.5       ],
        [-0.5       ,  0.        , -0.5       ],
        [-0.33333333, -0.33333333, -0.5       ],
        [ 0.        ,  0.        , -0.5       ],
        [-0.5       ,  0.        , -0.5       ],
        [-0.5       ,  0.        ,  0.        ],
        [-0.33333333, -0.33333333, -0.5       ],
        [-0.33333333, -0.33333333,  0.        ]]),
 'has_inversion_symmetry': False,
 'primitive_lattice': array([[ 3.25      ,  0.        ,  0.        ],
        [-1.625     ,  2.81458256,  0.        ],
        [ 0.        ,  0.        ,  5.3625    ]]),
 'primitive_positions': array([[ 0.66666667,  0.33333333,  0.        ],
        [ 0.33333333,  0.66666667,  0.5       ],
        [ 0.33333333,  0.66666667,  0.125     ],
        [ 0.66666667,  0.33333333,  0.625     ]]),
 'primitive_types': array([ 8,  8, 30, 30], dtype=int32),
 'reciprocal_primitive_lattice': [[1.9332877868244882,
   1.1161842241441342,
   0.0],
  [0.0, 2.2323684482882684, 0.0],
  [0.0, 0.0, 1.171689567772417]],
 'segments': [(0, 2),
  (1, 3),
  (2, 4),
  (3, 5),
  (4, 6),
  (5, 7),
  (6, 8),
  (8, 10),
  (10, 12),
  (12, 14),
  (13, 15),
  (14, 16),
  (15, 17),
  (16, 18),
  (17, 19),
  (18, 20),
  (20, 22),
  (22, 24)],
 'volume_original_wrt_prim': 1.0}

In [30]:
x = np.linspace(0,5,len(expath))

In [32]:
x


Out[32]:
array([ 0.        ,  0.2173913 ,  0.43478261,  0.65217391,  0.86956522,
        1.08695652,  1.30434783,  1.52173913,  1.73913043,  1.95652174,
        2.17391304,  2.39130435,  2.60869565,  2.82608696,  3.04347826,
        3.26086957,  3.47826087,  3.69565217,  3.91304348,  4.13043478,
        4.34782609,  4.56521739,  4.7826087 ,  5.        ])

In [33]:
labels


Out[33]:
['GAMMA',
 'M',
 'K',
 'GAMMA',
 'A',
 'L',
 'H',
 'A',
 'L',
 'M',
 'H',
 'K',
 'GAMMA',
 "M'",
 "K'",
 'GAMMA',
 "A'",
 "L'",
 "H'",
 "A'",
 "L'",
 "M'",
 "H'",
 "K'"]

In [ ]:


In [34]:
fig, ax = plt.subplots(figsize=(15,7))
ax.plot(x,x)
ax.set_xticks(x)
ax.set_xticklabels(labels)
plt.show()



In [ ]: