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

feat: add more command helper methods #125

Merged
merged 3 commits into from
Sep 21, 2023
Merged

Conversation

aborgna-q
Copy link
Collaborator

@aborgna-q aborgna-q commented Sep 21, 2023

  • qubits units iterators
  • linear_unit_port query
  • check if a port is linear
  • implement traits without requiring bounds on Circ

Also, publicly export circuit::units (this required adding a missing doc).

Closes #124. Closes #123

- qubits units iterators
- linear_unit_port query
- implement traits without requiring bounds on Circ

Also, publicly export `circuit::units`
@aborgna-q aborgna-q requested a review from croyzor September 21, 2023 10:58
Some(core::cmp::Ordering::Equal) => {}
ord => return ord,
}
self.linear_units.partial_cmp(&other.linear_units)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this (and the node comparison above) should be calling cmp so that we can avoid the unwrap in the Ord instance below panicking

@aborgna-q aborgna-q requested a review from croyzor September 21, 2023 14:26
Copy link
Contributor

@croyzor croyzor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@aborgna-q aborgna-q merged commit 2aeba3e into main Sep 21, 2023
@aborgna-q aborgna-q deleted the feat/command-qubit-utils branch September 21, 2023 14:51
ss2165 pushed a commit that referenced this pull request Sep 25, 2023
- qubits units iterators
- linear_unit_port query
- check if a port is linear
- implement traits without requiring bounds on Circ

Also, publicly export `circuit::units` (this required adding a missing
doc).

Closes #124. Closes #123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Command::qubits Query whether a port is linear in a hugr / command
2 participants