Skip to content

Commit

Permalink
fix tests by using complex dtype for orbital rotations
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung committed Oct 13, 2024
1 parent 681012c commit 3b850d3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/python/variational/ucj_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 3b850d3

Please sign in to comment.