By Nickolas, 12 days ago, In English,

Microsoft's Quantum team is excited to announce the Q# Coding Contest – Summer 2020, the third in the series of Q# contests! In this contest you can put your quantum programming skills to the test, solving quantum computing tasks in Q#. The winners (as well as some lucky participants) 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 December 2017 Microsoft introduced the Quantum Development Kit which includes the Q# programming language.

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. In winter of 2019 we hosted the second quantum programming contest, which offered harder problems on those topics plus some tasks on implementing unitary transformations. This contest will introduce new types of tasks, as well as some twists on the previous ones.

The contest will run from June 19 to June 22. As usual, we will hold a warmup round the weekend before the contest, from June 12 to June 15, to give you an opportunity to get familiar with the contest environment and submission system before the main contest. Participation in the warmup round is optional.

Good luck! We hope you enjoy the contest!

The rules of the contest are:

  • The main contest and the warmup round will have several tasks of various complexity levels.
  • To solve each task, you will write Q# code to implement the described 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 contest and the warmup round will award T-shirts as follows:
    • The top 50 ranked participants in the main contest will receive a Microsoft Quantum T-shirt.
    • Random 25 participants of the main contest who solved at least one problem but didn't finish in the top 50 will receive a Microsoft Quantum T-shirt.
    • Random 25 participants of the warmup round who solved at least one problem but didn't win a T-shirt in the main contest will receive a Microsoft Quantum T-shirt.
    • All T-shirt winners will be selected after the end of the main contest. T-shirt designs will be announced later :-)
  • NO PURCHASE NECESSARY. Must be 16 years of age or older. Game ends 06/22/20. For details, see the Official Rules.

For first time Codeforces users:

  1. Create user account here.
  2. Register for the warmup round here.
  3. Register for the contest here.
  4. Once the warmup round starts on June 12, access the problems here.
  5. Once the contest starts on June 19, access the problems here.

Quantum computing and Q# materials:

Note that this contest will use Q# 0.11.2004.2825, while the previous contests used Q# 0.2 and Q# 0.4, respectively. We've updated the test harnesses from the previous contests to support the latest version of Q#, so you can use them for practice.

 
 
 
 
  • Vote: I like it
  • +430
  • Vote: I do not like it

»
12 days ago, # |
  Vote: I like it -115 Vote: I do not like it

Is it rated?

  • »
    »
    12 days ago, # ^ |
      Vote: I like it +94 Vote: I do not like it

    No. Q# contests are quite different from regular Codeforces rounds, and not frequent enough to warrant a rating of their own :-)

  • »
    »
    5 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I find it so weird how people here downvote benign questions like this. Why the hostility?

»
12 days ago, # |
  Vote: I like it +27 Vote: I do not like it

I'll add to resources: my syntax highlighting for Sublime Text 3 (and maybe something else), which works better than C#/F# syntax highlighting. If you want to improve it, especially by adding samples/tests, feel free to fork or submit a pull request.

»
12 days ago, # |
  Vote: I like it +5 Vote: I do not like it

Q# C# F# oof

»
12 days ago, # |
  Vote: I like it -24 Vote: I do not like it

Do the participants get participation certificates?

  • »
    »
    11 days ago, # ^ |
      Vote: I like it +39 Vote: I do not like it

    No. You'll be immortalized in the contest standings, though :-)

    • »
      »
      »
      11 days ago, # ^ |
        Vote: I like it -39 Vote: I do not like it

      So I had never won an argument with my mom. No idea from where female gets so valid and accurate points

»
12 days ago, # |
  Vote: I like it +33 Vote: I do not like it

Will there be no cf normal rounds like div2 or educational rounds ?

  • »
    »
    11 days ago, # ^ |
      Vote: I like it +15 Vote: I do not like it

    Normal CF rounds are pretty much orthogonal to the Q# round, so it doesn't affect them. (In fact, at least one of the previous Q# contests overlapped with a normal round.) Right now the calendar has two upcoming contests in May.

»
12 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Super Excited

»
11 days ago, # |
  Vote: I like it +143 Vote: I do not like it

What will probably happen to me:

  • »
    »
    11 days ago, # ^ |
      Vote: I like it +213 Vote: I do not like it

    If you're going to introduce your cat to quantum computing, you might want to avoid the topic of Schrödinger's cat... I believe this is why historically cats don't do so well with quantum physics.

»
11 days ago, # |
Rev. 2   Vote: I like it +15 Vote: I do not like it

Can someone with experience from previous Q# contests suggest some more interesting resources?

»
11 days ago, # |
  Vote: I like it 0 Vote: I do not like it

is q# easy to learn? plz suggest resources!!

»
11 days ago, # |
  Vote: I like it 0 Vote: I do not like it

I'm glad to be able to join these contests again!

»
11 days ago, # |
Rev. 2   Vote: I like it -14 Vote: I do not like it

Does anybody knows when the div 2,3,4 will be back ?

»
11 days ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

looks at previous contest participation

Oh this seems an easy way to get a tshirt, not many participants! I'm sure I can learn the basics in a month I mean how hard can it be.

opens Quantum Katas, excited about something new.

drowns in linear algebra and hard-to-visualize concepts


Seriously though tshirts aside, the topic does seem really interesting and I'd love to get to know more but I didn't like the written tutorials.. maybe just because I prefer videos. Is there any online resource/course that explains all the quantum basics in a more visual way ? Appreciated!

»
11 days ago, # |
  Vote: I like it +2 Vote: I do not like it

What is Q# coding? Why we want this? and why we will do QUANTAM COMPUTING? (I just want to know. Can you please motivate us by telling some awesome benefits?)

»
11 days ago, # |
  Vote: I like it +10 Vote: I do not like it

I'll participate in the contest. Also you are beautiful!

»
10 days ago, # |
  Vote: I like it 0 Vote: I do not like it

I've always found quantum computing fascinating, and now I have a reason to learn its language and work with it :)

»
10 days ago, # |
  Vote: I like it -6 Vote: I do not like it

Div4-div2-edu CF is charming again. Thanks for these contest.

»
10 days ago, # |
  Vote: I like it -7 Vote: I do not like it

Are these warmup challenges only for practice purposes or rated on codeforces?

  • »
    »
    10 days ago, # ^ |
      Vote: I like it +15 Vote: I do not like it

    Both the warmup round and the main contest are not rated. You can win a T-shirt in the warmup round, though, so it's a little more significant than only for practice purposes this time.

»
10 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Well, lets see if I can solve even a single problem

»
9 days ago, # |
  Vote: I like it +10 Vote: I do not like it

Can someone tell me how do I run a Q# program on terminal? Googled a bit and they all told me to download some IDE.

  • »
    »
    9 days ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

    You can bypass Visual Studio and just use .Net Core SDK (packages dotnet*) in Linux. Look for commands that use it, like here.

»
9 days ago, # |
Rev. 3   Vote: I like it -10 Vote: I do not like it

.

»
9 days ago, # |
  Vote: I like it -32 Vote: I do not like it

Don't upvote.

»
8 days ago, # |
  Vote: I like it +4 Vote: I do not like it

Can anyone suggest best apps for writing code like codeblocks ( other than codeblock) for a windows user

»
7 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Does anyone have experience running Q# via Jupyter Notebooks? I tried some sample code from the warm-up rounds and it shows "The given key was not present in the dictionary".

  • »
    »
    7 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Can you please provide the exact steps you're following for a repro? It could be, for example, this issue if you're opening namespace in a separate cell.

    In general, Q# accumulated some syntax and libraries changes since the last warmup round (it's been over a year, after all :-)), so some of the code will generate warnings and errors on the latest Q#.

    • »
      »
      »
      7 days ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      Does this help? I'm not sure what you mean by 'repro'. I used this link for installing Q# in Jupyter Notebooks.

      I basically copied code from the warmup round 2018 and tried running it in one cell. Since I could get 'Hello World' and other simple programs to run, I thought I could run code the same way as other languages. But it seems I'm missing @EntryPoint() and other important syntax or I need a separate script for inputs? Either way, I guess I need to spend more time reading the docs.

      • »
        »
        »
        »
        7 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        "Repro" is the fragment of code or sequence of steps that allows to reproduce your problem. In this case, the screenshot tells me that you don't need to specify the namespace if you're running in notebooks, just the open directives and the operations you declare. (You don't need to specify EntryPoint either in the notebooks or when running on Codeforces, that is syntax for standalone Q# application which is a yet separate scenario.)

        You raise a good point here. I'll see if I can find the docs about the differences between running Q# in notebooks vs in console app. For Codeforces, each problem specifies the signature your code should have, and that matches running Q# code as an app with a driver.

        • »
          »
          »
          »
          »
          7 days ago, # ^ |
          Rev. 2   Vote: I like it 0 Vote: I do not like it

          Thanks for explaining!

          So you mean that for running Q# code using VS Code(for example) and .NET, you need a custom driver program in C# for each solution ?

          I'm considering switching to another method(like VS Code) as my Q# kernel won't connect any longer for some reason.

          • »
            »
            »
            »
            »
            »
            7 days ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            There are multiple ways to run Q# code; you can do it with a driver program in C# or Python, or you can do it as standalone executable. Codeforces testing harness uses C#, since I need specific exception processing to provide different verdicts for some problems. You can find examples of different ways in this repository:

            How are you running Q# notebooks? If you install it locally, a restart should fix things like unresponsive kernel.

            • »
              »
              »
              »
              »
              »
              »
              7 days ago, # ^ |
              Rev. 3   Vote: I like it 0 Vote: I do not like it

              Thanks, I'll check them out.

              I'm running it via Anaconda. The problem is not an unresponsive kernel but a kernel that doesn't connect at all. Something like this but just for Q#. Python works fine.

            • »
              »
              »
              »
              »
              »
              »
              3 days ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              How do we check in our local ide whether we have generated the correct state that has been desired in the question ?

              • »
                »
                »
                »
                »
                »
                »
                »
                3 days ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it
                • If you're running a task with a provided test harness, like in the Quantum Katas, the test harness will take care of that for you.
                • If you don't have a test harness, you can use DumpMachine after preparing the state to see the amplitudes of the basis states and check whether they match the required ones.
»
5 days ago, # |
  Vote: I like it 0 Vote: I do not like it

When will the T-shirt designs be revealed? I'm debating whether I should participate or not, because it takes time to prepare and study for this, and I have other stuff that's taking up my time.