Skip to content

Commit

Permalink
use zdrot
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung committed Sep 20, 2023
1 parent 5ca031f commit 857a25d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions python/ffsim/slow/gates/orbital_rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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

0 comments on commit 857a25d

Please sign in to comment.