Remove unnecessary features in C

This commit is contained in:
Atsushi Togo 2021-03-04 22:29:23 +09:00
parent 2a4ed7734b
commit bdf40bccd1
7 changed files with 138 additions and 293 deletions

View File

@ -85,7 +85,7 @@ py_set_triplets_integration_weights_with_sigma(PyObject *self, PyObject *args);
static PyObject *
py_get_grid_index_from_address(PyObject *self, PyObject *args);
static PyObject *
py_get_stabilized_reciprocal_mesh(PyObject *self, PyObject *args);
py_get_ir_reciprocal_mesh(PyObject *self, PyObject *args);
static PyObject * py_relocate_BZ_grid_address(PyObject *self, PyObject *args);
static PyObject * py_get_bz_grid_addresses(PyObject *self, PyObject *args);
@ -227,10 +227,10 @@ static PyMethodDef _phono3py_methods[] = {
(PyCFunction)py_get_grid_index_from_address,
METH_VARARGS,
"Grid index from grid address"},
{"stabilized_reciprocal_mesh",
(PyCFunction)py_get_stabilized_reciprocal_mesh,
{"ir_reciprocal_mesh",
(PyCFunction)py_get_ir_reciprocal_mesh,
METH_VARARGS,
"Reciprocal mesh points with map"},
"Reciprocal mesh points with ir grid mapping table"},
{"BZ_grid_address",
(PyCFunction)py_relocate_BZ_grid_address,
METH_VARARGS,
@ -1823,7 +1823,7 @@ py_get_grid_index_from_address(PyObject *self, PyObject *args)
static PyObject *
py_get_stabilized_reciprocal_mesh(PyObject *self, PyObject *args)
py_get_ir_reciprocal_mesh(PyObject *self, PyObject *args)
{
PyArrayObject* py_grid_address;
PyArrayObject* py_grid_mapping_table;
@ -1831,27 +1831,23 @@ py_get_stabilized_reciprocal_mesh(PyObject *self, PyObject *args)
PyArrayObject* py_is_shift;
long is_time_reversal;
PyArrayObject* py_rotations;
PyArrayObject* py_qpoints;
long (*grid_address)[3];
long* mesh;
long* is_shift;
long (*rot)[3][3];
long num_rot;
double (*q)[3];
long num_q;
long *grid_mapping_table;
long num_ir;
if (!PyArg_ParseTuple(args, "OOOOlOO",
if (!PyArg_ParseTuple(args, "OOOOlO",
&py_grid_address,
&py_grid_mapping_table,
&py_mesh,
&py_is_shift,
&is_time_reversal,
&py_rotations,
&py_qpoints)) {
&py_rotations)) {
return NULL;
}
@ -1860,19 +1856,15 @@ py_get_stabilized_reciprocal_mesh(PyObject *self, PyObject *args)
is_shift = (long*)PyArray_DATA(py_is_shift);
rot = (long(*)[3][3])PyArray_DATA(py_rotations);
num_rot = (long)PyArray_DIMS(py_rotations)[0];
q = (double(*)[3])PyArray_DATA(py_qpoints);
num_q = (long)PyArray_DIMS(py_qpoints)[0];
grid_mapping_table = (long*)PyArray_DATA(py_grid_mapping_table);
num_ir = ph3py_get_stabilized_reciprocal_mesh(grid_address,
grid_mapping_table,
mesh,
is_shift,
is_time_reversal,
rot,
num_rot,
num_q,
q);
num_ir = ph3py_get_ir_reciprocal_mesh(grid_address,
grid_mapping_table,
mesh,
is_shift,
is_time_reversal,
rot,
num_rot);
return PyLong_FromLong(num_ir);
}

View File

@ -176,10 +176,6 @@ static long bz_search_space[KPT_NUM_BZ_SEARCH_SPACE][3] = {
static MatLONG *get_point_group_reciprocal(const MatLONG * rotations,
const long is_time_reversal);
static MatLONG *get_point_group_reciprocal_with_q(const MatLONG * rot_reciprocal,
const double symprec,
const long num_q,
KPTCONST double qpoints[][3]);
static long get_ir_reciprocal_mesh(long grid_address[][3],
long ir_mapping_table[],
const long mesh[3],
@ -213,19 +209,11 @@ static long get_num_ir(long ir_mapping_table[], const long mesh[3]);
static long check_mesh_symmetry(const long mesh[3],
const long is_shift[3],
const MatLONG *rot_reciprocal);
static long Nint(const double a);
static double Dabs(const double a);
static void transpose_matrix_l3(long a[3][3], KPTCONST long b[3][3]);
static void multiply_matrix_l3(long m[3][3],
KPTCONST long a[3][3], KPTCONST long b[3][3]);
static long check_identity_matrix_l3(KPTCONST long a[3][3],
KPTCONST long b[3][3]);
static void multiply_matrix_vector_ld3(double v[3],
KPTCONST long a[3][3],
const double b[3]);
static void multiply_matrix_vector_l3(long v[3],
KPTCONST long a[3][3],
const long b[3]);
static void multiply_matrix_vector_d3(double v[3],
KPTCONST double a[3][3],
const double b[3]);
@ -255,48 +243,24 @@ MatLONG *kpt_get_point_group_reciprocal(const MatLONG * rotations,
return get_point_group_reciprocal(rotations, is_time_reversal);
}
MatLONG *kpt_get_point_group_reciprocal_with_q(const MatLONG * rot_reciprocal,
const double symprec,
const long num_q,
KPTCONST double qpoints[][3])
{
return get_point_group_reciprocal_with_q(rot_reciprocal,
symprec,
num_q,
qpoints);
}
long kpt_get_stabilized_reciprocal_mesh(long grid_address[][3],
long ir_mapping_table[],
const long mesh[3],
const long is_shift[3],
const long is_time_reversal,
const MatLONG * rotations,
const long num_q,
KPTCONST double qpoints[][3])
long kpt_get_ir_reciprocal_mesh(long grid_address[][3],
long ir_mapping_table[],
const long mesh[3],
const long is_shift[3],
const long is_time_reversal,
const MatLONG * rotations)
{
long num_ir;
MatLONG *rot_reciprocal, *rot_reciprocal_q;
double tolerance;
MatLONG *rot_reciprocal;
rot_reciprocal = NULL;
rot_reciprocal_q = NULL;
rot_reciprocal = get_point_group_reciprocal(rotations, is_time_reversal);
tolerance = 0.01 / (mesh[0] + mesh[1] + mesh[2]);
rot_reciprocal_q = get_point_group_reciprocal_with_q(rot_reciprocal,
tolerance,
num_q,
qpoints);
num_ir = get_ir_reciprocal_mesh(grid_address,
ir_mapping_table,
mesh,
is_shift,
rot_reciprocal_q);
rot_reciprocal);
kpt_free_MatLONG(rot_reciprocal_q);
rot_reciprocal_q = NULL;
kpt_free_MatLONG(rot_reciprocal);
rot_reciprocal = NULL;
return num_ir;
@ -345,6 +309,18 @@ void kpt_copy_matrix_l3(long a[3][3], KPTCONST long b[3][3])
a[2][2] = b[2][2];
}
void kpt_multiply_matrix_vector_l3(long v[3],
KPTCONST long a[3][3],
const long b[3])
{
long i;
long c[3];
for (i = 0; i < 3; i++)
c[i] = a[i][0] * b[0] + a[i][1] * b[1] + a[i][2] * b[2];
for (i = 0; i < 3; i++)
v[i] = c[i];
}
MatLONG * kpt_alloc_MatLONG(const long size)
{
MatLONG *matlong;
@ -456,74 +432,6 @@ static MatLONG *get_point_group_reciprocal(const MatLONG * rotations,
return rot_return;
}
/* Return NULL if failed */
static MatLONG *get_point_group_reciprocal_with_q(const MatLONG * rot_reciprocal,
const double symprec,
const long num_q,
KPTCONST double qpoints[][3])
{
long i, j, k, l, is_all_ok, num_rot;
long *ir_rot;
double q_rot[3], diff[3];
MatLONG * rot_reciprocal_q;
ir_rot = NULL;
rot_reciprocal_q = NULL;
is_all_ok = 0;
num_rot = 0;
if ((ir_rot = (long*)malloc(sizeof(long) * rot_reciprocal->size)) == NULL) {
warning_print("Memory of ir_rot could not be allocated.");
return NULL;
}
for (i = 0; i < rot_reciprocal->size; i++) {
ir_rot[i] = -1;
}
for (i = 0; i < rot_reciprocal->size; i++) {
for (j = 0; j < num_q; j++) {
is_all_ok = 0;
multiply_matrix_vector_ld3(q_rot,
rot_reciprocal->mat[i],
qpoints[j]);
for (k = 0; k < num_q; k++) {
for (l = 0; l < 3; l++) {
diff[l] = q_rot[l] - qpoints[k][l];
diff[l] -= Nint(diff[l]);
}
if (Dabs(diff[0]) < symprec &&
Dabs(diff[1]) < symprec &&
Dabs(diff[2]) < symprec) {
is_all_ok = 1;
break;
}
}
if (! is_all_ok) {
break;
}
}
if (is_all_ok) {
ir_rot[num_rot] = i;
num_rot++;
}
}
if ((rot_reciprocal_q = kpt_alloc_MatLONG(num_rot)) != NULL) {
for (i = 0; i < num_rot; i++) {
kpt_copy_matrix_l3(rot_reciprocal_q->mat[i],
rot_reciprocal->mat[ir_rot[i]]);
}
}
free(ir_rot);
ir_rot = NULL;
return rot_reciprocal_q;
}
static long get_ir_reciprocal_mesh(long grid_address[][3],
long ir_mapping_table[],
@ -566,16 +474,16 @@ static long get_ir_reciprocal_mesh_normal(long grid_address[][3],
grg_get_all_grid_addresses(grid_address, mesh);
#pragma omp parallel for private(j, grid_point_rot, address_double, address_double_rot)
for (i = 0; i < mesh[0] * mesh[1] * (long)(mesh[2]); i++) {
for (i = 0; i < mesh[0] * mesh[1] * mesh[2]; i++) {
grg_get_double_grid_address(address_double,
grid_address[i],
mesh,
is_shift);
ir_mapping_table[i] = i;
for (j = 0; j < rot_reciprocal->size; j++) {
multiply_matrix_vector_l3(address_double_rot,
rot_reciprocal->mat[j],
address_double);
kpt_multiply_matrix_vector_l3(address_double_rot,
rot_reciprocal->mat[j],
address_double);
grid_point_rot = grg_get_double_grid_index(address_double_rot, mesh, is_shift);
if (grid_point_rot < ir_mapping_table[i]) {
#ifdef _OPENMP
@ -613,7 +521,7 @@ get_ir_reciprocal_mesh_distortion(long grid_address[][3],
}
#pragma omp parallel for private(j, k, grid_point_rot, address_double, address_double_rot, long_address_double, long_address_double_rot)
for (i = 0; i < mesh[0] * mesh[1] * (long)(mesh[2]); i++) {
for (i = 0; i < mesh[0] * mesh[1] * mesh[2]; i++) {
grg_get_double_grid_address(address_double,
grid_address[i],
mesh,
@ -872,23 +780,6 @@ static long check_mesh_symmetry(const long mesh[3],
((eq[2] && mesh[2] == mesh[0] && is_shift[2] == is_shift[0]) || (!eq[2])));
}
static long Nint(const double a)
{
if (a < 0.0)
return (long) (a - 0.5);
else
return (long) (a + 0.5);
}
static double Dabs(const double a)
{
if (a < 0.0)
return -a;
else
return a;
}
static void transpose_matrix_l3(long a[3][3], KPTCONST long b[3][3])
{
long c[3][3];
@ -938,30 +829,6 @@ static long check_identity_matrix_l3(KPTCONST long a[3][3],
}
}
static void multiply_matrix_vector_ld3(double v[3],
KPTCONST long a[3][3],
const double b[3])
{
long i;
double c[3];
for (i = 0; i < 3; i++)
c[i] = a[i][0] * b[0] + a[i][1] * b[1] + a[i][2] * b[2];
for (i = 0; i < 3; i++)
v[i] = c[i];
}
static void multiply_matrix_vector_l3(long v[3],
KPTCONST long a[3][3],
const long b[3])
{
long i;
long c[3];
for (i = 0; i < 3; i++)
c[i] = a[i][0] * b[0] + a[i][1] * b[1] + a[i][2] * b[2];
for (i = 0; i < 3; i++)
v[i] = c[i];
}
static void multiply_matrix_vector_d3(double v[3],
KPTCONST double a[3][3],
const double b[3])

View File

@ -51,18 +51,12 @@ long kpt_get_irreducible_reciprocal_mesh(long grid_address[][3],
const MatLONG *rot_reciprocal);
MatLONG *kpt_get_point_group_reciprocal(const MatLONG * rotations,
const long is_time_reversal);
MatLONG *kpt_get_point_group_reciprocal_with_q(const MatLONG * rot_reciprocal,
const double symprec,
const long num_q,
KPTCONST double qpoints[][3]);
long kpt_get_stabilized_reciprocal_mesh(long grid_address[][3],
long ir_mapping_table[],
const long mesh[3],
const long is_shift[3],
const long is_time_reversal,
const MatLONG * rotations,
const long num_q,
KPTCONST double qpoints[][3]);
long kpt_get_ir_reciprocal_mesh(long grid_address[][3],
long ir_mapping_table[],
const long mesh[3],
const long is_shift[3],
const long is_time_reversal,
const MatLONG * rotations);
long kpt_relocate_BZ_grid_address(long bz_grid_address[][3],
long bz_map[],
KPTCONST long grid_address[][3],
@ -76,6 +70,9 @@ long kpt_get_bz_grid_addresses(long bz_grid_address[][3],
KPTCONST double rec_lattice[3][3],
const long is_shift[3]);
void kpt_copy_matrix_l3(long a[3][3], KPTCONST long b[3][3]);
void kpt_multiply_matrix_vector_l3(long v[3],
KPTCONST long a[3][3],
const long b[3]);
MatLONG * kpt_alloc_MatLONG(const long size);
void kpt_free_MatLONG(MatLONG * matlong);

View File

@ -609,15 +609,13 @@ long ph3py_get_grid_index_from_address(const long address[3],
}
long ph3py_get_stabilized_reciprocal_mesh(long grid_address[][3],
long ir_mapping_table[],
const long mesh[3],
const long is_shift[3],
const long is_time_reversal,
PHPYCONST long rotations_in[][3][3],
const long num_rot,
const long num_q,
PHPYCONST double qpoints[][3])
long ph3py_get_ir_reciprocal_mesh(long grid_address[][3],
long ir_mapping_table[],
const long mesh[3],
const long is_shift[3],
const long is_time_reversal,
PHPYCONST long rotations_in[][3][3],
const long num_rot)
{
long i, num_ir;
MatLONG *rotations;
@ -627,14 +625,12 @@ long ph3py_get_stabilized_reciprocal_mesh(long grid_address[][3],
for (i = 0; i < num_rot; i++) {
kpt_copy_matrix_l3(rotations->mat[i], rotations_in[i]);
}
num_ir = kpt_get_stabilized_reciprocal_mesh(grid_address,
ir_mapping_table,
mesh,
is_shift,
is_time_reversal,
rotations,
num_q,
qpoints);
num_ir = kpt_get_ir_reciprocal_mesh(grid_address,
ir_mapping_table,
mesh,
is_shift,
is_time_reversal,
rotations);
kpt_free_MatLONG(rotations);
return num_ir;
}

View File

@ -283,15 +283,13 @@ void ph3py_get_integration_weight_with_sigma(double *iw,
const long tp_type);
long ph3py_get_grid_index_from_address(const long address[3],
const long mesh[3]);
long ph3py_get_stabilized_reciprocal_mesh(long grid_address[][3],
long ir_mapping_table[],
const long mesh[3],
const long is_shift[3],
const long is_time_reversal,
PHPYCONST long rotations_in[][3][3],
const long num_rot,
const long num_q,
PHPYCONST double qpoints[][3]);
long ph3py_get_ir_reciprocal_mesh(long grid_address[][3],
long ir_mapping_table[],
const long mesh[3],
const long is_shift[3],
const long is_time_reversal,
PHPYCONST long rotations_in[][3][3],
const long num_rot);
long ph3py_relocate_BZ_grid_address(long bz_grid_address[][3],
long bz_map[],
PHPYCONST long grid_address[][3],

View File

@ -170,10 +170,6 @@ static long bz_search_space[KPT_NUM_BZ_SEARCH_SPACE][3] = {
{-1, -1, -1}
};
static void grid_point_to_address_double(long address_double[3],
const long grid_point,
const long mesh[3],
const long is_shift[3]);
static long get_ir_triplets_at_q(long *map_triplets,
long *map_q,
long (*grid_address)[3],
@ -193,6 +189,9 @@ static long get_third_q_of_triplets_at_q(long bz_address[3][3],
const long *bz_map,
const long mesh[3],
const long bzmesh[3]);
static MatLONG *get_point_group_reciprocal_with_q(const MatLONG * rot_reciprocal,
const long mesh[3],
const long grid_point);
static void modulo_l3(long v[3], const long m[3]);
long tpk_get_ir_triplets_at_q(long *map_triplets,
@ -245,11 +244,9 @@ static long get_ir_triplets_at_q(long *map_triplets,
const long swappable)
{
long i, j, num_grid, q_2, num_ir_q, num_ir_triplets, ir_gp;
long mesh_double[3], is_shift[3];
long address_double0[3], address_double1[3], address_double2[3];
long is_shift[3];
long adrs0[3], adrs1[3], adrs2[3];
long *ir_grid_points, *third_q;
double tolerance;
double stabilizer_q[1][3];
MatLONG *rot_reciprocal_q;
ir_grid_points = NULL;
@ -257,27 +254,16 @@ static long get_ir_triplets_at_q(long *map_triplets,
rot_reciprocal_q = NULL;
num_ir_triplets = 0;
tolerance = 0.01 / (mesh[0] + mesh[1] + mesh[2]);
num_grid = mesh[0] * mesh[1] * (long)mesh[2];
num_grid = mesh[0] * mesh[1] * mesh[2];
for (i = 0; i < 3; i++) {
/* Only consider the gamma-point */
is_shift[i] = 0;
mesh_double[i] = mesh[i] * 2;
}
/* Search irreducible q-points (map_q) with a stabilizer */
/* q */
grid_point_to_address_double(address_double0, grid_point, mesh, is_shift);
for (i = 0; i < 3; i++) {
stabilizer_q[0][i] =
(double)address_double0[i] / mesh_double[i] - (address_double0[i] > mesh[i]);
}
rot_reciprocal_q = kpt_get_point_group_reciprocal_with_q(rot_reciprocal,
tolerance,
1,
stabilizer_q);
/* Search irreducible q-points (map_q) with a stabilizer. */
rot_reciprocal_q = get_point_group_reciprocal_with_q(rot_reciprocal,
mesh,
grid_point);
num_ir_q = kpt_get_irreducible_reciprocal_mesh(grid_address,
map_q,
mesh,
@ -308,16 +294,15 @@ static long get_ir_triplets_at_q(long *map_triplets,
map_triplets[i] = num_grid; /* When not found, map_triplets == num_grid */
}
#pragma omp parallel for private(j, address_double1, address_double2)
grg_get_grid_address_from_index(adrs0, grid_point, mesh);
#pragma omp parallel for private(j, adrs1, adrs2)
for (i = 0; i < num_ir_q; i++) {
grid_point_to_address_double(address_double1,
ir_grid_points[i],
mesh,
is_shift); /* q' */
grg_get_grid_address_from_index(adrs1, ir_grid_points[i], mesh);
for (j = 0; j < 3; j++) { /* q'' */
address_double2[j] = - address_double0[j] - address_double1[j];
adrs2[j] = - adrs0[j] - adrs1[j];
}
third_q[i] = grg_get_double_grid_index(address_double2, mesh, is_shift);
third_q[i] = grg_get_grid_index(adrs2, mesh);
}
if (swappable) { /* search q1 <-> q2 */
@ -434,7 +419,7 @@ static long get_third_q_of_triplets_at_q(long bz_address[3][3],
long bzgp[KPT_NUM_BZ_SEARCH_SPACE];
long bz_address_double[3], PS[3];
prod_bzmesh = (long)bzmesh[0] * bzmesh[1] * bzmesh[2];
prod_bzmesh = bzmesh[0] * bzmesh[1] * bzmesh[2];
modulo_l3(bz_address[q_index], mesh);
for (i = 0; i < 3; i++) {
@ -484,27 +469,51 @@ escape:
return smallest_g;
}
static void grid_point_to_address_double(long address_double[3],
const long grid_point,
const long mesh[3],
const long is_shift[3])
/* Return NULL if failed */
static MatLONG *get_point_group_reciprocal_with_q(const MatLONG * rot_reciprocal,
const long mesh[3],
const long grid_point)
{
long i;
long address[3];
long i, num_rot, gp_rot;
long *ir_rot;
long adrs[3], adrs_rot[3];
MatLONG * rot_reciprocal_q;
#ifndef GRID_ORDER_XYZ
address[2] = grid_point / (mesh[0] * mesh[1]);
address[1] = (grid_point - address[2] * mesh[0] * mesh[1]) / mesh[0];
address[0] = grid_point % mesh[0];
#else
address[0] = grid_point / (mesh[1] * mesh[2]);
address[1] = (grid_point - address[0] * mesh[1] * mesh[2]) / mesh[2];
address[2] = grid_point % mesh[2];
#endif
ir_rot = NULL;
rot_reciprocal_q = NULL;
num_rot = 0;
for (i = 0; i < 3; i++) {
address_double[i] = address[i] * 2 + is_shift[i];
grg_get_grid_address_from_index(adrs, grid_point, mesh);
if ((ir_rot = (long*)malloc(sizeof(long) * rot_reciprocal->size)) == NULL) {
warning_print("Memory of ir_rot could not be allocated.");
return NULL;
}
for (i = 0; i < rot_reciprocal->size; i++) {
ir_rot[i] = -1;
}
for (i = 0; i < rot_reciprocal->size; i++) {
kpt_multiply_matrix_vector_l3(adrs_rot, rot_reciprocal->mat[i], adrs);
gp_rot = grg_get_grid_index(adrs_rot, mesh);
if (gp_rot == grid_point) {
ir_rot[num_rot] = i;
num_rot++;
}
}
if ((rot_reciprocal_q = kpt_alloc_MatLONG(num_rot)) != NULL) {
for (i = 0; i < num_rot; i++) {
kpt_copy_matrix_l3(rot_reciprocal_q->mat[i],
rot_reciprocal->mat[ir_rot[i]]);
}
}
free(ir_rot);
ir_rot = NULL;
return rot_reciprocal_q;
}
static void modulo_l3(long v[3], const long m[3])

View File

@ -227,7 +227,7 @@ def get_nosym_triplets_at_q(grid_point,
def get_grid_address(mesh):
"""Returns grid_address of dtype='int_'"""
grid_mapping_table, grid_address = _get_stabilized_reciprocal_mesh(
grid_mapping_table, grid_address = _get_ir_reciprocal_mesh(
mesh,
[[[1, 0, 0], [0, 1, 0], [0, 0, 1]]],
is_time_reversal=False)
@ -273,7 +273,7 @@ def get_grid_point_from_address(address, mesh):
def get_ir_grid_points(mesh, rotations, mesh_shifts=None):
if mesh_shifts is None:
mesh_shifts = [False, False, False]
grid_mapping_table, grid_address = _get_stabilized_reciprocal_mesh(
grid_mapping_table, grid_address = _get_ir_reciprocal_mesh(
mesh,
rotations,
is_shift=np.where(mesh_shifts, 1, 0))
@ -404,14 +404,11 @@ def get_tetrahedra_vertices(relative_address,
return vertices
def _get_stabilized_reciprocal_mesh(mesh,
rotations,
is_shift=None,
is_time_reversal=True,
qpoints=None):
"""Return k-point map to the irreducible k-points and k-point grid points.
The symmetry is searched from the input rotation matrices in real space.
def _get_ir_reciprocal_mesh(mesh,
rotations,
is_shift=None,
is_time_reversal=True):
"""Irreducible k-points are searched under a fixed q-point.
Parameters
----------
@ -426,10 +423,6 @@ def _get_stabilized_reciprocal_mesh(mesh,
dtype='int_', shape=(3,)
is_time_reversal : bool
Time reversal symmetry is included or not.
qpoints : array_like
q-points used as stabilizer(s) given in reciprocal space with respect
to reciprocal basis vectors.
dtype='double', shape=(qpoints ,3) or (3,)
Returns
-------
@ -437,8 +430,7 @@ def _get_stabilized_reciprocal_mesh(mesh,
Grid point mapping table to ir-gird-points.
dtype='int_', shape=(prod(mesh),)
grid_address : ndarray
Address of all grid points. Each address is given by three unsigned
integers.
Address of all grid points. Each address is given by three integers.
dtype='int_', shape=(prod(mesh), 3)
"""
@ -449,24 +441,18 @@ def _get_stabilized_reciprocal_mesh(mesh,
grid_address = np.zeros((np.prod(mesh), 3), dtype='int_')
if is_shift is None:
is_shift = [0, 0, 0]
if qpoints is None:
qpoints = np.array([[0, 0, 0]], dtype='double', order='C')
else:
qpoints = np.array(qpoints, dtype='double', order='C')
if qpoints.shape == (3,):
qpoints = np.array([qpoints], dtype='double', order='C')
if phono3c.stabilized_reciprocal_mesh(
if phono3c.ir_reciprocal_mesh(
grid_address,
mapping_table,
np.array(mesh, dtype='int_'),
np.array(is_shift, dtype='int_'),
is_time_reversal * 1,
np.array(rotations, dtype='int_', order='C'),
qpoints) > 0:
np.array(rotations, dtype='int_', order='C')) > 0:
return mapping_table, grid_address
else:
return None
raise RuntimeError(
"ir_reciprocal_mesh didn't work well.")
def _relocate_BZ_grid_address(grid_address,