diff --git a/src/circuit_json.rs b/src/circuit_json.rs index b187215..9e50fb5 100644 --- a/src/circuit_json.rs +++ b/src/circuit_json.rs @@ -13,18 +13,20 @@ pub struct Register(pub String, pub Vec); #[derive(Deserialize, Serialize, Clone, Debug, PartialEq)] pub struct CompositeGate { /// Name of the composite gate. - name: String, + pub name: String, /// Expressions corresponding to parameter values of the composite gate, if it has parameters. - args: Vec, + pub args: Vec, /// The circuit defining the gate. - definition: Box, + pub definition: Box, } /// A classical bit register. #[derive(Deserialize, Serialize, Clone, Debug, PartialEq, Eq, Hash)] pub struct BitRegister { - name: String, - size: u32, + /// Name of the bit register. + pub name: String, + /// Number of bits in the register. + pub size: u32, } /// A vector of booleans. @@ -60,16 +62,21 @@ pub enum ClassicalExpUnit { /// A box for holding classical expressions on Bits. #[derive(Deserialize, Serialize, Clone, Debug, PartialEq, Eq, Hash)] pub struct ClassicalExp { - args: Vec, - op: String, + /// Arguments to the expression. + pub args: Vec, + /// The expression. + pub op: String, } /// Decorates another op, adding a QASM-style classical condition. #[derive(Deserialize, Serialize, Clone, Debug, PartialEq)] pub struct Conditional { - op: Box, - width: u32, - value: u32, + /// Internal operation to conditionally apply. + pub op: Box, + /// Number of bits in the classical condition. + pub width: u32, + /// Value to compare against. + pub value: u32, } /// Serializable operation descriptor.