From 927a80e2293bbe391b48c0325f3a73efb0368f88 Mon Sep 17 00:00:00 2001 From: "Kevin J. Sung" Date: Wed, 29 May 2024 11:21:58 -0400 Subject: [PATCH] use random ucj utility --- tests/python/qiskit/ucj_test.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/tests/python/qiskit/ucj_test.py b/tests/python/qiskit/ucj_test.py index a231b7612..3a2d70d7e 100644 --- a/tests/python/qiskit/ucj_test.py +++ b/tests/python/qiskit/ucj_test.py @@ -26,23 +26,8 @@ def test_random_ucj_operator(norb: int, nelec: tuple[int, int]): n_reps = 3 dim = ffsim.dim(norb, nelec) for _ in range(3): - ucj_op = ffsim.UCJOperator( - diag_coulomb_mats_alpha_alpha=np.stack( - [ - ffsim.random.random_real_symmetric_matrix(norb, seed=rng) - for _ in range(n_reps) - ] - ), - diag_coulomb_mats_alpha_beta=np.stack( - [ - ffsim.random.random_real_symmetric_matrix(norb, seed=rng) - for _ in range(n_reps) - ] - ), - orbital_rotations=np.stack( - [ffsim.random.random_unitary(norb, seed=rng) for _ in range(n_reps)] - ), - final_orbital_rotation=ffsim.random.random_unitary(norb, seed=rng), + ucj_op = ffsim.random.random_ucj_operator( + norb, n_reps=n_reps, with_final_orbital_rotation=True, seed=rng ) gate = ffsim.qiskit.UCJOperatorJW(ucj_op)