Skip to content

Commit

Permalink
Expose HamiltonianComponent fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Haadi-Khan committed Aug 2, 2024
1 parent c5cec5c commit dddaa67
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,18 @@ impl HamiltonianComponent {
}
}

pub fn time_fn(&self) -> &TimeDependentFn {
self.time_fn.as_ref().expect("Time function not set")
}

pub fn constant(&self) -> &Complex64 {
self.constant.as_ref().expect("Constant not set")
}

pub fn operator(&self) -> &Array2<Complex64> {
&self.operator
}

pub fn calculate(&self, t: f64) -> Array2<Complex64> {
let time_fn = self.time_fn.expect("Time function not set");
let constant = self.constant.expect("Constant not set");
Expand Down

0 comments on commit dddaa67

Please sign in to comment.