Skip to content

tket2::serialize::pytket should support hseries operations #612

@aborgna-q

Description

@aborgna-q

Hugrs can encode native hseries-specific operations for some expressions (e.g. ZZMax gates).

When trying to encode the hugr as a pytket circuit, we need to define operation equivalences between hugr extension ops and tket-json-rs ops.
This is done here for Tk2Ops:

pub fn try_from_tk2op(tk2op: Tk2Op) -> Option<Self> {
let serial_op = match tk2op {
Tk2Op::H => Tk1OpType::H,
Tk2Op::CX => Tk1OpType::CX,

However, we now also need to define the same equivalences for the operations in HSeriesOp but those are defined in a dependent crate.

It might be possible to do some dynamic dispatch magic here, or we may end up having to split the tket2 package so that the pytket converter can depend on hseries too...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions