Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

New checks are required in SequenceL and SequenceI #662

Open
weucode opened this issue Mar 3, 2023 · 1 comment
Open

New checks are required in SequenceL and SequenceI #662

weucode opened this issue Mar 3, 2023 · 1 comment
Labels
Kind-Bug Something isn't working

Comments

@weucode
Copy link
Contributor

weucode commented Mar 3, 2023

Describe the bug
The checks in SequenceL and SequenceI are not complete now, the following situations will still throw unhandled exceptions. It suggested that update the boundary value for to-from.

To Reproduce
Testcase1

mutable result = SequenceL(0L, 9223372036854775806L);

Result1

Unhandled exception. Microsoft.Quantum.Simulation.Core.ExecutionFailException: `Length(bits)` must be less than 64, but was 64.

Testcas2( one of the three statements will throw the exception in Result2)

mutable result = SequenceL(0L, 2147483647L); // or
mutable result = SequenceI(0, 9223372036854775806); //or
mutable result = SequenceI(0, 2147483647);

Result2

Unhandled exception. System.OverflowException: Value was either too large or too small for an Int32.

Testcase3( one of the two statements will throw the exception in Result3)

mutable result = SequenceL(0L, 2147483646L); // or
mutable result = SequenceI(0, 2147483646);

Result3

Unhandled exception. System.OutOfMemoryException: Array dimensions exceeded supported range.

System information
operating system : Windows10 & Ubuntu18.04
dotnet version : 7.0.100
QDK : 0.27.258160

@weucode weucode added the Kind-Bug Something isn't working label Mar 3, 2023
@weucode
Copy link
Contributor Author

weucode commented Mar 28, 2023

I'd like to submit a PR to fix two APIs, but the value of to-from that will not throw an exception may be uncertain. Would you like to give me some suggestions about the proper value of to-from? @msoeken

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Kind-Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant