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: Make some missing fields pub #43

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions src/circuit_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,20 @@ pub struct Register(pub String, pub Vec<i64>);
#[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<String>,
pub args: Vec<String>,
/// The circuit defining the gate.
definition: Box<SerialCircuit>,
pub definition: Box<SerialCircuit>,
}

/// 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.
Expand Down Expand Up @@ -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<ClassicalExpUnit>,
op: String,
/// Arguments to the expression.
pub args: Vec<ClassicalExpUnit>,
/// 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<Operation>,
width: u32,
value: u32,
/// Internal operation to conditionally apply.
pub op: Box<Operation>,
/// Number of bits in the classical condition.
pub width: u32,
/// Value to compare against.
pub value: u32,
}

/// Serializable operation descriptor.
Expand Down
Loading