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.

Allow defining simulator parameters in Q# @Test attribute #947

Open
@tcNickolas

Description

@tcNickolas

Please describe what you would like the feature to accomplish.
I'd like to be able to configure simulator parameters when specifying the simulator to use via @Test attribute, similarly to how we can do it when creating a simulator by hand in C# driver. This would allow me to do things like setting a fixed seed for randomized tests in the Katas to make their results reproducible.

Describe the solution you'd like
I don't have a particular syntax in mind. For example, we could add a new @SimulatorParameter attribute to specify simulator parameters by name:

@Test("QuantumSimulator")
@SimulatorParameter("randomNumberGeneratorSeed", "42")
@SimulatorParameter("disableBorrowing", "true")
operation RandmizedTest() : Unit { ... }

Describe alternatives you've considered
I could revert to defining tests in C# with the simulator created manually, but this makes the code a lot less elegant and maintainable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions