Skip to content

Commit

Permalink
Merge branch 'move-target' into replace-error-map
Browse files Browse the repository at this point in the history
  • Loading branch information
raynelfss committed Jun 3, 2024
2 parents 1eb522a + 76d1b11 commit 115cd54
Show file tree
Hide file tree
Showing 2 changed files with 259 additions and 45 deletions.
21 changes: 21 additions & 0 deletions crates/accelerate/src/target_transpiler/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,24 @@ impl Display for TargetKeyError {
}

impl Error for TargetKeyError {}

/// Error thrown when operation key is not present in the Target
#[derive(Debug)]
pub struct TargetTwoQubitInstError {
pub message: String,
}

impl TargetTwoQubitInstError {
/// Initializes the new error
pub fn new_err(message: String) -> Self {
Self { message }
}
}

impl Display for TargetTwoQubitInstError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.message)
}
}

impl Error for TargetTwoQubitInstError {}
Loading

0 comments on commit 115cd54

Please sign in to comment.