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

fix: Add missing OpTypes #37

Merged
merged 5 commits into from
Apr 8, 2024
Merged

fix: Add missing OpTypes #37

merged 5 commits into from
Apr 8, 2024

Conversation

aborgna-q
Copy link
Collaborator

Adds the missing optypes listed in #36.

Fixes #30.

@aborgna-q aborgna-q requested a review from cqc-alec April 5, 2024 12:05
src/opbox.rs Outdated
pauli_gadgets: Vec<(Vec<String>, String)>,
/// Synthesis strategy. See [`PauliSynthStrat`].
#[serde(default)]
synthesis_strategy: PauliSynthStrat,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

@aborgna-q aborgna-q Apr 8, 2024

Choose a reason for hiding this comment

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

I did a full pass on the schema to ensure our definition is up-to-date.

Apparently some of the already-present box definitions where missing or incorrect, so I also fixed them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately #36 won't be able to catch mismatching attributes.

To validate that we'd need to add tests that construct each possible pytket optype and check it against the rust code 🤔

I may add a low-priority issue for that.

src/optype.rs Outdated
@@ -207,6 +213,12 @@ pub enum OpType {
/// \end{array} \right] \f$
CSXdg,

/// Controlled \ref OpType::S gate
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use rust style for cross-references rather than doxygen style. (Several more examples of this below.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

@aborgna-q aborgna-q requested a review from cqc-alec April 8, 2024 13:29
Copy link
Collaborator

@cqc-alec cqc-alec left a comment

Choose a reason for hiding this comment

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

Thanks!

src/opbox.rs Outdated Show resolved Hide resolved
Co-authored-by: Alec Edgington <54802828+cqc-alec@users.noreply.github.com>
@aborgna-q aborgna-q added this pull request to the merge queue Apr 8, 2024
Merged via the queue into main with commit eb525a1 Apr 8, 2024
5 checks passed
@aborgna-q aborgna-q deleted the feat/missing-ops branch April 8, 2024 13:47
@github-actions github-actions bot mentioned this pull request Apr 8, 2024
github-merge-queue bot pushed a commit that referenced this pull request Apr 8, 2024
## 🤖 New release
* `tket-json-rs`: 0.3.1 -> 0.4.0 (⚠️ API breaking changes)

### ⚠️ `tket-json-rs` breaking changes

```
--- failure enum_missing: pub enum removed or renamed ---

Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.30.0/src/lints/enum_missing.ron

Failed in:
  enum tket_json_rs::circuit_json::OpBox, previously in file /tmp/.tmpVNdz4z/tket-json-rs/src/circuit_json.rs:67
  enum tket_json_rs::circuit_json::ToffoliBoxSynthStrat, previously in file /tmp/.tmpVNdz4z/tket-json-rs/src/circuit_json.rs:302

--- failure struct_missing: pub struct removed or renamed ---

Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.30.0/src/lints/struct_missing.ron

Failed in:
  struct tket_json_rs::circuit_json::BoxID, previously in file /tmp/.tmpVNdz4z/tket-json-rs/src/circuit_json.rs:58
  struct tket_json_rs::circuit_json::PauliStabiliser, previously in file /tmp/.tmpVNdz4z/tket-json-rs/src/circuit_json.rs:51
```

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

## 0.4.0 (2024-04-08)

### Bug Fixes

- Add missing OpTypes
([#37](#37))

### Miscellaneous Tasks

- [**breaking**] Update pyo3 to 0.21
([#33](#33))

### Refactor

- Move `OpBox` to a new module
([#35](#35))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

---------

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Agustín Borgna <121866228+aborgna-q@users.noreply.github.com>
@github-actions github-actions bot mentioned this pull request Apr 8, 2024
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 missing ops
2 participants