diff --git a/tket2/src/extension.rs b/tket2/src/extension.rs index eabf63e1..5c7c032d 100644 --- a/tket2/src/extension.rs +++ b/tket2/src/extension.rs @@ -21,9 +21,6 @@ pub mod rotation; pub mod sympy; use sympy::SympyOpDef; -/// Backwards compatible exports. -/// TODO: Remove in a breaking release. -pub use sympy::{SYM_EXPR_NAME, SYM_EXPR_T, SYM_OP_ID}; /// The ID of the TKET1 extension. pub const TKET1_EXTENSION_ID: ExtensionId = IdentList::new_unchecked("TKET1"); diff --git a/tket2/src/ops.rs b/tket2/src/ops.rs index 30c90185..2e8fb508 100644 --- a/tket2/src/ops.rs +++ b/tket2/src/ops.rs @@ -1,6 +1,6 @@ use crate::extension::rotation::ROTATION_TYPE; -use crate::extension::sympy::SympyOpDef; -use crate::extension::{SYM_OP_ID, TKET2_EXTENSION_ID as EXTENSION_ID}; +use crate::extension::sympy::{SympyOpDef, SYM_OP_ID}; +use crate::extension::TKET2_EXTENSION_ID as EXTENSION_ID; use hugr::ops::custom::ExtensionOp; use hugr::ops::NamedOp; use hugr::{ diff --git a/tket2/src/passes/commutation.rs b/tket2/src/passes/commutation.rs index cf4e1e8b..fc167023 100644 --- a/tket2/src/passes/commutation.rs +++ b/tket2/src/passes/commutation.rs @@ -281,14 +281,9 @@ impl Rewrite for PullForward { } fn invalidation_set(&self) -> impl Iterator { - // TODO: This could avoid creating a vec, but it'll be easier to do once - // return position impl trait is available. - // This is done in the Rewrite trait of hugr so once that version - // is released, it can be updated here - let mut nodes = vec![self.command.node()]; + let cmd_node = std::iter::once(self.command.node()); let next_nodes = self.new_nexts.values().map(|c| c.node()); - nodes.extend(next_nodes); - nodes.into_iter() + cmd_node.chain(next_nodes) } } diff --git a/tket2/src/rewrite/strategy.rs b/tket2/src/rewrite/strategy.rs index a55159ad..5658d9ff 100644 --- a/tket2/src/rewrite/strategy.rs +++ b/tket2/src/rewrite/strategy.rs @@ -349,20 +349,6 @@ impl LexicographicCostFunction usize, 2> { Self::cx_count().into_greedy_strategy() } - /// Non-increasing rewrite strategy based on CX count. - /// - /// A fine-grained cost function given by the total number of quantum gates - /// is used to rank circuits with equal CX count. - /// - /// This is probably a good default for NISQ-y circuit optimisation. - /// - /// Deprecated: Use `default_cx_strategy` instead. - // TODO: Remove this method in the next breaking release. - #[deprecated(since = "0.5.1", note = "Use `default_cx_strategy` instead.")] - pub fn default_cx() -> ExhaustiveGreedyStrategy { - Self::default_cx_strategy() - } - /// Non-increasing rewrite cost function based on CX gate count. /// /// A fine-grained cost function given by the total number of quantum gates