From 857a25d8bdb3bad003b650a79f597f0462b7112e Mon Sep 17 00:00:00 2001 From: "Kevin J. Sung" Date: Wed, 20 Sep 2023 18:41:18 -0400 Subject: [PATCH] use zdrot --- python/ffsim/slow/gates/orbital_rotation.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/python/ffsim/slow/gates/orbital_rotation.py b/python/ffsim/slow/gates/orbital_rotation.py index 4c8df796a..f95927e15 100644 --- a/python/ffsim/slow/gates/orbital_rotation.py +++ b/python/ffsim/slow/gates/orbital_rotation.py @@ -11,6 +11,7 @@ from __future__ import annotations import numpy as np +from scipy.linalg.blas import zdrot def gen_orbital_rotation_index_in_place_slow( @@ -74,7 +75,5 @@ def apply_givens_rotation_in_place_slow( phase_conj = phase.conjugate() for i, j in zip(slice1, slice2): vec[i] *= phase_conj - tmp = c * vec[i] + s * vec[j] - vec[j] = c * vec[j] - s * vec[i] - vec[i] = tmp + vec[i], vec[j] = zdrot(vec[i], vec[j], c, s) vec[i] *= phase