|
Ran
|
Jobs
1
|
Files
7
|
Run time
1min
|
Badge
README BADGES
|
push
github
Fix orbital rotation antisymmetry and in-place k_flat optimization (#410) (#413) Fix two bugs in orbital optimization: 1. _antisymmetric_matrix_from_upper_tri set the lower triangle via jnp.tril_indices(k_dim, k=-1) with -k_flat, but row-major order of the lower triangle differs from the transpose of the upper triangle for dimension 4 or greater. This caused K[j, i] != -K[i, j], so expm(K) was not orthogonal and rotate_integrals altered the spectrum of the Hamiltonian. Fixing this by subtracting upper.T from upper guarantees exact antisymmetry for all dimensions. 2. In _optimize_orbitals_sci, subtracting the JAX gradient array from k_flat (k_flat -= prev_update) resulted in Python rebinding the local variable rather than modifying the caller's NumPy array in place. Converting the JAX gradient with np.asarray ensures in-place subtraction updates the caller's array. Adds regression tests verifying that _antisymmetric_matrix_from_upper_tri generates strictly antisymmetric matrices, that rotate_integrals preserves the FCI spectrum for norb >= 4, and that optimize_orbitals updates k_flat in place. Fixes #390. (cherry picked from commit 2364dbc61) Co-authored-by: Mahizhan S <mahizhan2005@outlook.com> Co-authored-by: Jim Garrison <garrison@ibm.com>
4 of 4 new or added lines in 1 file covered. (100.0%)
731 of 802 relevant lines covered (91.15%)
0.91 hits per line
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 39524192983.1 | 7 |
91.15
|
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|