From 3b850d310fc979275c48299374bfa58d7c41bcf4 Mon Sep 17 00:00:00 2001 From: "Kevin J. Sung" Date: Sun, 13 Oct 2024 08:58:19 -0400 Subject: [PATCH] fix tests by using complex dtype for orbital rotations --- tests/python/variational/ucj_test.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/python/variational/ucj_test.py b/tests/python/variational/ucj_test.py index 2c3de272b..e6ca26bbe 100644 --- a/tests/python/variational/ucj_test.py +++ b/tests/python/variational/ucj_test.py @@ -35,9 +35,11 @@ def test_n_params(): ): diag_coulomb_mats_alpha_alpha = np.zeros((n_reps, norb, norb)) diag_coulomb_mats_alpha_beta = np.zeros((n_reps, norb, norb)) - orbital_rotations = np.stack([np.eye(norb) for _ in range(n_reps)]) + orbital_rotations = np.stack( + [np.eye(norb, dtype=complex) for _ in range(n_reps)] + ) - final_orbital_rotation = np.eye(norb) + final_orbital_rotation = np.eye(norb, dtype=complex) operator = ffsim.UCJOperator( diag_coulomb_mats_alpha_alpha=diag_coulomb_mats_alpha_alpha, diag_coulomb_mats_alpha_beta=diag_coulomb_mats_alpha_beta, @@ -254,9 +256,11 @@ def test_real_ucj_n_params(): ): diag_coulomb_mats_alpha_alpha = np.zeros((n_reps, norb, norb)) diag_coulomb_mats_alpha_beta = np.zeros((n_reps, norb, norb)) - orbital_rotations = np.stack([np.eye(norb) for _ in range(n_reps)]) + orbital_rotations = np.stack( + [np.eye(norb, dtype=complex) for _ in range(n_reps)] + ) - final_orbital_rotation = np.eye(norb) + final_orbital_rotation = np.eye(norb, dtype=complex) operator = ffsim.RealUCJOperator( diag_coulomb_mats_alpha_alpha=diag_coulomb_mats_alpha_alpha, diag_coulomb_mats_alpha_beta=diag_coulomb_mats_alpha_beta,