page_type | languages | products | urlFragment | description | |||
---|---|---|---|---|---|---|---|
sample |
|
|
simulator-with-overrides |
This sample demonstrates using Quantum Development Kit to create a quantum simulator that relies on full state simulator and redefines some of the built-in operations (measurements). |
This sample demonstrates using Q# to create a quantum simulator that relies on full state simulator and redefines some of the built-in operations (using measurements as an example).
- The Microsoft Quantum Development Kit.
This sample can be run in a number of different ways, depending on your preferred environment.
At a terminal, run the following command:
dotnet run
Open the folder containing this sample in Visual Studio ("Open a local folder" from the Getting Started screen or "File → Open → Folder..." from the menu bar) and set SimulatorWithOverrides.csproj
as the startup project.
Press Start in Visual Studio to run the sample.
- FaultyMeasurementsSimulator.cs: C# code that defines the simulator and the operation overrides in it.
- Operations.qs: Q# code used to demonstrate the simulator behavior.
- Host.cs: C# code to call the operations defined in Q#.
- SimulatorWithOverrides.csproj: Main C# project for the example.