Skip to content

Commit

Permalink
Fix some clippy complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
ElePT committed Sep 12, 2024
1 parent 28723d2 commit 479fbe0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions crates/accelerate/src/unitary_synthesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// copyright notice, and modified files need to carry a notice indicating
// that they have been altered from the originals.

// #[cfg(feature = "cache_pygates")]
#[cfg(feature = "cache_pygates")]
use std::cell::OnceCell;
use std::f64::consts::PI;
use std::hash::Hash;
Expand Down Expand Up @@ -60,7 +60,7 @@ enum DecomposerType {

#[derive(Clone, Debug)]
enum UnitarySynthesisReturnType {
DAGType(DAGCircuit),
DAGType(Box<DAGCircuit>),
TwoQSequenceType(TwoQubitUnitarySequence),
}

Expand Down Expand Up @@ -185,7 +185,7 @@ fn dag_from_2q_gate_sequence(
clbits: target_dag.cargs_interner.get_default(),
params: new_params,
extra_attrs: None,
// #[cfg(feature = "cache_pygates")]
#[cfg(feature = "cache_pygates")]
py_op: OnceCell::new(),
};
instructions.push(pi);
Expand Down Expand Up @@ -423,7 +423,7 @@ fn py_run_default_main_loop(
UnitarySynthesisReturnType::DAGType(synth_dag) => synth_dag,
UnitarySynthesisReturnType::TwoQSequenceType(
synth_sequence,
) => dag_from_2q_gate_sequence(py, synth_sequence)?,
) => Box::new(dag_from_2q_gate_sequence(py, synth_sequence)?),
};

let _ = out_dag.set_global_phase(add_global_phase(
Expand Down Expand Up @@ -1060,7 +1060,7 @@ fn synth_su4(
};

match preferred_direction {
None => Ok(UnitarySynthesisReturnType::DAGType(synth_dag)),
None => Ok(UnitarySynthesisReturnType::DAGType(Box::new(synth_dag))),
Some(preferred_dir) => {
let mut synth_direction: Option<Vec<u32>> = None;
for node in synth_dag.topological_op_nodes()? {
Expand All @@ -1074,7 +1074,7 @@ fn synth_su4(
}
// synth direction is in the relative basis
match synth_direction {
None => Ok(UnitarySynthesisReturnType::DAGType(synth_dag)),
None => Ok(UnitarySynthesisReturnType::DAGType(Box::new(synth_dag))),
Some(synth_direction) => {
let synth_dir = match synth_direction.as_slice() {
[0, 1] => true,
Expand All @@ -1090,7 +1090,7 @@ fn synth_su4(
decomposer_gate_params,
)
} else {
Ok(UnitarySynthesisReturnType::DAGType(synth_dag))
Ok(UnitarySynthesisReturnType::DAGType(Box::new(synth_dag)))
}
}
}
Expand Down Expand Up @@ -1227,7 +1227,7 @@ fn reversed_synth_su4(
let _ = target_dag.push_back(py, inst.clone());
}
}
Ok(UnitarySynthesisReturnType::DAGType(target_dag))
Ok(UnitarySynthesisReturnType::DAGType(Box::new(target_dag)))
}

#[pymodule]
Expand Down

0 comments on commit 479fbe0

Please sign in to comment.