Skip to content

Conversation

mhucka
Copy link
Collaborator

@mhucka mhucka commented Sep 6, 2025

Pytest with NumPy 2.2.6 reports the following warnings:

recirq/hfvqe/objective_test.py:51: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
    opdm_hw[p, q] = wf.conj().T @ operator @ wf

recirq/toric_code/toric_code_plaquettes.py:112: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.
    parities = data.applymap(

recirq/toric_code/toric_code_plaquettes.py:115: FutureWarning: Calling float on a single element Series is deprecated and will raise a TypeError in the future. Use float(ser.iloc[0]) instead
    return float(parities.mean())

This PR makes some minor modifications to the code to get rid of the warnings.

Pytest with NumPy 2.2.6 reports the following warnings:

```
recirq/hfvqe/objective_test.py:51: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
    opdm_hw[p, q] = wf.conj().T @ operator @ wf

recirq/toric_code/toric_code_plaquettes.py:112: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.
    parities = data.applymap(

recirq/toric_code/toric_code_plaquettes.py:115: FutureWarning: Calling float on a single element Series is deprecated and will raise a TypeError in the future. Use float(ser.iloc[0]) instead
    return float(parities.mean())
```

This PR makes some minor modifications to the code to get rid of the
warnings.
@mhucka mhucka marked this pull request as ready for review September 19, 2025 17:25
@mhucka mhucka enabled auto-merge (squash) September 19, 2025 17:25
@mhucka mhucka merged commit 5d56e3f into quantumlib:master Sep 19, 2025
11 checks passed
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.

2 participants