Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into optimize-1q-more-rust
Browse files Browse the repository at this point in the history
mtreinish authored Jul 2, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents c1eb501 + 3fb1753 commit 6b3b3c1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/accelerate/src/synthesis/permutation/utils.rs
Original file line number Diff line number Diff line change
@@ -120,8 +120,10 @@ pub fn pattern_to_cycles(pattern: &ArrayView1<usize>) -> Vec<Vec<usize>> {
/// Periodic (or Python-like) access to a vector.
/// Util used below in ``decompose_cycles``.
#[inline]
fn pget(vec: &Vec<usize>, index: isize) -> Result<usize, PySequenceIndexError> {
let SequenceIndex::Int(wrapped) = PySequenceIndex::Int(index).with_len(vec.len())? else {unreachable!()};
fn pget(vec: &[usize], index: isize) -> Result<usize, PySequenceIndexError> {
let SequenceIndex::Int(wrapped) = PySequenceIndex::Int(index).with_len(vec.len())? else {
unreachable!()
};
Ok(vec[wrapped])
}

0 comments on commit 6b3b3c1

Please sign in to comment.