Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue running example from README.md with decode_batch #97

Closed
cicero-a opened this issue Jul 1, 2024 · 3 comments
Closed

Issue running example from README.md with decode_batch #97

cicero-a opened this issue Jul 1, 2024 · 3 comments

Comments

@cicero-a
Copy link

cicero-a commented Jul 1, 2024

While the example with decode works as expected, using the example with decode_batch returns the following error:

Traceback (most recent call last):
  File "/home/accel-team/ciceroa/MWPM-pyMatching/test-pymatching2.py", line 12, in <module>
    predicted_observables = matching.decode_batch(syndrome)
  File "/home/accel-team/ciceroa/MWPM-pyMatching/.venv-pymatch/lib/python3.10/site-packages/pymatching/matching.py", line 419, in decode_batch
    predictions, weights = self._matching_graph.decode_batch(
ValueError: resize only works on single-segment arrays

Is this due to a not specified library dependency?

@oscarhiggott
Copy link
Owner

Thanks for flagging this. This issue has been caused by the recent release of numpy 2.0. You might consider downgrading to pip install numpy==1.26.4 while I get this fixed.

@jeromejavelle-seeqc
Copy link

Same issue experienced on my end on a simple decoding using a check matrix and an 8-bit trivial syndrome. Maybe a first fix could to explicitly restrict the numpy dependency to major version 1.x.x until support for numpy 2.x.x is complete, in the pymatching toml file?

@oscarhiggott
Copy link
Owner

I've pinned to numpy==1.* in #100, which is now released in pymatching v2.2.1 on pypi.

Ideally pymatching would support numpy v2, however that will require fixing a bug introduced when updating the the required version of pybind11. Since this problem is described in the open issue #102, I'll close this issue since the pin to numpy v1 fixes it in the meantime.

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

No branches or pull requests

3 participants