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!: Update ToffoliBox permutation type #64

Merged

Conversation

hannah-mcdougall
Copy link
Contributor

@hannah-mcdougall hannah-mcdougall commented Aug 6, 2024

Updated ToffoliBox permutation type to match tket schema and nexus dataclasses. This inconsistency caused failures when getting circuits that include a ToffoliBox from the database.

BREAKING CHANGE: Renamed Permutation to ImplicitPermutation

@aborgna-q aborgna-q self-requested a review August 6, 2024 11:13
@hannah-mcdougall hannah-mcdougall changed the title Update ToffoliBox permutation type fix: Update ToffoliBox permutation type Aug 6, 2024
@aborgna-q
Copy link
Collaborator

aborgna-q commented Aug 6, 2024

Ouch. Seems like the current Permutation definition is only valid for SerialCircuit::implicit_permutation.

Would you mind renaming that struct to ImplicitPermutation and adding a

/// A classic basis state permutation.
///
/// Used when defining Toffoli boxes.
#[derive(Deserialize, Serialize, Clone, Debug, PartialEq, Eq, Hash)]
#[serde(transparent)]
pub struct Permutation(Vec<(Vec<bool>, Vec<bool>)>);

to use in the Toffoli box?

src/circuit_json.rs Outdated Show resolved Hide resolved
Co-authored-by: Agustín Borgna <[email protected]>
@hannah-mcdougall hannah-mcdougall added this pull request to the merge queue Aug 6, 2024
Merged via the queue into CQCL:main with commit 26440e6 Aug 6, 2024
7 checks passed
@hannah-mcdougall hannah-mcdougall deleted the toffoli-permutation-type branch August 6, 2024 12:49
@hugrbot hugrbot mentioned this pull request Aug 5, 2024
@aborgna-q aborgna-q changed the title fix: Update ToffoliBox permutation type fix!: Update ToffoliBox permutation type Aug 6, 2024
github-merge-queue bot pushed a commit that referenced this pull request Aug 6, 2024
## 🤖 New release
* `tket-json-rs`: 0.5.1 -> 0.6.0

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

<blockquote>

## 0.6.0 (2024-08-06)

### Bug Fixes

- Update ToffoliBox permutation type
([#64](#64))

### Features

- [**breaking**] Add support for WASM operations
([#61](#61))
</blockquote>


</p></details>

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

---------

Co-authored-by: Agustín Borgna <[email protected]>
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.

2 participants