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.
- {symfc-1.3.2/src/symfc.egg-info → symfc-1.3.3}/PKG-INFO +1 -1
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/matrix_tools_O2.py +12 -11
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/matrix_tools_O3.py +11 -11
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/matrix_tools_O4.py +58 -58
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/version.py +1 -1
- {symfc-1.3.2 → symfc-1.3.3/src/symfc.egg-info}/PKG-INFO +1 -1
- {symfc-1.3.2 → symfc-1.3.3}/LICENSE +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/MANIFEST.in +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/README.md +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/pyproject.toml +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/setup.cfg +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/__init__.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/api_symfc.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/basis_sets/__init__.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/basis_sets/basis_sets_O1.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/basis_sets/basis_sets_O2.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/basis_sets/basis_sets_O3.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/basis_sets/basis_sets_O4.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/basis_sets/basis_sets_base.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/solvers/__init__.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/solvers/solver_O2.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/solvers/solver_O2O3.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/solvers/solver_O2O3O4.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/solvers/solver_O3.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/solvers/solver_O3O4.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/solvers/solver_O4.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/solvers/solver_base.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/spg_reps/__init__.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/spg_reps/spg_reps_O1.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/spg_reps/spg_reps_O2.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/spg_reps/spg_reps_O3.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/spg_reps/spg_reps_O4.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/spg_reps/spg_reps_base.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/__init__.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/cutoff_tools.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/eig_tools.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/matrix_tools.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/matrix_tools_O1.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/permutation_tools.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/permutation_tools_O2.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/permutation_tools_O3.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/permutation_tools_O4.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/rotation_dev/__init__.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/rotation_dev/run_rotation_tools_O2.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/rotation_dev/run_rotation_tools_O3.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/rotation_dev/run_test_O2.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/rotation_tools_O2.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/solver_funcs.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/utils.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/utils_O1.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/utils_O2.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/utils_O3.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc/utils/utils_O4.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc.egg-info/SOURCES.txt +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc.egg-info/dependency_links.txt +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc.egg-info/requires.txt +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/src/symfc.egg-info/top_level.txt +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/NaCl-unitcell.yaml +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/basis_sets/test_basis_sets_O2.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/basis_sets/test_basis_sets_O3.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/basis_sets/test_basis_sets_O4.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/basis_sets/test_basis_sets_base.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_GaN_222.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_GaN_442.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_NaCl_222.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_SiO2_221.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_Si_111_fc3_2.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_Si_111_fc3_3.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_Si_111_fc4_2.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_Si_111_fc4_3.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_Si_111_fc4_4.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/compact_fc_SnO2_223.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/conftest.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/dfset_GaN_222_rd.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/dfset_GaN_442_rd.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/dfset_NaCl_222_rd.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/dfset_SiO2_221_rd.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/dfset_Si_111_fc3_rd.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/dfset_SnO2_223_rd.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_NaCl_222.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_Si_111_fc3_2.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_Si_111_fc3_3.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_Si_111_fc4_2.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_Si_111_fc4_3.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_Si_111_fc4_4.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_Si_111_fc4_step_2.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_Si_111_fc4_step_3.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_Si_111_fc4_step_4.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/full_fc_SnO2_223.xz +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/perms_super.dat +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/phonopy_to_python.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/solvers/test_solver_utils.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/spg_reps/test_spg_reps_O1.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/spg_reps/test_spg_reps_O2.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/spg_reps/test_spg_reps_O3.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/spg_reps/test_spg_reps_O4.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/spg_reps/test_spg_reps_base.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/test_api.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_cutoff_tools.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_eig_tools.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_matrix_tools_O2.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_matrix_tools_O3.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_matrix_tools_O4.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_solver_funcs.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_utils.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_utils_O1.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_utils_O2.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_utils_O2_2.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_utils_O3.py +0 -0
- {symfc-1.3.2 → symfc-1.3.3}/tests/utils/test_utils_O4.py +0 -0
|
@@ -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
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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 /=
|
|
175
|
+
proj_cplmt /= natom
|
|
175
176
|
return scipy.sparse.identity(proj_cplmt.shape[0]) - proj_cplmt
|
|
176
177
|
|
|
177
178
|
|
|
178
|
-
def
|
|
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
|
|
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
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
nonzero = nonzero
|
|
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 /=
|
|
384
|
+
proj_cplmt /= natom
|
|
385
385
|
return scipy.sparse.identity(proj_cplmt.shape[0]) - proj_cplmt
|
|
386
386
|
|
|
387
387
|
|
|
388
|
-
def
|
|
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
|
|
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
|
|
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
|
-
|
|
310
|
-
|
|
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.
|
|
322
|
-
(
|
|
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
|
-
|
|
326
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
371
|
-
|
|
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
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
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.
|
|
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
|
-
|
|
407
|
-
|
|
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
|
|
|
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
|
|
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
|
|
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
|
|
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
|