Skip to content

Commit

Permalink
Remove unnecessary functions from _phono3py.cpp and phono3py.h
Browse files Browse the repository at this point in the history
  • Loading branch information
atztogo committed Dec 23, 2024
1 parent 71dcf84 commit 0b67750
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 193 deletions.
162 changes: 0 additions & 162 deletions c/_phono3py.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -887,168 +887,6 @@ void py_get_triplets_integration_weights_with_sigma(
num_triplets, frequencies, num_band, num_iw);
}

long py_get_grid_index_from_address(nb::ndarray<> py_address,
nb::ndarray<> py_D_diag) {
long *address;
long *D_diag;
long gp;

address = (long *)py_address.data();
D_diag = (long *)py_D_diag.data();

gp = ph3py_get_grid_index_from_address(address, D_diag);

return gp;
}

long py_get_ir_grid_map(nb::ndarray<> py_grid_mapping_table,
nb::ndarray<> py_D_diag, nb::ndarray<> py_is_shift,
nb::ndarray<> py_rotations) {
long *D_diag;
long *is_shift;
long(*rot)[3][3];
long num_rot;

long *grid_mapping_table;
long num_ir;

D_diag = (long *)py_D_diag.data();
is_shift = (long *)py_is_shift.data();
rot = (long(*)[3][3])py_rotations.data();
num_rot = (long)py_rotations.shape(0);
grid_mapping_table = (long *)py_grid_mapping_table.data();

num_ir = ph3py_get_ir_grid_map(grid_mapping_table, D_diag, is_shift, rot,
num_rot);
return num_ir;
}

void py_get_gr_grid_addresses(nb::ndarray<> py_gr_grid_addresses,
nb::ndarray<> py_D_diag) {
long(*gr_grid_addresses)[3];
long *D_diag;

gr_grid_addresses = (long(*)[3])py_gr_grid_addresses.data();
D_diag = (long *)py_D_diag.data();

ph3py_get_gr_grid_addresses(gr_grid_addresses, D_diag);
}

long py_get_reciprocal_rotations(nb::ndarray<> py_rec_rotations,
nb::ndarray<> py_rotations,
long is_time_reversal) {
long(*rec_rotations)[3][3];
long(*rotations)[3][3];
long num_rot, num_rec_rot;

rec_rotations = (long(*)[3][3])py_rec_rotations.data();
rotations = (long(*)[3][3])py_rotations.data();
num_rot = (long)py_rotations.shape(0);

num_rec_rot = ph3py_get_reciprocal_rotations(rec_rotations, rotations,
num_rot, is_time_reversal);

return num_rec_rot;
}

bool py_transform_rotations(nb::ndarray<> py_transformed_rotations,
nb::ndarray<> py_rotations, nb::ndarray<> py_D_diag,
nb::ndarray<> py_Q) {
long(*transformed_rotations)[3][3];
long(*rotations)[3][3];
long *D_diag;
long(*Q)[3];
long num_rot, succeeded;

transformed_rotations = (long(*)[3][3])py_transformed_rotations.data();
rotations = (long(*)[3][3])py_rotations.data();
D_diag = (long *)py_D_diag.data();
Q = (long(*)[3])py_Q.data();
num_rot = (long)py_transformed_rotations.shape(0);

succeeded = ph3py_transform_rotations(transformed_rotations, rotations,
num_rot, D_diag, Q);
if (succeeded) {
return true;
} else {
return false;
}
}

bool py_get_snf3x3(nb::ndarray<> py_D_diag, nb::ndarray<> py_P,
nb::ndarray<> py_Q, nb::ndarray<> py_A) {
long *D_diag;
long(*P)[3];
long(*Q)[3];
long(*A)[3];
long succeeded;

D_diag = (long *)py_D_diag.data();
P = (long(*)[3])py_P.data();
Q = (long(*)[3])py_Q.data();
A = (long(*)[3])py_A.data();

succeeded = ph3py_get_snf3x3(D_diag, P, Q, A);
if (succeeded) {
return true;
} else {
return false;
}
}

long py_get_bz_grid_addresses(nb::ndarray<> py_bz_grid_addresses,
nb::ndarray<> py_bz_map, nb::ndarray<> py_bzg2grg,
nb::ndarray<> py_D_diag, nb::ndarray<> py_Q,
nb::ndarray<> py_PS,
nb::ndarray<> py_reciprocal_lattice, long type) {
long(*bz_grid_addresses)[3];
long *bz_map;
long *bzg2grg;
long *D_diag;
long(*Q)[3];
long *PS;
double(*reciprocal_lattice)[3];
long num_total_gp;

bz_grid_addresses = (long(*)[3])py_bz_grid_addresses.data();
bz_map = (long *)py_bz_map.data();
bzg2grg = (long *)py_bzg2grg.data();
D_diag = (long *)py_D_diag.data();
Q = (long(*)[3])py_Q.data();
PS = (long *)py_PS.data();
reciprocal_lattice = (double(*)[3])py_reciprocal_lattice.data();

num_total_gp =
ph3py_get_bz_grid_addresses(bz_grid_addresses, bz_map, bzg2grg, D_diag,
Q, PS, reciprocal_lattice, type);

return num_total_gp;
}

long py_rotate_bz_grid_addresses(long bz_grid_index, nb::ndarray<> py_rotation,
nb::ndarray<> py_bz_grid_addresses,
nb::ndarray<> py_bz_map,
nb::ndarray<> py_D_diag, nb::ndarray<> py_PS,
long type) {
long(*bz_grid_addresses)[3];
long(*rotation)[3];
long *bz_map;
long *D_diag;
long *PS;
long ret_bz_gp;

bz_grid_addresses = (long(*)[3])py_bz_grid_addresses.data();
rotation = (long(*)[3])py_rotation.data();
bz_map = (long *)py_bz_map.data();
D_diag = (long *)py_D_diag.data();
PS = (long *)py_PS.data();

ret_bz_gp = ph3py_rotate_bz_grid_index(
bz_grid_index, rotation, bz_grid_addresses, bz_map, D_diag, PS, type);

return ret_bz_gp;
}

long py_get_default_colmat_solver() {
#if defined(MKL_BLAS) || defined(SCIPY_MKL_H) || !defined(NO_INCLUDE_LAPACKE)
return (long)1;
Expand Down
31 changes: 0 additions & 31 deletions c/phono3py.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,37 +176,6 @@ void ph3py_get_integration_weight_with_sigma(
const double *frequency_points, const long num_band0,
const long (*triplets)[3], const long num_triplets,
const double *frequencies, const long num_band, const long tp_type);
long ph3py_get_grid_index_from_address(const long address[3],
const long mesh[3]);
void ph3py_get_gr_grid_addresses(long gr_grid_addresses[][3],
const long D_diag[3]);
long ph3py_get_reciprocal_rotations(long rec_rotations[48][3][3],
const long (*rotations)[3][3],
const long num_rot,
const long is_time_reversal);
long ph3py_transform_rotations(long (*transformed_rots)[3][3],
const long (*rotations)[3][3],
const long num_rot, const long D_diag[3],
const long Q[3][3]);
long ph3py_get_snf3x3(long D_diag[3], long P[3][3], long Q[3][3],
const long A[3][3]);
long ph3py_transform_rotations(long (*transformed_rots)[3][3],
const long (*rotations)[3][3],
const long num_rot, const long D_diag[3],
const long Q[3][3]);
long ph3py_get_ir_grid_map(long *ir_grid_map, const long D_diag[3],
const long PS[3], const long (*grg_rotations)[3][3],
const long num_rot);
long ph3py_get_bz_grid_addresses(long (*bz_grid_addresses)[3], long *bz_map,
long *bzg2grg, const long D_diag[3],
const long Q[3][3], const long PS[3],
const double rec_lattice[3][3],
const long type);
long ph3py_rotate_bz_grid_index(const long bz_grid_index,
const long rotation[3][3],
const long (*bz_grid_addresses)[3],
const long *bz_map, const long D_diag[3],
const long PS[3], const long bz_grid_type);
void ph3py_symmetrize_collision_matrix(double *collision_matrix,
const long num_column,
const long num_temp,
Expand Down

0 comments on commit 0b67750

Please sign in to comment.