diff --git a/src/circuit_json.rs b/src/circuit_json.rs index 35b48fb..74111a4 100644 --- a/src/circuit_json.rs +++ b/src/circuit_json.rs @@ -180,9 +180,15 @@ pub struct Command

{ pub opgroup: Option, } -/// A permutation of the elements of a register. +/// A classic basis state permutation. +/// Used when defining Toffoli boxes. #[derive(Deserialize, Serialize, Clone, Debug, PartialEq, Eq, Hash)] -pub struct Permutation(pub Register, pub Register); +#[serde(transparent)] +pub struct Permutation(pub Vec<(Vec, Vec)>); + +/// An implicit permutation of the elements of a register. +#[derive(Deserialize, Serialize, Clone, Debug, PartialEq, Eq, Hash)] +pub struct ImplicitPermutation(pub Register, pub Register); /// Pytket canonical serialized circuit #[derive(Deserialize, Serialize, Clone, Debug, PartialEq)] @@ -199,7 +205,7 @@ pub struct SerialCircuit

{ /// Input bit registers. pub bits: Vec, /// Implicit permutation of the output qubits. - pub implicit_permutation: Vec, + pub implicit_permutation: Vec, } impl

Default for Operation

{