Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps-rs)!: Update hugr to 0.13.1 #660

Merged
merged 3 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 56 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ missing_docs = "warn"
[workspace.dependencies]

# Make sure to run `just recompile-eccs` if the hugr serialisation format changes.
hugr = "0.13.0"
hugr-core = "0.10.0"
hugr-cli = "0.6.0"
hugr = "0.13.1"
hugr-core = "0.13.1"
hugr-cli = "0.13.1"
portgraph = "0.12"
pyo3 = "0.21.2"
itertools = "0.13.0"
Expand All @@ -42,7 +42,7 @@ clap = "4.5.19"
criterion = "0.5.1"
crossbeam-channel = "0.5.8"
csv = "1.2.2"
delegate = "0.13.0"
delegate = "0.13.1"
derive_more = "1.0.0"
downcast-rs = "1.2.0"
fxhash = "0.2.1"
Expand All @@ -51,13 +51,13 @@ num-complex = "0.4"
num-rational = "0.4"
num_cpus = "1.16.0"
peak_alloc = "0.2.0"
pest = "2.7.13"
pest_derive = "2.7.13"
pest = "2.7.14"
pest_derive = "2.7.14"
petgraph = { version = "0.6.3", default-features = false }
priority-queue = "2.1.1"
rayon = "1.5"
rmp-serde = "1.1.2"
rstest = "0.19.0"
rstest = "0.23.0"
serde = "1.0"
serde_json = "1.0"
smol_str = "0.3.1"
Expand Down
9 changes: 6 additions & 3 deletions tket2-hseries/src/extension/hseries/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ fn build_to_radians(b: &mut DFGBuilder<Hugr>, rotation: Wire) -> Result<Wire, Bu

/// Lower `Tk2Op` operations to `HSeriesOp` operations.
pub fn lower_tk2_op(hugr: &mut impl HugrMut) -> Result<Vec<hugr::Node>, LowerTk2Error> {
let replaced_nodes = lower_direct(hugr)?;
let mut replaced_nodes = lower_direct(hugr)?;
let mut hugr_map: HashMap<Tk2Op, Hugr> = HashMap::new();
for op in Tk2Op::iter() {
match op_to_hugr(op) {
Expand All @@ -122,9 +122,12 @@ pub fn lower_tk2_op(hugr: &mut impl HugrMut) -> Result<Vec<hugr::Node>, LowerTk2
};
}

let lowered_nodes = hugr::algorithms::lower_ops(hugr, |op| hugr_map.get(&op.cast()?).cloned())?;
let lowered_nodes = hugr::algorithms::lower_ops(hugr, |op| hugr_map.get(&op.cast()?).cloned())?
.into_iter()
.map(|(n, _)| n);

Ok([replaced_nodes, lowered_nodes].concat())
replaced_nodes.extend(lowered_nodes);
Ok(replaced_nodes)
}

fn lower_direct(hugr: &mut impl HugrMut) -> Result<Vec<Node>, LowerTk2Error> {
Expand Down
4 changes: 1 addition & 3 deletions tket2/src/serialize/pytket/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,7 @@ impl Tk1Decoder {
let res = hugr.add_dataflow_op(op, input_wires).unwrap_or_else(|e| {
panic!("Error while decoding pytket operation parameter \"{param}\". {e}",)
});
// TODO: Replace with `res.num_value_outputs`
// https://github.com/CQCL/hugr/pull/1560
assert_eq!(res.outputs().count(), 1, "An operation decoded from the pytket op parameter \"{param}\" had {} outputs", res.outputs().count());
assert_eq!(res.num_value_outputs(), 1, "An operation decoded from the pytket op parameter \"{param}\" had {} outputs", res.num_value_outputs());
LoadedParameter::float(res.out_wire(0))
}
}
Expand Down
Loading