From faf8cc885e367cf964862f2651bf22debc9e7c1f Mon Sep 17 00:00:00 2001 From: Sumner Hearth Date: Tue, 19 Oct 2021 23:18:32 -0400 Subject: [PATCH] Small cleanup --- src/builders.rs | 4 +--- src/feynman_state/state.rs | 1 - src/sparse_state/state.rs | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/builders.rs b/src/builders.rs index 979c8a5..8f6300e 100644 --- a/src/builders.rs +++ b/src/builders.rs @@ -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 } diff --git a/src/feynman_state/state.rs b/src/feynman_state/state.rs index 01ba112..f5d3961 100644 --- a/src/feynman_state/state.rs +++ b/src/feynman_state/state.rs @@ -103,7 +103,6 @@ impl FeynmanState

{ let memory_depth = pops.len() / 2; let sub_ops = &pops[..memory_depth]; let mut mem = FeynmanMemory::

::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, diff --git a/src/sparse_state/state.rs b/src/sparse_state/state.rs index ed37f22..bff5716 100644 --- a/src/sparse_state/state.rs +++ b/src/sparse_state/state.rs @@ -19,7 +19,6 @@ use std::cmp::max; pub struct SparseQuantumState { n: u64, state: Option)>>, - multithread: bool, } impl SparseQuantumState

{ @@ -55,7 +54,6 @@ impl QuantumState

for SparseQuantumState

{ Self { n, state: Some(vec![(0, Complex::one())]), - multithread: true, } } @@ -101,7 +99,6 @@ impl QuantumState

for SparseQuantumState

{ Self { n, state: Some(cvec), - multithread: true, } }