microsoft/qdk

Public

mirrored fromhttps://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
7c4c1b4c424591b52bf0c1009540c321c7756e69

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

samples/circuit_integration/src/Main.qs

22lines · modecode

1/// # Sample
2/// Circuit Integration
3///
4/// # Description
5/// This sample demonstrates the ability to use circuit files in Q# projects.
6/// It shows how to import and use custom quantum circuits defined in their own files.
7/// The circuit file, JointMeasurement.qsc, contains a joint measurement circuit for three qubits.
8/// This circuit file can be opened in VS Code and edited with a visual editor.
9/// Here, we import a circuit for performing a joint measurement of three
10/// qubits, with one auxiliary qubit. The results of the measurements should always
11/// contain 1 or 3 `Zero` results.
12
13import JointMeasurement.JointMeasurement;
14
15/// Sample program using custom gates from a hardware provider.
16operation Main() : Result[] {
17 use qs = Qubit[4];
18 ApplyToEach(H, qs[0..2]);
19 let results = JointMeasurement(qs);
20 ResetAll(qs);
21 results
22}
23