CQCL / tket-json-rs

Rust data structure for serialising/deserialising TKET Circuit JSON v1
http://crates.io/crates/tket-json-rs
Apache License 2.0
2 stars 1 forks source link

fix!: Update ToffoliBox permutation type #64

Closed hannah-mcdougall closed 2 months ago

hannah-mcdougall commented 2 months ago

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 commented 2 months ago

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?