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.

Simulators behave differently when not resetting qubit array  #1115

Open
@weucode

Description

@weucode

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds triageAn initial review by a maintainer is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions