You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When explicitly stating the type parameter N of a DitStr it is possible to form a malformed DitStr where Int(dit_str) > D^N - 1. See the following example:
using BitBasis, Yao
julia> d =DitStr{2,2}(5)
101 ₍₂₎
julia>length(d)
2
julia>product_state(d)
ERROR: BoundsError:...
I am not sure if this will ever cause problems, but I am happy to open a PR with a consistency check in the inner constructor of DitStr.
The text was updated successfully, but these errors were encountered:
Thanks for the issue. I knew this one. I wanted to make some change but I am also worried about it may cause performance issue if we make any type of check since it is such an elementary type. On GPU, throwing an error is even not allowed. It also make sense if we do not make any check because our floating point numbers and integers never throw an error when the number overflows.
But I agree if we can add a checker for certain interface functions like product_state to prevent malformed user input.
When explicitly stating the type parameter
N
of aDitStr
it is possible to form a malformedDitStr
whereInt(dit_str) > D^N - 1
. See the following example:I am not sure if this will ever cause problems, but I am happy to open a PR with a consistency check in the inner constructor of
DitStr
.The text was updated successfully, but these errors were encountered: