Skip to content

Commit

Permalink
Updating to pyo3 0.22
Browse files Browse the repository at this point in the history
  • Loading branch information
ciaranra committed Oct 7, 2024
1 parent fcbded1 commit 8415a8c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 33 deletions.
42 changes: 13 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ keywords = ["scientific", "quantum", "QEC"]
categories = ["science", "simulation"]

[workspace.dependencies]
pyo3 = "0.20" # TODO: Upgrade to 0.22!
pyo3 = "0.22"
rand = "0.8"
rand_chacha = "0.3"
rand_xoshiro = "0.6"
Expand Down
8 changes: 5 additions & 3 deletions crates/pecos-python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,12 @@ impl SparseSim {
}

#[allow(clippy::too_many_lines)]
#[pyo3(signature = (symbol, location, params=None))]
fn run_gate(
&mut self,
symbol: &str,
location: &PyTuple,
params: Option<&PyDict>,
location: &Bound<'_, PyTuple>,
params: Option<&Bound<'_, PyDict>>,
) -> PyResult<Option<HashMap<usize, u8>>> {
match (symbol, location.len()) {
("X", 1) => {
Expand Down Expand Up @@ -453,6 +454,7 @@ impl SparseSim {
self.inner.destab_tableau()
}

#[pyo3(signature = (verbose=None, _print_y=None, print_destabs=None))]
fn print_stabs(
&self,
verbose: Option<bool>,
Expand Down Expand Up @@ -496,7 +498,7 @@ impl SparseSim {
}

#[pymodule]
fn _pecos_rslib(_py: Python, m: &PyModule) -> PyResult<()> {
fn _pecos_rslib(_py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_class::<SparseSim>()?;
Ok(())
}

0 comments on commit 8415a8c

Please sign in to comment.