Skip to content

feat!: Shot count is now represented as an unsigned 32-bit, up from 16-bit, allowing for higher shot counts#509

Open
MarquessV wants to merge 6 commits into
mainfrom
332-increase-shot-limit
Open

feat!: Shot count is now represented as an unsigned 32-bit, up from 16-bit, allowing for higher shot counts#509
MarquessV wants to merge 6 commits into
mainfrom
332-increase-shot-limit

Conversation

@MarquessV

Copy link
Copy Markdown
Contributor

closes #332

@Shadow53 Shadow53 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a few u16s were missed, at least according to linting results.

Comment thread crates/python/src/executable.rs Outdated
registers: Vec<String>,
parameters: Vec<PyParameter>,
#[pyo3(from_py_with = "crate::from_py::optional_non_zero_u16")] shots: Option<NonZeroU16>,
#[pyo3(from_py_with = "crate::from_py::optional_non_zero_u16")] shots: Option<NonZeroU32>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting failure on crate::from_py::optional_non_zero_u16. Should probably be this?

Suggested change
#[pyo3(from_py_with = "crate::from_py::optional_non_zero_u16")] shots: Option<NonZeroU32>,
#[pyo3(from_py_with = "crate::from_py::optional_non_zero_u32")] shots: Option<NonZeroU32>,

#[setter]
pub fn set_trials(&mut self, trials: u16) -> PyResult<()> {
// `NonZeroU16` doesn't implement `PyClass`, so `pyo3` doesn't allow it to be used
// `NonZeroU32` doesn't implement `PyClass`, so `pyo3` doesn't allow it to be used

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like u16 is being used in this area (fn trials and fn set_trials) when it should be u32

(Commenting here because GH does not let me comment on non-diff lines)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also happens below in functions with the same names.

@github-actions

github-actions Bot commented Oct 23, 2024

Copy link
Copy Markdown
PR Preview Action v1.4.8
🚀 Deployed preview to https://rigetti.github.io/qcs-sdk-rust/pr-preview/pr-509/
on branch qcs-sdk-python-docs at 2024-10-24 17:55 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NonZeroU16 is unecessarily restrictive for QVM trials

2 participants