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

An abnormal behavior when giving a non-positive value to PurifiedMixedStateRequirements #570

Closed
weucode opened this issue Apr 21, 2022 · 0 comments
Assignees
Labels
good first issue Good for newcomers Kind-Bug Something isn't working Pkg-Standard Issue relates to the Microsoft.Quantum.Standard package. tracking This label will trigger gh-sync to create or update a mirror internal ADO issue.

Comments

@weucode
Copy link
Contributor

weucode commented Apr 21, 2022

Description

When give PurifiedMixedStateRequirements a non-positive value of parameter(targetError or nCoefficients),the program will fail to run. The following error message is showned.

Unhandled exception. System.OverflowException: Arithmetic operation resulted in an overflow.
---> NISLNameSpace.main on D:\00QuantumFuzzing\QsharpDemo\Program.qs:line 17

Unhandled exception: System.OverflowException: Arithmetic operation resulted in an overflow.
at System.Convert.ToInt64(Double value)

I think a check of values will be helpful. Looking forward to your reply. Thank you!

Testcase

namespace NameSpace {
	open Microsoft.Quantum.Intrinsic;
	open Microsoft.Quantum.Arithmetic;
	open Microsoft.Quantum.Preparation;

	@EntryPoint()
	operation main() : Unit {
		let var = PurifiedMixedStateRequirements(0.0,1);
		Message($"{var::NTotalQubits} {var::NIndexQubits} {var::NGarbageQubits }");
	}
}

Environment

operating system:Windows 10

dotnet version:5.0.301

QDK:v0.24.201332


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@msoeken msoeken self-assigned this Apr 21, 2022
@msoeken msoeken added Kind-Bug Something isn't working good first issue Good for newcomers Pkg-Standard Issue relates to the Microsoft.Quantum.Standard package. tracking This label will trigger gh-sync to create or update a mirror internal ADO issue. labels Apr 21, 2022
msoeken added a commit that referenced this issue Apr 21, 2022
msoeken added a commit that referenced this issue May 8, 2022
* Fixes #570. (#572)

* Fixes #571. (#573)

* Add DevSkim scanning (#576)

* Examples in fixed-point conversion functions.

* API review April 2022 (#561)

* API review April 2022

* Apply suggestions from code review

Co-authored-by: Mariia Mykhailova <mamykhai@microsoft.com>

* Update api-design-2022-04.md

* Update api-design-2022-04.md

Co-authored-by: Mariia Mykhailova <mamykhai@microsoft.com>

* Fixes #580. (#581)

* Address reviewer's feedback.

Co-authored-by: Angela Burton <anjbur@users.noreply.github.com>
Co-authored-by: Mariia Mykhailova <mamykhai@microsoft.com>
msoeken added a commit that referenced this issue May 12, 2022
* Fixes #570. (#572)

* Fixes #571. (#573)

* Add DevSkim scanning (#576)

* Examples in fixed-point conversion functions.

* API review April 2022 (#561)

* API review April 2022

* Apply suggestions from code review

Co-authored-by: Mariia Mykhailova <mamykhai@microsoft.com>

* Update api-design-2022-04.md

* Update api-design-2022-04.md

Co-authored-by: Mariia Mykhailova <mamykhai@microsoft.com>

* Fixes #580. (#581)

* Address reviewer's feedback.

Co-authored-by: Angela Burton <anjbur@users.noreply.github.com>
Co-authored-by: Mariia Mykhailova <mamykhai@microsoft.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers Kind-Bug Something isn't working Pkg-Standard Issue relates to the Microsoft.Quantum.Standard package. tracking This label will trigger gh-sync to create or update a mirror internal ADO issue.
Projects
None yet
Development

No branches or pull requests

2 participants