File: 247.patch

package info (click to toggle)
python-symfc 1.5.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,980 kB
  • sloc: python: 10,485; makefile: 12
file content (36 lines) | stat: -rw-r--r-- 1,525 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 8eb17c0fe79481f652ccd8d1b962e92531a31d09 Mon Sep 17 00:00:00 2001
From: Atsuto Seko <sekocha@gmail.com>
Date: Wed, 22 Oct 2025 15:02:34 +0900
Subject: [PATCH] Use projector structures for FC2-basis test

---
 tests/basis_sets/test_basis_sets_O2.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/basis_sets/test_basis_sets_O2.py b/tests/basis_sets/test_basis_sets_O2.py
index 5ec3e64..ac4a8c1 100644
--- a/tests/basis_sets/test_basis_sets_O2.py
+++ b/tests/basis_sets/test_basis_sets_O2.py
@@ -27,16 +27,18 @@ def test_fc_basis_set_o2():
     )
 
     comp_mat = sbs.compression_matrix
-    np.testing.assert_allclose(comp_mat.data, [0.40824829046386313] * comp_mat.size)
+    proj = comp_mat @ comp_mat.T
+    np.testing.assert_allclose(proj.data, [1.0 / 6.0] * proj.size)
+
     ref_col = [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0]
     ref_row = [0, 4, 8, 9, 13, 17, 18, 22, 26, 27, 31, 35]
     np.testing.assert_array_equal(comp_mat.tocoo().col, ref_col)
     np.testing.assert_array_equal(comp_mat.tocoo().row, ref_row)
 
     compact_comp_mat = sbs.compact_compression_matrix
-    np.testing.assert_allclose(
-        compact_comp_mat.data, [0.40824829046386313] * compact_comp_mat.size
-    )
+    compact_proj = compact_comp_mat @ compact_comp_mat.T
+    np.testing.assert_allclose(compact_proj.data, [1.0 / 6.0] * compact_proj.size)
+
     ref_col = [0, 0, 0, 1, 1, 1]
     ref_row = [0, 4, 8, 9, 13, 17]
     np.testing.assert_array_equal(compact_comp_mat.tocoo().col, ref_col)