Skip to content

Commit

Permalink
chore: Update hugr dep
Browse files Browse the repository at this point in the history
- Some base types were moved from `hugr::hugr::*` to the crate's root.
  • Loading branch information
aborgna-q committed Oct 27, 2023
1 parent 038bb70 commit 8fe36a5
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ members = ["pyrs", "compile-rewriter", "taso-optimiser"]

[workspace.dependencies]

quantinuum-hugr = { git = "https://github.com/CQCL-DEV/hugr", rev = "527cce5" }
quantinuum-hugr = { git = "https://github.com/CQCL-DEV/hugr", rev = "0beb165" }
portgraph = { version = "0.10" }
pyo3 = { version = "0.20" }
itertools = { version = "0.11.0" }
Expand Down
13 changes: 7 additions & 6 deletions src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,22 @@ pub mod units;
pub use command::{Command, CommandIterator};
pub use hash::CircuitHash;

use hugr::HugrView;

use derive_more::From;
use hugr::hugr::hugrmut::HugrMut;
use hugr::hugr::{NodeType, PortIndex};
use hugr::hugr::NodeType;
use hugr::ops::dataflow::IOTrait;
pub use hugr::ops::OpType;
use hugr::ops::{Input, Output, DFG};
use hugr::types::FunctionType;
pub use hugr::types::{EdgeKind, Signature, Type, TypeRow};
pub use hugr::{Node, Port, Wire};
use hugr::HugrView;
use hugr::PortIndex;
use itertools::Itertools;
use portgraph::Direction;
use thiserror::Error;

pub use hugr::ops::OpType;
pub use hugr::types::{EdgeKind, Signature, Type, TypeRow};
pub use hugr::{Node, Port, Wire};

use self::cost::CircuitCost;
use self::units::{filter, FilteredUnits, Units};

Expand Down
5 changes: 2 additions & 3 deletions src/circuit/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ use std::collections::hash_map::Entry;
use std::collections::{HashMap, HashSet};
use std::iter::FusedIterator;

use hugr::hugr::{NodeType, PortIndex};
use hugr::hugr::NodeType;
use hugr::ops::{OpTag, OpTrait};
use petgraph::visit as pv;

use super::units::filter::FilteredUnits;
use super::units::{filter, DefaultUnitLabeller, LinearUnit, UnitLabeller, Units};
use super::Circuit;

pub use hugr::hugr::CircuitUnit;
pub use hugr::ops::OpType;
pub use hugr::types::{EdgeKind, Signature, Type, TypeRow};
pub use hugr::{Direction, Node, Port, Wire};
pub use hugr::{CircuitUnit, Direction, Node, Port, PortIndex, Wire};

/// An operation applied to specific wires.
pub struct Command<'circ, Circ> {
Expand Down
2 changes: 1 addition & 1 deletion src/circuit/units.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ pub use filter::FilteredUnits;

use std::iter::FusedIterator;

use hugr::hugr::CircuitUnit;
use hugr::ops::OpTrait;
use hugr::types::{EdgeKind, Type, TypeRow};
use hugr::CircuitUnit;
use hugr::{Direction, Node, Port, Wire};

use crate::utils::type_is_linear;
Expand Down
2 changes: 1 addition & 1 deletion src/circuit/units/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//! possible.
use hugr::extension::prelude;
use hugr::hugr::CircuitUnit;
use hugr::types::Type;
use hugr::CircuitUnit;
use hugr::{Port, Wire};

use super::{DefaultUnitLabeller, LinearUnit, Units};
Expand Down
2 changes: 1 addition & 1 deletion src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub mod op;
#[cfg(test)]
mod tests;

use hugr::hugr::CircuitUnit;
use hugr::CircuitUnit;
#[cfg(feature = "pyo3")]
use pyo3::{create_exception, exceptions::PyException, PyErr};

Expand Down
2 changes: 1 addition & 1 deletion src/json/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ use hugr::builder::{CircuitBuilder, Container, DFGBuilder, Dataflow, DataflowHug
use hugr::extension::prelude::{PRELUDE_ID, QB_T};
use hugr::extension::ExtensionSet;

use hugr::hugr::CircuitUnit;
use hugr::ops::Const;
use hugr::std_extensions::arithmetic::float_types::FLOAT64_TYPE;
use hugr::types::FunctionType;
use hugr::CircuitUnit;
use hugr::{Hugr, Wire};

use serde_json::json;
Expand Down
2 changes: 1 addition & 1 deletion src/optimiser/taso/qtz_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use std::path::Path;

use hugr::builder::{DFGBuilder, Dataflow, DataflowHugr};
use hugr::extension::prelude::QB_T;
use hugr::hugr::CircuitUnit;
use hugr::ops::OpType as Op;
use hugr::std_extensions::arithmetic::float_types::FLOAT64_TYPE;
use hugr::types::{FunctionType, Type};
use hugr::CircuitUnit;
use hugr::Hugr as Circuit;
use itertools::Itertools;
use serde::{Deserialize, Serialize};
Expand Down
4 changes: 2 additions & 2 deletions src/passes/chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ use hugr::extension::ExtensionSet;
use hugr::hugr::hugrmut::HugrMut;
use hugr::hugr::views::sibling_subgraph::ConvexChecker;
use hugr::hugr::views::{HierarchyView, SiblingGraph, SiblingSubgraph};
use hugr::hugr::{HugrError, NodeMetadata, PortIndex};
use hugr::hugr::{HugrError, NodeMetadata};
use hugr::ops::handle::DataflowParentID;
use hugr::ops::OpType;
use hugr::types::{FunctionType, Signature};
use hugr::{Hugr, HugrView, Node, Port, Wire};
use hugr::{Hugr, HugrView, Node, Port, PortIndex, Wire};
use itertools::Itertools;

use crate::Circuit;
Expand Down
6 changes: 2 additions & 4 deletions src/passes/commutation.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use std::{collections::HashMap, rc::Rc};

use hugr::{
hugr::{hugrmut::HugrMut, CircuitUnit, HugrError, PortIndex, Rewrite},
Direction, Hugr, HugrView, Node, Port,
};
use hugr::hugr::{hugrmut::HugrMut, HugrError, Rewrite};
use hugr::{CircuitUnit, Direction, Hugr, HugrView, Node, Port, PortIndex};
use itertools::Itertools;
use portgraph::PortOffset;

Expand Down
5 changes: 3 additions & 2 deletions src/portmatching/matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ use super::{CircuitPattern, NodeID, PEdge, PNode};
use hugr::hugr::views::sibling_subgraph::{
ConvexChecker, InvalidReplacement, InvalidSubgraph, InvalidSubgraphBoundary,
};
use hugr::hugr::PortIndex;
use hugr::{hugr::views::SiblingSubgraph, ops::OpType, Hugr, Node, Port};
use hugr::hugr::views::SiblingSubgraph;
use hugr::ops::OpType;
use hugr::{Hugr, Node, Port, PortIndex};
use itertools::Itertools;
use portmatching::{
automaton::{LineBuilder, ScopeAutomaton},
Expand Down
2 changes: 1 addition & 1 deletion src/rewrite/ecc_rewriter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
//! of the Quartz repository.
use derive_more::{From, Into};
use hugr::hugr::PortIndex;
use hugr::ops::OpTrait;
use hugr::PortIndex;
use itertools::Itertools;
use portmatching::PatternID;
use std::{
Expand Down

0 comments on commit 8fe36a5

Please sign in to comment.