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

Latest commit

 

History

History
37 lines (24 loc) · 2.68 KB

File metadata and controls

37 lines (24 loc) · 2.68 KB
page_type languages products description urlFragment
sample
qsharp
qdk
This sample uses the Q# standard libraries to implement a syndrome for detecting errors in a given number of data qubits.
quantum-syndrome

Measuring quantum error syndromes with Q#

This sample demonstrates how to create a partially implemented Syndrome for detecting errors generated in noisy hardware. The sample shows how this is implemented using Q# standard libraries. Currently, it does not simulate realistic noise so the resulting unitary operator is trivial. However, the program is useful to demonstrate the concept of a syndrome.

The algorithm used is described in Surface codes: Towards practical large-scale quantum computation by Fowler et al. In particular, this example implements the circuit shown in Figure 1 c. in this paper.

The circuit uses N data qubits, where N is a number given as input to the script, plus one auxiliary qubit. The principle of the circuit is as follows. First, we prepare our data qubits in random states of a set of random bases, in order to simulate a noisy process. The circuit then propagates these errors to the auxiliary qubit using the principle of phase kickback. Phase kickback works by encoding pieces of a quantum algorithm into the global phase of an extra (auxiliary) qubit.

We start by preparing an auxiliary qubit into the superposition state by applying a H operation, to change to the X computational basis. Subsequently, we apply controlled Pauli operators to each of the data qubits in random order, using the auxiliary qubit as control. The goal is to create a global phase shift on the auxiliary qubit, that will depend on the state of the data qubits. After the circuit runs, the auxiliary qubit is measured in the X-basis, which reveals its phase information.

Prerequisites

Running the Sample

To run the sample, run dotnet run --qubits <N>, where <N> is replaced by the number of qubits. For more information, run dotnet run -- --help.

Manifest

Further resources