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

A problem about qubit register release #639

Open
@hofirstb19

Description

@hofirstb19

Description:

In the following test case, there is a strange memory release problem when the non-all-zero qubits are not measured, and the error line information is ambiguous because there is nothing to do in line 13. At the same time, if the X operation replaces IncrementByModularInteger, the same phenomenon will occur. And MultiM operation does not reset the measured qubits to the |0⟩ state. So can you give me some suggestions about why this behavior occurred?

Testcase

namespace NISLNameSpace {
	open Microsoft.Quantum.Intrinsic;
	open Microsoft.Quantum.Measurement;
	open Microsoft.Quantum.Arithmetic;
		
	@EntryPoint()
	operation main() : Unit {
		mutable constMultiplier = 88;
		mutable modulus = 1024;
		use summand = Qubit[10];
		let summandLE = LittleEndian(summand);
		IncrementByModularInteger(constMultiplier, modulus, summandLE);
		// X(summand[0]);
		// mutable result = MultiM(summandLE!);
		// Message($"{result}");
	}
}

Environment

operating system : Windows 11
dotnet version : 6.0.400
QDK : 0.25.228311

Metadata

Metadata

Assignees

No one assigned

    Labels

    Kind-BugSomething isn't workingKind-QuestionIssue is a question about Q# libraries, rather than a bug or enhancementPkg-StandardIssue relates to the Microsoft.Quantum.Standard package.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions