Skip to content

Commit

Permalink
Merge branch 'main' into feat/commutation
Browse files Browse the repository at this point in the history
  • Loading branch information
ss2165 committed Sep 20, 2023
2 parents 0d875b7 + 1d436e6 commit 37898f1
Show file tree
Hide file tree
Showing 10 changed files with 300 additions and 150 deletions.
6 changes: 1 addition & 5 deletions compile-matcher/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ use std::fs;
use std::path::Path;

use clap::Parser;
use hugr::hugr::views::{HierarchyView, SiblingGraph};
use hugr::ops::handle::DfgID;
use hugr::HugrView;
use itertools::Itertools;

use tket2::json::load_tk1_json_file;
Expand Down Expand Up @@ -65,9 +62,8 @@ fn main() {
let patterns = all_circs
.iter()
.filter_map(|circ| {
let circ: SiblingGraph<'_, DfgID> = SiblingGraph::new(circ, circ.root());
// Fail silently on empty or disconnected patterns
CircuitPattern::try_from_circuit(&circ).ok()
CircuitPattern::try_from_circuit(circ).ok()
})
.collect_vec();
println!("Loaded {} patterns.", patterns.len());
Expand Down
11 changes: 0 additions & 11 deletions src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ mod units;
pub use command::{Command, CommandIterator};
pub use hash::CircuitHash;

use hugr::hugr::NodeType;
use hugr::HugrView;

pub use hugr::ops::OpType;
Expand Down Expand Up @@ -119,16 +118,6 @@ pub trait Circuit: HugrView {
// Traverse the circuit in topological order.
CommandIterator::new(self)
}

/// Returns the [`NodeType`] of a command.
fn command_nodetype(&self, command: &Command) -> &NodeType {
self.get_nodetype(command.node())
}

/// Returns the [`OpType`] of a command.
fn command_optype(&self, command: &Command) -> &OpType {
self.get_optype(command.node())
}
}

impl<T> Circuit for T where T: HugrView {}
Expand Down
Loading

0 comments on commit 37898f1

Please sign in to comment.