Skip to content

Commit

Permalink
Add docstring to mod_2pi rust function
Browse files Browse the repository at this point in the history
  • Loading branch information
mtreinish committed Mar 8, 2023
1 parent d668a0d commit bcf0546
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/accelerate/src/euler_one_qubit_decomposer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ fn complex_phase(x: Complex64) -> f64 {
x.im.atan2(x.re)
}

/// Wrap angle into interval [-π,π). If within atol of the endpoint, clamp to -π
#[inline]
fn mod_2pi(angle: f64, atol: f64) -> f64 {
// f64::rem_euclid() isn't exactly the same as Python's % operator, but because
Expand Down

0 comments on commit bcf0546

Please sign in to comment.