Skip to content

Commit 358c330

Browse files
committed
Now the __JULIA_EXT__ should work correctly
fixing issue #171
1 parent c5d1e34 commit 358c330

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

Modules/Ensemble.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,9 @@ def __init__(self, dyn0, T0, supercell = None, **kwargs):
265265
self.r_lat[i,:] = self.supercell_structure.coords[i, :] - \
266266
self.dyn_0.structure.coords[self.itau[i] - 1, :]
267267
self.r_lat *= CC.Units.A_TO_BOHR
268-
self.init_q_opposite()
268+
269+
if __JULIA_EXT__:
270+
self.init_q_opposite()
269271

270272
self.u_disps_original = np.zeros_like(self.u_disps)
271273
self.u_disps_original_qspace = np.zeros_like(self.u_disps_qspace)
@@ -488,7 +490,9 @@ def init(self):
488490
self.r_lat[i,:] = self.supercell_structure.coords[i, :] - \
489491
self.dyn_0.structure.coords[self.itau[i] - 1, :]
490492
self.r_lat *= CC.Units.A_TO_BOHR
491-
self.init_q_opposite()
493+
494+
if self.fourier_gradient:
495+
self.init_q_opposite()
492496

493497

494498

@@ -1318,11 +1322,12 @@ def init_q_opposite(self):
13181322
Setup the inverse q points.
13191323
13201324
This subroutine identifies the inverse of each q point from the dynamical matrix"""
1321-
bg = self.current_dyn.structure.get_reciprocal_vectors() / (2* np.pi )
1322-
self.q_opposite_index = julia.Main.get_opposite_q(
1323-
np.array(self.current_dyn.q_tot, dtype = np.float64),
1324-
bg
1325-
)
1325+
if self.fourier_gradient:
1326+
bg = self.current_dyn.structure.get_reciprocal_vectors() / (2* np.pi )
1327+
self.q_opposite_index = julia.Main.get_opposite_q(
1328+
np.array(self.current_dyn.q_tot, dtype = np.float64),
1329+
bg
1330+
)
13261331

13271332

13281333

0 commit comments

Comments
 (0)