Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jpopesculian committed Mar 13, 2024
1 parent 5299303 commit 0f0b212
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 63 deletions.
81 changes: 24 additions & 57 deletions quizx/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions quizx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ edition = "2018"
default-run = "hidden_shift_stabrank"

[dependencies]
num = "0.3.1"
num = "0.4.1"
rustc-hash = "1.1.0"
rayon = "1.5.0"
ndarray = { version = "0.14.0", features = [ "rayon" ] }
ndarray = { version = "0.15.6", features = [ "rayon" ] }
approx = "0.4.0"
regex = "1.4.3"
rand = "0.8.3"
Expand Down
9 changes: 5 additions & 4 deletions quizx/src/tensor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use ndarray::parallel::prelude::*;
use ndarray::*;
use std::collections::VecDeque;
use std::iter::FromIterator;
use std::convert::TryFrom;
use rustc_hash::FxHashMap;

/// Generic tensor type used by quizx
Expand Down Expand Up @@ -137,12 +138,12 @@ impl<A: TensorElem> CompareTensors for Tensor<A> {

impl<A: TensorElem> QubitOps<A> for Tensor<A> {
fn slice_qubit_mut(&mut self, q: usize) -> (ArrayViewMut<A, IxDyn>, ArrayViewMut<A, IxDyn>) {
let slice0: SliceInfo<_, IxDyn> = SliceInfo::new(Vec::from_iter((0..self.ndim()).map(|i| {
if i==q { SliceOrIndex::from(0) } else { SliceOrIndex::from(..) }
let slice0: SliceInfo<_, IxDyn, IxDyn> = SliceInfo::try_from(Vec::from_iter((0..self.ndim()).map(|i| {
if i==q { SliceInfoElem::from(0) } else { SliceInfoElem::from(..) }
}))).unwrap();

let slice1: SliceInfo<_, IxDyn> = SliceInfo::new(Vec::from_iter((0..self.ndim()).map(|i| {
if i==q { SliceOrIndex::from(1) } else { SliceOrIndex::from(..) }
let slice1: SliceInfo<_, IxDyn, IxDyn> = SliceInfo::try_from(Vec::from_iter((0..self.ndim()).map(|i| {
if i==q { SliceInfoElem::from(1) } else { SliceInfoElem::from(..) }
}))).unwrap();

self.multi_slice_mut((slice0.as_ref(), slice1.as_ref()))
Expand Down

0 comments on commit 0f0b212

Please sign in to comment.