Skip to content

Commit

Permalink
Add split_circ param to taso py bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Oct 5, 2023
1 parent 20685b1 commit 304082a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion pyrs/src/optimiser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,25 @@ impl PyDefaultTasoOptimiser {
///
/// Returns an optimised circuit and optionally log the progress to a CSV
/// file.
///
/// # Parameters
///
/// * `circ`: The circuit to optimise.
/// * `timeout`: The timeout in seconds.
/// * `n_threads`: The number of threads to use.
/// * `split_circ`: Whether to split the circuit into chunks before
/// processing.
///
/// If this option is set, the optimise will divide the circuit into
/// `n_threads` chunks and optimise each on a separate thread.
/// * `log_progress`: The path to a CSV file to log progress to.
///
pub fn optimise(
&self,
circ: PyObject,
timeout: Option<u64>,
n_threads: Option<NonZeroUsize>,
split_circ: Option<bool>,
log_progress: Option<PathBuf>,
) -> PyResult<PyObject> {
let taso_logger = log_progress
Expand All @@ -61,7 +75,7 @@ impl PyDefaultTasoOptimiser {
taso_logger,
timeout,
n_threads.unwrap_or(NonZeroUsize::new(1).unwrap()),
false,
split_circ.unwrap_or(false),
)
})
}
Expand Down

0 comments on commit 304082a

Please sign in to comment.