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

Simulators behave differently when not resetting qubit array #1115

Open
weucode opened this issue Dec 16, 2022 · 0 comments
Open

Simulators behave differently when not resetting qubit array #1115

weucode opened this issue Dec 16, 2022 · 0 comments
Labels
bug Something isn't working needs triage An initial review by a maintainer is needed

Comments

@weucode
Copy link

weucode commented Dec 16, 2022

Describe the bug

When running the following program, SparseSimulator and ResourcesEstimator do not throw ReleasedQubitsAreNotInZeroState as QuantumSimulator and ToffoliSimulator do, although we do not use the ResetAll operation. The related code snippet is the within-apply block in ApplyTransposition. The link of code is here:
https://github.com/microsoft/QuantumLibraries/blob/987a2670e852ae77965b4b0b6873d2c5d3bcac69/Standard/src/Synthesis/Transposition.qs#L55
Does this an incomplete implementation of the within-apply block in two simulators?

To Reproduce

namespace TestPattern {
    
    open Microsoft.Quantum.Diagnostics;
    open Microsoft.Quantum.Arithmetic;
    open Microsoft.Quantum.Synthesis;


    @Test("QuantumSimulator")
    @Test("SparseSimulator")
    @Test("ResourcesEstimator")
    @Test("ToffoliSimulator")
    operation TestCorrect() : Unit {
        use QubitArray0 = Qubit[4];
        mutable qubits = LittleEndian(QubitArray0);
        mutable b = 15;
        mutable a = 0;
        mutable NISLResult = ApplyTransposition(a, b, qubits);
        // ResetAll(QubitArray0);
    }
}

Expected behavior

The four simulators should all throw the ReleasedQubitsAreNotInZeroState exception.

##Actual behavior
[xUnit.net 00:00:01.12] TestPattern.TestCorrect+QuantumSimulator.TestCorrect [FAIL]
[xUnit.net 00:00:01.12] TestPattern.TestCorrect+ToffoliSimulator.TestCorrect [FAIL]

System information

operating system:Windows 10

dotnet version:6.0.400

QDK:v0.27.244707

@weucode weucode added bug Something isn't working needs triage An initial review by a maintainer is needed labels Dec 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working needs triage An initial review by a maintainer is needed
Projects
None yet
Development

No branches or pull requests

1 participant