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**. The rules of the contest are:

- The contest will have 12 tasks of various complexity levels.
- To solve each task, you will write Q# code to implement the described transformation on the given set of qubits or to perform a more challenging task. Solutions are accepted in Q# only.
- The solution is correct if it passes all tests from a predefined test set. You will know whether the solution is correct soon after submitting it.
- Participants are ranked according to the number of correctly solved tasks.
- Ties are resolved based on lowest penalty time for all tasks, which is computed as the latest submission time (the time since the start of the contest) for any of the correctly solved tasks. There is no penalty for failed submissions.
- The top 50 ranked participants will receive a Microsoft Quantum T-shirt.
- NO PURCHASE NECESSARY. Must be 16 years of age or older. Game ends 3/4/19. For details, see Official Rules.

We will offer a warmup round the weekend before the contest, **from February 22 to February 25**. Participation in the warmup round is entirely optional. The warmup round includes simpler tasks on the topics covered in the main contest and 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 the Q# programming language. During the warmup round everybody is encouraged to discuss the tasks and the solutions. Once the warmup round is over, we will publish the editorials explaining both the quantum computing logic behind the solution and the Q# implementation on the contest page.

Another great way to prepare for the contest is to solve some of the Quantum Katas. They offer problems on a variety of quantum programming topics, and they are very similar to the ones used in the contest. In fact, the participants of the summer Q# contest will recognize the contest problems in some of the kata tasks :-)

Good luck! We hope you enjoy the contest!

For first time Codeforces users:

- Create user account here.
- Register for the warmup round here.
- Register for the contest here.
- Once the warmup round starts on February 22, access the problems here.
- Once the contest starts on March 1, access the problems here.

**Quantum computing and Q# materials:**

- Quantum Computing: Lecture Notes by Ronald de Wolf.
- A collection of awesome quantum computing learning resources, including MOOCs and books.
- Q# installation instructions and documentation.
- Quantum Katas — Q# programming exercises.
- Q# Language Quick Reference.

Note that this contest will use Q# 0.4, while the previous contest used Q# 0.2. A lot of code written in 0.2 will still work in 0.4; for details on breaking changes and new features please see release notes.

this is so cool. i love that you bring this new innovative stuff on codeforces. i have read a lot on quantum computing and it is definitely the future. moving bits around and all that stuff is awesome. now my only hope is that you won’t mix math and quantum sharp in this contest / this series of contests because Q sharp is very interesting and i really wouldn’t like it to be dirtied up with useless math. i don’t think i’m the only one.

Do you expect higher difficulty than on the first quantum contest, i.e. the T-shirts not being decided on time only?

We are definitely aiming to have more difficult problems in this contest! I asked one of our researchers to write several problems, and I still have to figure out how to solve them myself :-)

We're also going to change scoring to be based on the last solved problem submission time, not on the sum of submission times, so the impact of the time the competitor joins the contest should be reduced.

That being said, Codeforces community has surprised us once already, and I'm not willing to bet that you won't do it again :-)

yeah but math is useless and makes everything unnecessarily harder. so don’t bullshit us with it

Can we expect the t-shirts to be different from the Summer round ones? ;)

Yes, definitely :-)

Good!

Well, time to finish the syntax highlighting I started half a year ago.

I tried solving some of the questions of the previous contest today, but I was getting a lot of "denial of judgment" and "compilation error" errors, even when trying to use the official solution provided. Does anyone know what is the problem?

Specifically for problems B3 and C1.

The checkers of the previous contest have not been updated to the new version of Q# yet. I'm investigating this, but this might take a while. For B3 and B4, for example, the only change I had to do in the reference solution was switch from ";" to "," as a separator between array elements — in Polygon it just worked, but I'm not sure why this gives me "denial of judgement" on the website...

If you want to practice on those problems, you can solve them in the Quantum Katas — they are migrated to 0.4, and as a bonus you get error messages on your machine, not via Codeforces interface.

Thank you very much for your reply!

I checked the Quantum Katas, and they are amazing, but I think I found a mistake, and I don't know how else to report it.

In the 4th Joint Measurement task, it says the output should be "0 if qubits were in W state, 1 if they were in the second superposition."

But the solution given has the reverse, returning 1 for W and 0 for the other.

Nice catch, thank you! I've opened a PR to fix this.

(If you have a GitHub account, you can report possible issues with the katas directly in Issues)

The checkers have been updated now. The problems that were affected are B3-B4, C1-C2 and E1-E2.

Is there a more extensive / detailed documentation for Q#? At this moment one can only guess what adjoint controlled distribute means at the end of an operation. I've seen it in the katas for Superposition. A little more explanation in the docs or somewhere about functors would be nice. Or is there a place and i didn't manage to find it?

https://docs.microsoft.com/quantum contains all Q# documentation. For this particular question, look up Operation Definitions.

https://codeforces.com/contest/1001/submission/50058667

I wonder if the checker is updated since the error message is from the checker... Also, I tried a submission that has passed the test before and it got a CE verdict on the same problem.

Nice catch, indeed I missed the problem from warmup round which needed the same update. Should be fixed now.

Fixed. Thanks for your reply :-)

Is it allowed to stream solving the warm-up round on Youtube?

Call it Boring Programming Stream and they won't know XD

Sure :-)

no, it is strictly prohibited in the rules. read the website's rules before using it.

n

Is this contest rated?

I have the same question

No.

all the best everyone