Skip to content

Commit

Permalink
Fix typo in closest_partial_swap()
Browse files Browse the repository at this point in the history
This commit fixes a typo the formula in the function.
This is the same fix from Qiskit#11953.

Co-authored-by: Shelly Garion <46566946+ShellyGarion@users.noreply.github.com>
  • Loading branch information
mtreinish and ShellyGarion authored Mar 6, 2024
1 parent caa2440 commit 4f49fc6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/accelerate/src/two_qubit_decompose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ fn closest_partial_swap(a: f64, b: f64, c: f64) -> f64 {
let m = (a + b + c) / 3.;
let [am, bm, cm] = [a - m, b - m, c - m];
let [ab, bc, ca] = [a - b, b - c, c - a];
m + am * bm * cm * (6. + ab * ab + bc * bc * ca * ca) / 18.
m + am * bm * cm * (6. + ab * ab + bc * bc + ca * ca) / 18.
}

fn rx_matrix(theta: f64) -> Array2<Complex64> {
Expand Down

0 comments on commit 4f49fc6

Please sign in to comment.