Fix DF+Symmetry TD-SCF/Stability by Fixing JK
Showing 2 of 4 files from the diff.
psi4/src/psi4/libfock/jk.cc
changed.
psi4/src/psi4/libmints/matrix.h
changed.
Other files ignored by Codecov
doc/sphinxman/source/tdscf.rst
has changed.
tests/pytests/test_tdscf_products.py
has changed.
@@ -423,7 +423,9 @@
Loading
423 | 423 | } |
|
424 | 424 | delete[] temp; |
|
425 | 425 | ||
426 | - | // Transform C_right |
|
426 | + | // Transform the left-index of all C matrices from SO basis to AO basis. |
|
427 | + | ||
428 | + | // Transform C_left. Assumed totally symmetric. |
|
427 | 429 | for (size_t N = 0; N < D_.size(); ++N) { |
|
428 | 430 | // Input is already C1 |
|
429 | 431 | if (!input_symmetry_cast_map_[N]) { |
@@ -446,7 +448,7 @@
Loading
446 | 448 | } |
|
447 | 449 | } |
|
448 | 450 | ||
449 | - | // Transform C_left |
|
451 | + | // Transform C_right. Not assumed totally symmetric. |
|
450 | 452 | for (size_t N = 0; (N < D_.size()) && (!lr_symmetric_); ++N) { |
|
451 | 453 | // Input is already C1 |
|
452 | 454 | if (!input_symmetry_cast_map_[N]) { |
@@ -457,14 +459,17 @@
Loading
457 | 459 | int offset = 0; |
|
458 | 460 | int symm = D_[N]->symmetry(); |
|
459 | 461 | for (int h = 0; h < AO2USO_->nirrep(); ++h) { |
|
462 | + | // We MUST pack columns in the order in which they appear for totally symmetric C_left. |
|
463 | + | // This means we transform in order of h ^ symm, not in order of h. |
|
460 | 464 | int nao = AO2USO_->rowspi()[0]; |
|
461 | - | int nso = AO2USO_->colspi()[h]; |
|
465 | + | int nso = AO2USO_->colspi()[h ^ symm]; |
|
462 | 466 | int ncol = C_right_ao_[N]->colspi()[0]; |
|
463 | - | int ncolspi = C_right_[N]->colspi()[h ^ symm]; |
|
467 | + | // Remember: colspi_[h] describes not the orbitals of block h, but the orbitals that transform as h. |
|
468 | + | int ncolspi = C_right_[N]->colspi()[h]; |
|
464 | 469 | if (nso == 0 || ncolspi == 0) continue; |
|
465 | - | double** Up = AO2USO_->pointer(h); |
|
470 | + | double** Up = AO2USO_->pointer(h ^ symm); |
|
466 | 471 | double** CAOp = C_right_ao_[N]->pointer(); |
|
467 | - | double** CSOp = C_right_[N]->pointer(h); |
|
472 | + | double** CSOp = C_right_[N]->pointer(h ^ symm); |
|
468 | 473 | C_DGEMM('N', 'N', nao, ncolspi, nso, 1.0, Up[0], nso, CSOp[0], ncolspi, 0.0, &CAOp[0][offset], ncol); |
|
469 | 474 | offset += ncolspi; |
|
470 | 475 | } |
@@ -115,9 +115,9 @@
Loading
115 | 115 | double*** matrix_; |
|
116 | 116 | /// Number of irreps |
|
117 | 117 | int nirrep_; |
|
118 | - | /// Rows per irrep array |
|
118 | + | /// Rows per irrep array. Element "h" is associated with matrix block h. |
|
119 | 119 | Dimension rowspi_; |
|
120 | - | /// Columns per irrep array |
|
120 | + | /// Columns per irrep array. Element "h" is associated with matrix block h ^ symmetry_. |
|
121 | 121 | Dimension colspi_; |
|
122 | 122 | /// Name of the matrix |
|
123 | 123 | std::string name_; |
Files | Coverage |
---|---|
psi4 | 70.85% |
Project Totals (1471 files) | 70.85% |
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file.
The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files.
The size and color of each slice is representing the number of statements and the coverage, respectively.