Here is the editorial for the round. The comments for this post also have lots of great explanations of alternative solutions, make sure to check them out!
I hope you've enjoyed the contest!
Here is the editorial for the round. The comments for this post also have lots of great explanations of alternative solutions, make sure to check them out!
I hope you've enjoyed the contest!
Microsoft's Quantum Team and Codeforces are excited to invite you to Microsoft Q# Coding Contest — Winter 2019!
The contest will run from March 1 to March 4 and will offer increasingly challenging tasks on superposition, measurement, quantum oracles and unitary transformations.
As a reminder, last weekend we held a warmup round with easier tasks on quantum oracles and unitary transformations; the tasks are available for practice here, and the solutions are explained here. You can brush up on the topics of superposition and measurement in the first Q# contest and its warmup round.
Several useful reminders:
Solution
and an operation with a signature operation RunQsharp () : Bool
defined in it.Microsoft’s Quantum team is excited to announce the Q# Coding Contest – Winter 2019! In this contest you can put your quantum programming skills to the test, solving quantum computing tasks in Q#. Winners will receive a Microsoft Quantum T-shirt!
Quantum computing is a radically different computing paradigm compared to classical computing. Indeed, it is so different that some tasks that are believed to be classically intractable (such as factoring integers or simulating physical systems) can be performed efficiently on a quantum computer. In 2017 Microsoft introduced the Quantum Development Kit which includes the Q# programming language. Q# can be used with Visual Studio, Visual Studio Code or the command line, on Windows, macOS, and Linux.
In summer of 2018 we hosted the first quantum programming contest, which included problems on introductory topics in quantum computing: superposition, measurement, quantum oracles and simple algorithms. This contest will offer harder problems on some of these topics as well as introduce some new topics.
The contest will run from March 1 to March 4.
Microsoft's Quantum Team and Codeforces are excited to invite you to Microsoft Q# Coding Contest — Summer 2018!
The contest will run from July 6 — 9 and will consist of increasingly challenging tasks on introductory topics in quantum computing: superposition, measurement, oracles and simple algorithms. The top 50 ranked participants will receive a Microsoft Quantum T-shirt!
As a reminder, last weekend we help a warmup round with easier tasks which covered the same topics. The results were quite impressive: 167 participants solved all tasks! You can see the tasks here, and the solutions with explanations here.
Several useful reminders:
namespace Solution {
open Microsoft.Quantum.Primitive;
open Microsoft.Quantum.Canon;
// ------------- Operation which is called from C# -------------------
operation RunQsharp () : Bool
{
body
{
Message("Hi");
return true;
}
}
}
You can find the discussion of the warmup round and pointers to Q#/quantum computing materials here.
For first time Codeforces users:
Good luck! We hope you enjoy the contest!
Update. The contest is over. Editorials are published.
(text courtesy of my colleague Chris Granade)
A quantum oracle O is a "black box" operation that is used as input to another algorithm. Often, such operations are defined using a classical function f: {0, 1}n → {0, 1}m which takes n-bit binary input and produces an m-bit binary output. To do so, consider a particular binary input x = (x0, x1, ..., xn - 1). We can label qubit states as .
We may first attempt to define O so that , but this has a couple problems. First, f may have a different size of input and output (n ≠ m), such that applying O would change the number of qubits in the register. Second, even if n = m, the function may not be invertible: if f(x) = f(y) for some x ≠ y, then but . This means we won't be able to construct the adjoint operation , and oracles have to have an adjoint defined for them.
We can deal with both of these problems by introducing a second register of m qubits to hold our answer. Then we will define the effect of the oracle on all computational basis states: for all and , \begin{align*} O(|x \rangle \otimes |y \rangle) = |x \rangle \otimes |y \oplus f(x) \rangle. \end{align*} Now by construction, thus we have resolved both of the earlier problems.
Importantly, defining an oracle this way for each computational basis state also defines how O acts for any other state. This follows immediately from the fact that O, like all quantum operations, is linear in the state that it acts on. Consider the Hadamard operation, for instance, which is defined by and . If we wish to know how H acts on , we can use that H is linear:
\begin{align*} H |+ \rangle = \frac{1}{\sqrt{2}} H(|0 \rangle + |1 \rangle) = \frac{1}{\sqrt{2}} (H |0 \rangle + H |1 \rangle) = \frac{1}{\sqrt{2}} (|+ \rangle + |- \rangle) = |0 \rangle \end{align*}
In the case of defining our oracle O, we can similarly use that any state on n + m qubits can be written as
Thus, the effect of the oracle O on this state is
Microsoft's Quantum Team has good news for quantum enthusiasts and coders looking for new challenges. We are excited to announce Microsoft Q# Coding Contest — Summer 2018! By entering the contest, you can hone your quantum coding skills by tackling problems of varying difficulty and implementing solutions in the quantum programming language Q#. Winners will receive a Microsoft Quantum T-shirt!
Quantum computing is a radically different computing paradigm compared to classical computing. Indeed, it is so different that some tasks that are believed to be classically intractable (such as factoring integers, computing discrete logarithms on elliptic curves, or simulating physical systems) can be performed efficiently on a quantum computer. Microsoft recently introduced the Quantum Development Kit which includes Q# — a new programming language to express quantum programs in a way that makes it easier for classical coders to enter the space. Q# integrates into Visual Studio or Visual Studio Code development environments, and is available as a command line tool. Visual Studio Code allows development under Windows, macOS, and Linux.
The contest will run from July 6 — 9 and will consist of increasingly challenging tasks on introductory topics in quantum computing: superposition, measurement, oracles and simple algorithms.
The rules of the contest are:
From June 29 to July 2, we will offer a warmup round with simpler tasks on the topics covered in the main contest. Participation in the warmup round is entirely optional. The warmup round gives you an opportunity to get familiar with the contest environment and submission system beforehand, as well as refresh or learn the basics of quantum computing and Q# programming language. During the warmup round everybody is encouraged to discuss the tasks and the solutions. 24 hours after the start of the warmup round we will publish explanations and solutions to the easiest three problems. Once the warmup round is over, we will publish the editorials on the contest page explaining both the quantum computing logic behind the solution and the Q# implementation.
To start, please refer to Q# installation instructions and language reference.
Quantum computing and Q# materials:
For first time Codeforces users:
Good luck! We hope you enjoy the contest!
Update. Explanations for problems A, D and G of the warmup round are published.
Update. The warmup round is over. Explanations for all problems are published.
Name |
---|