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

Latest commit

 

History

History
65 lines (48 loc) · 2.58 KB

README.md

File metadata and controls

65 lines (48 loc) · 2.58 KB
page_type languages products description
sample
qsharp
csharp
qdk
This sample uses `IQuantumProcessor` to generate quantum circuit diagrams from execution traces.

Generating quantum circuit diagrams from execution traces

This sample illustrates how IQuantumProcessor can be used to generate quantum circuit diagrams from Q# program execution traces, using the ⟨q|pic⟩ language. It makes uses of custom intrinsic operations and classical control transformations.

Prerequisites

Running the Sample

This sample can be run in a number of different ways, depending on your preferred environment.

C# in Visual Studio Code or the Command Line

At a terminal, run the following command (with example arguments for the inputs) in the host directory:

dotnet test

After running the tests, the directory bin/Debug/net6.0 contains ⟨q|pic⟩ circuit diagrams for the test cases. You can create picture files from them using the following commands (assuming that ⟨q|pic⟩ is installed):

cp bin/Debug/net6.0/t-injection.qpic .
qpic -f png t-injection.qpic

The resulting file will look as follows:

T injection circuit diagram

C# in Visual Studio 2019

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 host/host.csproj as the startup project. Press Start in Visual Studio to run the sample.

Manifest