1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use std::fmt;

use super::Qubit;

#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct Reset {
    pub qubit: Option<Qubit>,
}

impl Reset {
    pub fn new(qubit: Option<Qubit>) -> Self {
        Self { qubit }
    }
}

impl fmt::Display for Reset {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match &self.qubit {
            Some(qubit) => write!(f, "RESET {qubit}"),
            None => write!(f, "RESET"),
        }
    }
}