symfc 1.3.2__tar.gz → 1.3.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. {symfc-1.3.2/src/symfc.egg-info → symfc-1.3.3}/PKG-INFO +1 -1
  2. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/matrix_tools_O2.py +12 -11
  3. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/matrix_tools_O3.py +11 -11
  4. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/matrix_tools_O4.py +58 -58
  5. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/version.py +1 -1
  6. {symfc-1.3.2 → symfc-1.3.3/src/symfc.egg-info}/PKG-INFO +1 -1
  7. {symfc-1.3.2 → symfc-1.3.3}/LICENSE +0 -0
  8. {symfc-1.3.2 → symfc-1.3.3}/MANIFEST.in +0 -0
  9. {symfc-1.3.2 → symfc-1.3.3}/README.md +0 -0
  10. {symfc-1.3.2 → symfc-1.3.3}/pyproject.toml +0 -0
  11. {symfc-1.3.2 → symfc-1.3.3}/setup.cfg +0 -0
  12. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/__init__.py +0 -0
  13. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/api_symfc.py +0 -0
  14. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/basis_sets/__init__.py +0 -0
  15. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/basis_sets/basis_sets_O1.py +0 -0
  16. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/basis_sets/basis_sets_O2.py +0 -0
  17. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/basis_sets/basis_sets_O3.py +0 -0
  18. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/basis_sets/basis_sets_O4.py +0 -0
  19. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/basis_sets/basis_sets_base.py +0 -0
  20. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/solvers/__init__.py +0 -0
  21. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/solvers/solver_O2.py +0 -0
  22. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/solvers/solver_O2O3.py +0 -0
  23. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/solvers/solver_O2O3O4.py +0 -0
  24. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/solvers/solver_O3.py +0 -0
  25. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/solvers/solver_O3O4.py +0 -0
  26. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/solvers/solver_O4.py +0 -0
  27. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/solvers/solver_base.py +0 -0
  28. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/spg_reps/__init__.py +0 -0
  29. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/spg_reps/spg_reps_O1.py +0 -0
  30. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/spg_reps/spg_reps_O2.py +0 -0
  31. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/spg_reps/spg_reps_O3.py +0 -0
  32. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/spg_reps/spg_reps_O4.py +0 -0
  33. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/spg_reps/spg_reps_base.py +0 -0
  34. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/__init__.py +0 -0
  35. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/cutoff_tools.py +0 -0
  36. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/eig_tools.py +0 -0
  37. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/matrix_tools.py +0 -0
  38. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/matrix_tools_O1.py +0 -0
  39. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/permutation_tools.py +0 -0
  40. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/permutation_tools_O2.py +0 -0
  41. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/permutation_tools_O3.py +0 -0
  42. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/permutation_tools_O4.py +0 -0
  43. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/rotation_dev/__init__.py +0 -0
  44. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/rotation_dev/run_rotation_tools_O2.py +0 -0
  45. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/rotation_dev/run_rotation_tools_O3.py +0 -0
  46. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/rotation_dev/run_test_O2.py +0 -0
  47. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/rotation_tools_O2.py +0 -0
  48. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/solver_funcs.py +0 -0
  49. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/utils.py +0 -0
  50. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/utils_O1.py +0 -0
  51. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/utils_O2.py +0 -0
  52. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/utils_O3.py +0 -0
  53. {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/utils_O4.py +0 -0
  54. {symfc-1.3.2 → symfc-1.3.3}/src/symfc.egg-info/SOURCES.txt +0 -0
  55. {symfc-1.3.2 → symfc-1.3.3}/src/symfc.egg-info/dependency_links.txt +0 -0
  56. {symfc-1.3.2 → symfc-1.3.3}/src/symfc.egg-info/requires.txt +0 -0
  57. {symfc-1.3.2 → symfc-1.3.3}/src/symfc.egg-info/top_level.txt +0 -0
  58. {symfc-1.3.2 → symfc-1.3.3}/tests/NaCl-unitcell.yaml +0 -0
  59. {symfc-1.3.2 → symfc-1.3.3}/tests/basis_sets/test_basis_sets_O2.py +0 -0
  60. {symfc-1.3.2 → symfc-1.3.3}/tests/basis_sets/test_basis_sets_O3.py +0 -0
  61. {symfc-1.3.2 → symfc-1.3.3}/tests/basis_sets/test_basis_sets_O4.py +0 -0
  62. {symfc-1.3.2 → symfc-1.3.3}/tests/basis_sets/test_basis_sets_base.py +0 -0
  63. {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_GaN_222.xz +0 -0
  64. {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_GaN_442.xz +0 -0
  65. {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_NaCl_222.xz +0 -0
  66. {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_SiO2_221.xz +0 -0
  67. {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_Si_111_fc3_2.xz +0 -0
  68. {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_Si_111_fc3_3.xz +0 -0
  69. {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_Si_111_fc4_2.xz +0 -0
  70. {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_Si_111_fc4_3.xz +0 -0
  71. {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_Si_111_fc4_4.xz +0 -0
  72. {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_SnO2_223.xz +0 -0
  73. {symfc-1.3.2 → symfc-1.3.3}/tests/conftest.py +0 -0
  74. {symfc-1.3.2 → symfc-1.3.3}/tests/dfset_GaN_222_rd.xz +0 -0
  75. {symfc-1.3.2 → symfc-1.3.3}/tests/dfset_GaN_442_rd.xz +0 -0
  76. {symfc-1.3.2 → symfc-1.3.3}/tests/dfset_NaCl_222_rd.xz +0 -0
  77. {symfc-1.3.2 → symfc-1.3.3}/tests/dfset_SiO2_221_rd.xz +0 -0
  78. {symfc-1.3.2 → symfc-1.3.3}/tests/dfset_Si_111_fc3_rd.xz +0 -0
  79. {symfc-1.3.2 → symfc-1.3.3}/tests/dfset_SnO2_223_rd.xz +0 -0
  80. {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_NaCl_222.xz +0 -0
  81. {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_Si_111_fc3_2.xz +0 -0
  82. {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_Si_111_fc3_3.xz +0 -0
  83. {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_Si_111_fc4_2.xz +0 -0
  84. {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_Si_111_fc4_3.xz +0 -0
  85. {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_Si_111_fc4_4.xz +0 -0
  86. {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_Si_111_fc4_step_2.xz +0 -0
  87. {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_Si_111_fc4_step_3.xz +0 -0
  88. {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_Si_111_fc4_step_4.xz +0 -0
  89. {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_SnO2_223.xz +0 -0
  90. {symfc-1.3.2 → symfc-1.3.3}/tests/perms_super.dat +0 -0
  91. {symfc-1.3.2 → symfc-1.3.3}/tests/phonopy_to_python.py +0 -0
  92. {symfc-1.3.2 → symfc-1.3.3}/tests/solvers/test_solver_utils.py +0 -0
  93. {symfc-1.3.2 → symfc-1.3.3}/tests/spg_reps/test_spg_reps_O1.py +0 -0
  94. {symfc-1.3.2 → symfc-1.3.3}/tests/spg_reps/test_spg_reps_O2.py +0 -0
  95. {symfc-1.3.2 → symfc-1.3.3}/tests/spg_reps/test_spg_reps_O3.py +0 -0
  96. {symfc-1.3.2 → symfc-1.3.3}/tests/spg_reps/test_spg_reps_O4.py +0 -0
  97. {symfc-1.3.2 → symfc-1.3.3}/tests/spg_reps/test_spg_reps_base.py +0 -0
  98. {symfc-1.3.2 → symfc-1.3.3}/tests/test_api.py +0 -0
  99. {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_cutoff_tools.py +0 -0
  100. {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_eig_tools.py +0 -0
  101. {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_matrix_tools_O2.py +0 -0
  102. {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_matrix_tools_O3.py +0 -0
  103. {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_matrix_tools_O4.py +0 -0
  104. {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_solver_funcs.py +0 -0
  105. {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_utils.py +0 -0
  106. {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_utils_O1.py +0 -0
  107. {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_utils_O2.py +0 -0
  108. {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_utils_O2_2.py +0 -0
  109. {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_utils_O3.py +0 -0
  110. {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_utils_O4.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: symfc
3
- Version: 1.3.2
3
+ Version: 1.3.3
4
4
  Summary: This is the symfc module.
5
5
  Author-email: Atsuto Seko <seko@cms.mtl.kyoto-u.ac.jp>
6
6
  Maintainer-email: Atsushi Togo <atztogo@gmail.com>
@@ -103,7 +103,7 @@ def optimize_batch_size_sum_rules_O2(natom: int, n_batch: Optional[int] = None):
103
103
  return batch_size
104
104
 
105
105
 
106
- def compressed_projector_sum_rules_O2_index_atoms(
106
+ def compressed_projector_sum_rules_O2(
107
107
  trans_perms: np.ndarray,
108
108
  n_a_compress_mat: csr_array,
109
109
  atomic_decompr_idx: Optional[np.ndarray] = None,
@@ -135,14 +135,15 @@ def compressed_projector_sum_rules_O2_index_atoms(
135
135
  atomic_decompr_idx = _get_atomic_lat_trans_decompr_indices(trans_perms)
136
136
 
137
137
  decompr_idx = atomic_decompr_idx.reshape((natom, natom)).T.reshape(-1) * 9
138
- if fc_cutoff is None:
139
- indep_atoms = get_indep_atoms_by_lat_trans(trans_perms)
140
- nonzero = np.zeros((natom, natom), dtype=bool)
141
- nonzero[indep_atoms, :] = True
142
- nonzero = nonzero.reshape(-1)
143
- else:
144
- nonzero = fc_cutoff.nonzero_atomic_indices_fc2()
145
- nonzero = nonzero.reshape((natom, natom)).T.reshape(-1)
138
+
139
+ indep_atoms = get_indep_atoms_by_lat_trans(trans_perms)
140
+ nonzero = np.zeros((natom, natom), dtype=bool)
141
+ nonzero[indep_atoms, :] = True
142
+ nonzero = nonzero.reshape(-1)
143
+ if fc_cutoff is not None:
144
+ nonzero_c = fc_cutoff.nonzero_atomic_indices_fc2()
145
+ nonzero_c = nonzero_c.reshape((natom, natom)).T.reshape(-1)
146
+ nonzero = nonzero & nonzero_c
146
147
 
147
148
  batch_size = optimize_batch_size_sum_rules_O2(natom, n_batch=n_batch)
148
149
  ab = np.arange(9)
@@ -171,11 +172,11 @@ def compressed_projector_sum_rules_O2_index_atoms(
171
172
  c_sum_cplmt = dot_product_sparse(c_sum_cplmt, n_a_compress_mat, use_mkl=use_mkl)
172
173
  proj_cplmt += dot_product_sparse(c_sum_cplmt.T, c_sum_cplmt, use_mkl=use_mkl)
173
174
 
174
- proj_cplmt /= n_lp * natom
175
+ proj_cplmt /= natom
175
176
  return scipy.sparse.identity(proj_cplmt.shape[0]) - proj_cplmt
176
177
 
177
178
 
178
- def compressed_projector_sum_rules_O2(
179
+ def compressed_projector_sum_rules_O2_stable(
179
180
  trans_perms: np.ndarray,
180
181
  n_a_compress_mat: csr_array,
181
182
  atomic_decompr_idx: Optional[np.ndarray] = None,
@@ -308,7 +308,7 @@ def optimize_batch_size_sum_rules_O3(natom: int, n_batch: Optional[int] = None):
308
308
  return batch_size
309
309
 
310
310
 
311
- def compressed_projector_sum_rules_O3_indep_atoms(
311
+ def compressed_projector_sum_rules_O3(
312
312
  trans_perms: np.ndarray,
313
313
  n_a_compress_mat: csr_array,
314
314
  atomic_decompr_idx: Optional[np.ndarray] = None,
@@ -343,14 +343,14 @@ def compressed_projector_sum_rules_O3_indep_atoms(
343
343
 
344
344
  decompr_idx = atomic_decompr_idx.reshape((natom, NN)).T.reshape(-1) * 27
345
345
 
346
- if fc_cutoff is None:
347
- indep_atoms = get_indep_atoms_by_lat_trans(trans_perms)
348
- nonzero = np.zeros((natom, natom, natom), dtype=bool)
349
- nonzero[indep_atoms, :, :] = True
350
- nonzero = nonzero.reshape(-1)
351
- else:
352
- nonzero = fc_cutoff.nonzero_atomic_indices_fc3()
353
- nonzero = nonzero.reshape((natom, NN)).T.reshape(-1)
346
+ indep_atoms = get_indep_atoms_by_lat_trans(trans_perms)
347
+ nonzero = np.zeros((natom, natom, natom), dtype=bool)
348
+ nonzero[indep_atoms, :, :] = True
349
+ nonzero = nonzero.reshape(-1)
350
+ if fc_cutoff is not None:
351
+ nonzero_c = fc_cutoff.nonzero_atomic_indices_fc3()
352
+ nonzero_c = nonzero_c.reshape((natom, NN)).T.reshape(-1)
353
+ nonzero = nonzero & nonzero_c
354
354
 
355
355
  batch_size = optimize_batch_size_sum_rules_O3(natom, n_batch=n_batch)
356
356
  abc = np.arange(27)
@@ -381,11 +381,11 @@ def compressed_projector_sum_rules_O3_indep_atoms(
381
381
  c_sum_cplmt = dot_product_sparse(c_sum_cplmt, n_a_compress_mat, use_mkl=use_mkl)
382
382
  proj_cplmt += dot_product_sparse(c_sum_cplmt.T, c_sum_cplmt, use_mkl=use_mkl)
383
383
 
384
- proj_cplmt /= n_lp * natom
384
+ proj_cplmt /= natom
385
385
  return scipy.sparse.identity(proj_cplmt.shape[0]) - proj_cplmt
386
386
 
387
387
 
388
- def compressed_projector_sum_rules_O3(
388
+ def compressed_projector_sum_rules_O3_stable(
389
389
  trans_perms: np.ndarray,
390
390
  n_a_compress_mat: csr_array,
391
391
  atomic_decompr_idx: Optional[np.ndarray] = None,
@@ -255,7 +255,7 @@ def optimize_batch_size_sum_rules_O4(natom: int, n_batch: Optional[int] = None):
255
255
  return batch_size
256
256
 
257
257
 
258
- def compressed_projector_sum_rules_O4_indep_atoms(
258
+ def compressed_projector_sum_rules_O4(
259
259
  trans_perms: np.ndarray,
260
260
  n_a_compress_mat: csr_array,
261
261
  atomic_decompr_idx: Optional[np.ndarray] = None,
@@ -269,7 +269,7 @@ def compressed_projector_sum_rules_O4_indep_atoms(
269
269
  Calculate a complementary projector for sum rules.
270
270
  This is compressed by C_trans and n_a_compress_mat without
271
271
  allocating C_trans.
272
- Memory efficient version using get_atomic_lat_trans_decompr_indices_O3.
272
+ Memory efficient version using get_atomic_lat_trans_decompr_indices_O4.
273
273
 
274
274
  Return
275
275
  ------
@@ -289,42 +289,47 @@ def compressed_projector_sum_rules_O4_indep_atoms(
289
289
  atomic_decompr_idx = get_atomic_lat_trans_decompr_indices_O4(trans_perms)
290
290
 
291
291
  decompr_idx = atomic_decompr_idx.reshape((natom, NNN)).T.reshape(-1) * 81
292
-
293
- if fc_cutoff is None:
294
- indep_atoms = get_indep_atoms_by_lat_trans(trans_perms)
295
- nonzero = np.zeros((natom, natom, natom, natom), dtype=bool)
296
- nonzero[indep_atoms, :, :, :] = True
297
- nonzero = nonzero.reshape(-1)
298
- else:
292
+ if fc_cutoff is not None:
299
293
  nonzero = fc_cutoff.nonzero_atomic_indices_fc4()
300
294
  nonzero = nonzero.reshape((natom, NNN)).T.reshape(-1)
301
295
 
302
296
  batch_size = optimize_batch_size_sum_rules_O4(natom, n_batch=n_batch)
303
297
  abcd = np.arange(81)
304
298
  for begin, end in zip(*get_batch_slice(NNNN, batch_size)):
299
+ if verbose:
300
+ print("Complementary P (Sum rule):", str(end) + "/" + str(NNNN), flush=True)
305
301
  size = end - begin
306
302
  size_vector = size * 81
307
303
  size_row = size_vector // natom
308
304
 
309
- nonzero_b = nonzero[begin:end]
310
- size_data = np.count_nonzero(nonzero_b) * 81
311
- if size_data == 0:
312
- continue
313
-
314
- if verbose:
315
- print("Complementary P (Sum rule):", str(end) + "/" + str(NNN), flush=True)
316
- decompr_idx_b = decompr_idx[begin:end][nonzero_b]
317
- c_sum_cplmt = csr_array(
318
- (
319
- np.ones(size_data, dtype="double"),
305
+ if fc_cutoff is None:
306
+ c_sum_cplmt = csr_array(
320
307
  (
321
- np.repeat(np.arange(size_row), natom)[np.tile(nonzero_b, 81)],
322
- (abcd[:, None] + decompr_idx_b[None, :]).reshape(-1),
308
+ np.ones(size_vector, dtype="double"),
309
+ (
310
+ np.repeat(np.arange(size_row), natom),
311
+ (abcd[:, None] + decompr_idx[begin:end][None, :]).reshape(-1),
312
+ ),
323
313
  ),
324
- ),
325
- shape=(size_row, NNNN81 // n_lp),
326
- dtype="double",
327
- )
314
+ shape=(size_row, NNNN81 // n_lp),
315
+ dtype="double",
316
+ )
317
+ else:
318
+ nonzero_b = nonzero[begin:end]
319
+ decompr_idx_b = decompr_idx[begin:end][nonzero_b]
320
+ size_data = np.count_nonzero(nonzero_b) * 81
321
+ c_sum_cplmt = csr_array(
322
+ (
323
+ np.ones(size_data, dtype="double"),
324
+ (
325
+ np.repeat(np.arange(size_row), natom)[np.tile(nonzero_b, 81)],
326
+ (abcd[:, None] + decompr_idx_b[None, :]).reshape(-1),
327
+ ),
328
+ ),
329
+ shape=(size_row, NNNN81 // n_lp),
330
+ dtype="double",
331
+ )
332
+
328
333
  c_sum_cplmt = dot_product_sparse(c_sum_cplmt, n_a_compress_mat, use_mkl=use_mkl)
329
334
  proj_cplmt += dot_product_sparse(c_sum_cplmt.T, c_sum_cplmt, use_mkl=use_mkl)
330
335
 
@@ -332,7 +337,7 @@ def compressed_projector_sum_rules_O4_indep_atoms(
332
337
  return scipy.sparse.identity(proj_cplmt.shape[0]) - proj_cplmt
333
338
 
334
339
 
335
- def compressed_projector_sum_rules_O4(
340
+ def compressed_projector_sum_rules_O4_indep_atoms(
336
341
  trans_perms: np.ndarray,
337
342
  n_a_compress_mat: csr_array,
338
343
  atomic_decompr_idx: Optional[np.ndarray] = None,
@@ -346,7 +351,7 @@ def compressed_projector_sum_rules_O4(
346
351
  Calculate a complementary projector for sum rules.
347
352
  This is compressed by C_trans and n_a_compress_mat without
348
353
  allocating C_trans.
349
- Memory efficient version using get_atomic_lat_trans_decompr_indices_O4.
354
+ Memory efficient version using get_atomic_lat_trans_decompr_indices_O3.
350
355
 
351
356
  Return
352
357
  ------
@@ -366,47 +371,42 @@ def compressed_projector_sum_rules_O4(
366
371
  atomic_decompr_idx = get_atomic_lat_trans_decompr_indices_O4(trans_perms)
367
372
 
368
373
  decompr_idx = atomic_decompr_idx.reshape((natom, NNN)).T.reshape(-1) * 81
374
+
375
+ indep_atoms = get_indep_atoms_by_lat_trans(trans_perms)
376
+ nonzero = np.zeros((natom, natom, natom, natom), dtype=bool)
377
+ nonzero[indep_atoms, :, :, :] = True
378
+ nonzero = nonzero.reshape(-1)
369
379
  if fc_cutoff is not None:
370
- nonzero = fc_cutoff.nonzero_atomic_indices_fc4()
371
- nonzero = nonzero.reshape((natom, NNN)).T.reshape(-1)
380
+ nonzero_c = fc_cutoff.nonzero_atomic_indices_fc4()
381
+ nonzero_c = nonzero_c.reshape((natom, NNN)).T.reshape(-1)
382
+ nonzero = nonzero & nonzero_c
372
383
 
373
384
  batch_size = optimize_batch_size_sum_rules_O4(natom, n_batch=n_batch)
374
385
  abcd = np.arange(81)
375
386
  for begin, end in zip(*get_batch_slice(NNNN, batch_size)):
376
- if verbose:
377
- print("Complementary P (Sum rule):", str(end) + "/" + str(NNNN), flush=True)
378
387
  size = end - begin
379
388
  size_vector = size * 81
380
389
  size_row = size_vector // natom
381
390
 
382
- if fc_cutoff is None:
383
- c_sum_cplmt = csr_array(
384
- (
385
- np.ones(size_vector, dtype="double"),
386
- (
387
- np.repeat(np.arange(size_row), natom),
388
- (abcd[:, None] + decompr_idx[begin:end][None, :]).reshape(-1),
389
- ),
390
- ),
391
- shape=(size_row, NNNN81 // n_lp),
392
- dtype="double",
393
- )
394
- else:
395
- nonzero_b = nonzero[begin:end]
396
- decompr_idx_b = decompr_idx[begin:end][nonzero_b]
397
- size_data = np.count_nonzero(nonzero_b) * 81
398
- c_sum_cplmt = csr_array(
391
+ nonzero_b = nonzero[begin:end]
392
+ size_data = np.count_nonzero(nonzero_b) * 81
393
+ if size_data == 0:
394
+ continue
395
+
396
+ if verbose:
397
+ print("Complementary P (Sum rule):", str(end) + "/" + str(NNN), flush=True)
398
+ decompr_idx_b = decompr_idx[begin:end][nonzero_b]
399
+ c_sum_cplmt = csr_array(
400
+ (
401
+ np.ones(size_data, dtype="double"),
399
402
  (
400
- np.ones(size_data, dtype="double"),
401
- (
402
- np.repeat(np.arange(size_row), natom)[np.tile(nonzero_b, 81)],
403
- (abcd[:, None] + decompr_idx_b[None, :]).reshape(-1),
404
- ),
403
+ np.repeat(np.arange(size_row), natom)[np.tile(nonzero_b, 81)],
404
+ (abcd[:, None] + decompr_idx_b[None, :]).reshape(-1),
405
405
  ),
406
- shape=(size_row, NNNN81 // n_lp),
407
- dtype="double",
408
- )
409
-
406
+ ),
407
+ shape=(size_row, NNNN81 // n_lp),
408
+ dtype="double",
409
+ )
410
410
  c_sum_cplmt = dot_product_sparse(c_sum_cplmt, n_a_compress_mat, use_mkl=use_mkl)
411
411
  proj_cplmt += dot_product_sparse(c_sum_cplmt.T, c_sum_cplmt, use_mkl=use_mkl)
412
412
 
@@ -1,3 +1,3 @@
1
1
  """Version number of the package."""
2
2
 
3
- __version__ = "1.3.2"
3
+ __version__ = "1.3.3"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: symfc
3
- Version: 1.3.2
3
+ Version: 1.3.3
4
4
  Summary: This is the symfc module.
5
5
  Author-email: Atsuto Seko <seko@cms.mtl.kyoto-u.ac.jp>
6
6
  Maintainer-email: Atsushi Togo <atztogo@gmail.com>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes