Skip to content

Commit

Permalink
Small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Renmusxd committed Oct 20, 2021
1 parent 97c6800 commit faf8cc8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
4 changes: 1 addition & 3 deletions src/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1122,9 +1122,7 @@ impl<'a> UnitaryBuilder for ConditionalContextBuilder<'a> {
let (cr, r) = self.split_absolute(r, &cindices_clone).unwrap();
self.set_conditional_register(cr);
let (rs, remaining) = self.split_absolute_many(r.unwrap(), &index_groups).unwrap();
if remaining.is_some() {
panic!("There should be no qubits remaining.");
}
assert!(!remaining.is_some(), "There should be no qubits remaining.");
rs
}

Expand Down
1 change: 0 additions & 1 deletion src/feynman_state/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ impl<P: Precision> FeynmanState<P> {
let memory_depth = pops.len() / 2;
let sub_ops = &pops[..memory_depth];
let mut mem = FeynmanMemory::<P>::new(self.memory_size, sub_ops);
// TODO consider doing this recursively to cut down total runtime.
mem.iter_mut().for_each(|(i, c)| {
*c = self.substate.rec_calculate_amplitude(
i as u64,
Expand Down
3 changes: 0 additions & 3 deletions src/sparse_state/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use std::cmp::max;
pub struct SparseQuantumState<P: Precision> {
n: u64,
state: Option<Vec<(u64, Complex<P>)>>,
multithread: bool,
}

impl<P: Precision> SparseQuantumState<P> {
Expand Down Expand Up @@ -55,7 +54,6 @@ impl<P: Precision> QuantumState<P> for SparseQuantumState<P> {
Self {
n,
state: Some(vec![(0, Complex::one())]),
multithread: true,
}
}

Expand Down Expand Up @@ -101,7 +99,6 @@ impl<P: Precision> QuantumState<P> for SparseQuantumState<P> {
Self {
n,
state: Some(cvec),
multithread: true,
}
}

Expand Down

0 comments on commit faf8cc8

Please sign in to comment.