Closed oscarhiggott closed 2 years ago
Hi Oscar. Thanks for pointing out this issue. It appears as though cython doesn't yet natively support np.uint8
. I've changed the ldpc.c_util.numpy2char
so that it now accepts a python numpy object (rather than the cython one). Fortunately, this doesn't seem to noticeably alter performance. Could you test the latest version in the dev branch. If all works, I'll push the fix to pypi.
Great just tested it and it works now, thanks!
Firstly, thank you for creating this useful package.
When running the following code:
I get the following exception, along with a segmentation fault causing the python interpreter to crash:
And in case it helps here's some of the crash log:
The issue arises if in the line
syndrome=(surface_code.hz@error %2).astype(np.uint8)
if I use any numpy dtype other thanint
(e.g. I usednp.uint8
here). It would be nice to supportnp.uint8
anyway, but regardless the interpreter shouldn't crash if the dtype is incorrect.