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

UnitTests: TeleportationIdentityTestHelper is missing ResetAll(...) ? #37

Closed
StefH opened this issue Mar 17, 2018 · 3 comments
Closed

Comments

@StefH
Copy link

StefH commented Mar 17, 2018

When running the unit-tests for Teleportation, I get this error:

Message: Microsoft.Quantum.Simulation.Simulators.Exceptions.ReleasedQubitsAreNotInZeroState : Released qubits are not in zero state.

Solution is to add a ResetAll(anc); statement at line
https://github.com/Microsoft/Quantum/blob/master/Samples/UnitTesting/TeleportationTests.qs#L19

@StefH StefH changed the title UnitTests: TeleportationIdentityTestHelper is missing Reset() ? UnitTests: TeleportationIdentityTestHelper is missing ResetAll(...) ? Mar 17, 2018
@anpaz
Copy link
Member

anpaz commented Mar 19, 2018

Hi StefH,

The test as-is today should be working ok.
Inside the Teleporation method, we measure and reset the source qubit: https://github.com/Microsoft/Quantum/blob/bf27332e45a55b29db41f20b0bd9d466497ceb17/Samples/UnitTesting/Teleportation.qs#L71
so the SWAP should be taking anc back to a Zero state; ResetAll should not be needed.

Are you seeing instances where this is not the case?

@StefH
Copy link
Author

StefH commented Mar 19, 2018

Actually I wonder if this specific test is included in the test-run ? Which C# file starts this test ?

@anpaz
Copy link
Member

anpaz commented Mar 19, 2018

Yes, it is. This one, as most of other Q# tests from this project are discovered and executed by the SimulatorTestTargets:
https://github.com/Microsoft/Quantum/blob/bf27332e45a55b29db41f20b0bd9d466497ceb17/Samples/UnitTesting/QuantumSimulatorTestTargets.cs#L36

jwittner pushed a commit to jwittner/Quantum that referenced this issue Dec 16, 2019
Adding a sentence to the readme regarding language related issues.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants