-
Notifications
You must be signed in to change notification settings - Fork 6
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
refactor: Drop dead code from circuits, Hugr updates #30
Conversation
7608b3d
to
17189cf
Compare
Moved Command and related structs to a submodule, to clean a bit |
todo!() | ||
} | ||
|
||
fn name(&self) -> SmolStr { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be indented? Do we not have the same formatting checks here as in hugr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module is commented out in circuit.rs
(because this doesn't compile), so rustfmt doesn't process it.
use super::operation::ToCircuitFail; | ||
//! Implementation of Hugr's CustomOp trait for the TKET1 bindings in `tket-rs`. | ||
//! | ||
//! TODO: This cannot be defined here. Should we do it in `hugr` or in `tket-rs`? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a bit of thought, I don't know. Maybe some of these TODOs should be opened as discussions?
/// Otherwise, it is described by an internal [`Wire`]. | ||
// | ||
// TODO Better name? | ||
// TODO Merge this with CircuitBuilder::AppendWire? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I think rename AppendWire to Unit and just use that
src/circuit.rs
Outdated
+ petgraph::visit::IntoNeighborsDirected | ||
+ petgraph::visit::IntoNodeIdentifiers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not quite right, as IntoNeighborsDirected
and IntoNodeIdentifiers
are implemented on references, so 'g T
. I'm trying to write that, but constraining the lifetimes is a bit of a headache.
Changing the traits to the new Region
trait in hugr should be straightforward once that's solved.
I added a last commit with the constraints on references and We now have a lifetime parameter in Circuit (which makes sense), but still have some ugly petgraph traits on the references (which doesn't). Since this is working, I'll merge it for now and open an issue to try to clean it up later. I'll also
|
This is mostly a code cleanup.
Circuit
as a trait on top ofHugrView
, and adds a couple of useful accessors (mostly TODOs).