Skip to content

Commit

Permalink
refactor!: Remove deprecated exports
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Oct 15, 2024
1 parent f1d68bc commit cd036fa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 26 deletions.
3 changes: 0 additions & 3 deletions tket2/src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions tket2/src/ops.rs
Original file line number Diff line number Diff line change
@@ -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::{
Expand Down
9 changes: 2 additions & 7 deletions tket2/src/passes/commutation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,9 @@ impl Rewrite for PullForward {
}

fn invalidation_set(&self) -> impl Iterator<Item = Node> {
// 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)
}
}

Expand Down
14 changes: 0 additions & 14 deletions tket2/src/rewrite/strategy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,20 +349,6 @@ impl LexicographicCostFunction<fn(&OpType) -> 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> {
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
Expand Down

0 comments on commit cd036fa

Please sign in to comment.