The post Microsoft Quantum challenge at QCHack 2021: Recap appeared first on Q# Blog.

]]>One of the challenges we faced in preparing for the Hackathon was striking the right balance between helping the participants prepare for solving the tasks while not disclosing too much information about the tasks themselves before the kick-off ceremony. Our challenge announcement focused on the structure of the challenge and the preparation materials, while carefully avoiding more specific mentions of the topic. In our pre-Hackathon workshop, though, we let the cat out of the bag (or was it a box?) and revealed that the challenge would focus on solving problems using Grover’s search.

The challenge consisted of two parts. In part 1 the participants were presented with 4 independent kata-style tasks of varying difficulty, each of the tasks asking to implement a quantum oracle for the given classical function. You can try out the part 1 tasks yourself in the challenge repository; we’ve also added reference solutions in case you get stuck with some of the problems.

In part 2 we gave the participants the freedom to choose a problem of their liking and to develop a project that would solve it using Grover’s search and Microsoft Quantum Development Kit.

After a very intense 24 hours of hacking, we received a total of 40 submissions to our challenge. 12 of the teams did free-form projects as a part of their submissions, the rest of the participants focused on learning the basics with oracle implementation tasks. We had the foresight to develop a testing harness similar to the Quantum Katas to judge the tasks from part 1 automatically beforehand, so after the Hackathon the human judges focused on evaluating the projects done by the teams.

Once we started judging, it became clear that the winners will be picked among the teams who completed both parts of the challenge. Fortunately, we had 6 winners to select, which was a lot easier than selecting just one or two! Without further ado, here are the winning teams and their projects.

The winning project implemented Mastermind board game, in which one player (“codemaker”) chooses a pattern of 4 colors, and the second player (“codebreaker”) tries to guess it by choosing query patterns and getting feedback on how close they are to the pattern. The best feature of this project? It was implemented as a quantum kata, with each piece of the code covered with unit tests, so just a little extra effort can convert it into a great tutorial!

*“The combined experience of the workshops and the Hackathon allowed us to create a minimalist, but mostly functional project using the information from the presentations. It was a very enjoyable event… It was a unique experience to work with folks from across the world, especially in such short notice. I learned a lot from their dedication and became truly enthusiastic about the quantum community.”*

Check out the winning project here.

This project solved the simplified version of setting up the board for Battleship game: placing several ships on the grid so that they fit within the board without overlapping.

*“What made the challenge really enjoyable was being able to ask Microsoft team members for help throughout the 24-hours, like Mariia and Guen… I very much enjoyed how the pre-hack workshops during the week covered material that directly related to the weekend’s challenge… Overall, everything about the challenge was very organized.”*

Check out the team’s writeup of their experiences in their blog, or go straight to the project.

This project was another implementation of Mastermind game. The algorithm didn’t rely on the oracle knowing the correct answer as well (to quote the team, “where’s the fun without a little effort?”), so it didn’t take advantage of the quantum speed up offered by Grover’s search algorithm. Instead, it took a trial-and-error approach, taking into account the feedback from previous iterations to formulate the next guess.

*“Despite the ongoing pandemic, thanks to this challenge we had the chance to connect and work together online, putting ourselves into the game outside the usual academic setting. We have been positively surprised about the results, given that we were all Q# first-timers. One thing is for sure, the memories from this experience will stick with us forever.”*

Check out the team’s writeup of their project in their blog post, or go straight to the project.

This project solved the “4 rooks” problem: given a 4×4 board with 3 rooks already placed on it, place the 4^{th} rook so that none of them attack each other.

*“I felt that the challenges flowed very well from one part to the next. The 4 challenges in part 1 build very nicely on top of each other and require the use of more and more advanced techniques to solve. Having the first part be about oracles and the second part be about Grover’s algorithm which relies on oracles was also nice, since it tied everything together.”*

Check out the project here.

This project was inspired by the diplomatic relations between nations in *Sid Meier’s Civilization VI*. For simplicity it considered that each pair of countries were either in alliance or in conflict, without any intermediate stages, and was looking for a balance of relations in which no three countries were pairwise allies or pairwise enemies. Under the hood this project utilized a creative adaptation of the hardest task from part 1, the oracle that checked whether the given graph edge coloring was triangle-free, i.e., didn’t have a triangle of edges painted the same color.

Check out the project here.

This project solved the subset sum problem: given an array of integers and an integer, figure out whether there is a subset of array elements that adds up to this integer. To simplify the solution, the code assumed that all array elements were non-negative.
Check out the project here. |

Congratulations to the winning teams! We really enjoyed hosting the challenge, and we are looking forward to organizing future events!

The post Microsoft Quantum challenge at QCHack 2021: Recap appeared first on Q# Blog.

]]>QCHack will consist of two parts: the Hackathon,

The post Announcing Microsoft Quantum challenge at QCHack appeared first on Q# Blog.

]]>QCHack will consist of two parts: the Hackathon, running for 24 hours during the weekend of April 10-11, and the pre-Hackathon bootcamp during the week of April 5-9.

The bootcamp will help participants get started with their Hackathon preparation. It will include tutorials on quantum computing and on quantum programming toolkits offered by the sponsor companies that will be used in their respective challenges. The participants will also have ample opportunities to meet quantum computing professionals from the sponsor companies, to learn more about the cutting-edge research done by them and about their journeys in quantum computing.

Check out the QCHack schedule for the complete list of tutorials, panels, and social events planned for the bootcamp week! (The recordings are available at the Quantum Coalition YouTube channel).

The weekend of April 10-11 will be the time when the participants will put their newly acquired quantum computing skills to test. Each company will offer a unique challenge focused on their toolkit and using it to solve a certain problem, revealed at the kick-off ceremony on April 10^{th}. The teams will then have 24 hours to do their best at solving the challenges, and afterward, the judges from each company will pick the winners of their challenge.

Of course, you must be curious about what challenge Microsoft Quantum will offer to the QCHack participants. Let me give you a couple of spoilers without giving away too much.

Our challenge focuses on Microsoft Quantum Development Kit and Q#, and will consist of two parts:

- Warmup problems. To start with, you’ll be offered several problems of increasing difficulty that solve tasks similar to the ones you’ll need to handle in the second part of the challenge. These tasks will come with testing harnesses, similar to the ones used in the Quantum Katas, so that you’ll be able to check whether your solutions are correct. The submissions will be judged automatically using the same or similar testing harnesses: if your code for the problem passes the tests, you get the points for it!
- Free-form challenge. In this part, you’ll create a project that solves a quantum computing problem within certain constraints. There will be no “right” or “wrong” way to solve this challenge; you have the freedom to decide what you want to do! The submissions will be judged on several criteria, such as creativity, technical depth, and the educational value of the project.

The points from both parts of the challenge will be added together, and the highest-scoring teams will be declared winners! The challenge will have prizes, as well as an opportunity for the winning teams to present their projects to the Microsoft Quantum team after the event.

If you’re excited about this event and can’t wait to get started, here are the next steps for you:

- Register for it.
- Start learning as much as you can about quantum computing and the sponsor companies’ tools!

And here are several good ways to practice for the Microsoft Quantum challenge:

- The Quantum Katas offer a collection of tutorials and programming exercises covering the basic concepts and algorithms of quantum computing. They are a great way both to get started with quantum computing and Q# programming and to get familiar with the types of tasks that can be offered in the first part of the challenge.
- The past Q# Coding Contests are another collection of Q# programming problems that you can use for practice. Be warned, though, that the current QDK version used on the Codeforces platform is 0.11, so the Q# syntax accepted there will differ slightly from the latest one.

I’m looking forward to the QCHack, and I hope to see you there!

The post Announcing Microsoft Quantum challenge at QCHack appeared first on Q# Blog.

]]>The post Inside the Quantum Katas, part 2: testing quantum programs appeared first on Q# Blog.

]]>In this blog post we will continue the deep dive into testing different types of quantum programming tasks.

Tasks that ask the learner to implement a given unitary transformation – an operation on qubits that changes their state – are frequently seen in the katas. Quantum oracles and more complicated operations such as quantum Fourier transform or quantum arithmetic are just a few examples that justify their popularity.

Verifying that the learner’s solution is correct can be done by comparing it to the reference implementation using the AssertOperationsEqualReferenced library operation. This operation relies on the Choi–Jamiołkowski isomorphism to reduce the comparison of two unitaries to a comparison of a quantum state to the all-zeros state. Let’s take a quick look at how it works for the small case of single-qubit unitaries (for unitaries acting on multiple qubits the principle is the same but the math is bulkier).

- We will start by preparing an entangled state |Φ⁺⟩ = 1/√2 (|00⟩ + |11⟩).
- Apply the learner’s solution that implements the unitary U to the second qubit:
1/√2 (|0⟩ ⊗ U|0⟩ + |1⟩ ⊗ U|1⟩) This state carries all information about the effects of the unitary on all basis states, and thus, all the information about the unitary itself (up to a global phase). - Now apply the adjoint of the reference implementation R to the second qubit:
1/√2 (|0⟩ ⊗ R†U|0⟩ + |1⟩ ⊗ R†U|1⟩) The trick turns out to be similar to the one we’ve seen when testing the state preparation tasks. If the unitaries R and U are the same, their effects on the state are going to cancel out, and we’ll get the state |Φ⁺⟩ with which we started. If the unitaries are different, their effects either on the |0⟩ state or on the |1⟩ state will not cancel out, and we’ll end up with a different state. - To check whether we ended up with the original state |Φ⁺⟩, we can use the same trick again: apply the adjoint of the routine used to prepare it from the |0⟩ state and compare the result to the |0⟩ state.

With all these steps hidden away in the library operation, the actual test code ends up very short. Here is the testing harness from the first task of the MultiQubitGates tutorial:

@Test("QuantumSimulator") operation TestCompoundGate () : Unit { AssertOperationsEqualReferenced(3, CompoundGate, CompoundGate_Reference); }

In the previous examples we’ve covered tasks that focused on practicing using quantum gates; now let’s learn more about the tasks that offer measurements practice.

The Measurements kata offers tasks which give the learner qubits in one of two or more possible orthogonal states (for example, |0⟩ or |1⟩) and ask to figure out which state it was. This type of task can be tested as follows:

- Pick one of the possible input states randomly.
- Prepare the qubits in this state and pass them to the solution.
- Compare the solution’s answer with the state we picked to see if it’s a match.
- Repeat the steps 1-3 several times to reduce the probability that the solution guessed the state accidentally. This also allows us to gather statistics on the incorrect guesses to help the learner identify their mistakes, such as confusing the indices of states returned or making randomized guesses instead of deterministic.

The testing harness complete with error tracking can get somewhat lengthy; you can find the complete example from the Measurements kata here.

This testing approach can be used for other types of tasks as well. The second part of the Measurements kata offers tasks in which the solution has to identify the state with a certain probability or without errors but with some “unknown state” verdicts allowed. A more recent DistinguishUnitaries kata asks the learner to figure out which of the two unitaries they are given by designing the right experiment.

Sometimes we care not only about the results produced by the solution but also about the operations used by it. Here are several examples of such tasks:

- The Deutsch-Jozsa algorithm example from part 1, in which we want to ascertain that the learner uses the quantum algorithm rather than the classical one, and the most reliable way to do this is to limit the number of times they can use the oracle.
- The random numbers generation tutorial prohibits the use of classical random number generation routines to make sure the learner uses the quantum approach to generating randomness.
- The task that asks the user to implement CNOT using joint measurements restricts the use of two-qubit gates, since otherwise calling CNOT or Controlled X would achieve the formal goal without making the point.

Some of these needs can be addressed by the library operation AllowAtMostNCallsCA. However, the Quantum Katas use a more sophisticated and more flexible approach: the CounterSimulator. It is a custom simulator built as an extension to the full state simulator provided with the QDK, and it counts various resources used during the “normal” program simulation. Developing a simulator with resource counting capabilities is out of scope for this blog post, but since it exists (and is shipped as part of the Microsoft.Quantum.Katas NuGet package), the testing harnesses can use its methods to get the necessary resource counts.

Here is the testing harness for the Deutsch-Jozsa algorithm which runs the algorithm on the given oracle, checks that its result is correct and then checks that the solution doesn’t overuse the oracle calls:

operation TestDJAlgorithm (N : Int, oracle : (Qubit[], Qubit) => Unit, expected : Bool, msg : String) : Unit { EqualityFactB(DJ_Algorithm(N, oracle), expected, msg); let nu = GetOracleCallsCount(oracle); Fact(nu <= 1, $"You are allowed to call the oracle at most once, and you called it {nu} times"); }

Similarly, sometimes we care about the number of auxiliary qubits allocated by the solution. The simplest examples are tasks that ask the learner to implement a phase oracle for a certain function. If the task aims to teach phase manipulation, it might prohibit the solution allocating extra qubits to render implementing a marking oracle and then using the phase kickback trick impossible.

What will the testing harness look like in this case? We can validate that the solution implements the right unitary using the AssertOperationsEqualReferenced operation from the example 1. On top of that, we can use another library operation, AllowAtMostNQubits, to check that AssertOperationsEqualReferenced allocates exactly 2N qubits, where N is the number of qubits on which the oracle acts. (Why 2N? Remember that AssertOperationsEqualReferenced uses 2N qubits to compare the unitaries that act on N qubits. If the reference solution does not allocate extra qubits, any qubits allocated on top of 2N must come from the learner’s solution!)

Here is the testing harness used for the task:

@Test("QuantumSimulator") operation TestPhaseOracle () : Unit { let N = 3; within { AllowAtMostNQubits(2*N, "You are not allowed to allocate extra qubits"); } apply { AssertOperationsEqualReferenced(N, PhaseOracle, PhaseOracle_Reference); } }

These testing patterns are the ones most frequently used in the Quantum Katas. There are plenty of one-off tasks that require more elaborate testing logic (the whole counting multi-qubit gates functionality of the CounterSimulator is only used in one task!), but these should help you get started with testing your own quantum code.

If you’re looking for more advanced scenarios of code verification, see the paper “A Resource Estimation and Verification Workflow in Q#” by Mathias Soeken et al.

The post Inside the Quantum Katas, part 2: testing quantum programs appeared first on Q# Blog.

]]>If you’re reading this blog post, you probably have heard of the Quantum Katas – our collection of tutorials and programming exercises that help one learn quantum computing via quantum programming.

The post Inside the Quantum Katas, part 1 appeared first on Q# Blog.

]]>If you’re reading this blog post, you probably have heard of the Quantum Katas – our collection of tutorials and programming exercises that help one learn quantum computing via quantum programming. (If you haven’t, check them out – I’ve heard great feedback about them )

The Katas are about two and a half years old, and I’ve written about them before once or twice – from the first overview of the project and the summary of its first year in public to its part in this year’s Hacktoberfest celebration (we got 23 pull requests from 11 different folks, 8 of them first-time contributors!)

Oddly enough, I’ve never written about the internal workings of the katas or their most important component – the testing harnesses that provide the learner immediate feedback on their solutions. Testing quantum programs is an interesting topic, very different from testing classical code in some respects and quite similar to it in others. Let’s see how we build the Quantum Katas and how we test them.

Each kata is a sequence of individual tasks, and each task consists of several pieces working in concert.

- The task.

This is the “frontend” of the task, the part where the user spends most of their time. It includes the description of the task (what needs to be accomplished, the format of inputs and outputs, examples and any restrictions imposed on the solution) and the signature of the Q# operation that the learner needs to implement.

A typical kata will have two “frontends” – in the`Tasks.qs`

file (used when solving the kata in Visual Studio or VS Code) and in the Jupyter Notebook. The task description and, most importantly, the operation signature of the task should always match in both cases, though the Jupyter Notebook “frontend” certainly looks much fancier! - The reference solution.

`ReferenceImplementation.qs`

file contains the “reference” solutions to all tasks – correct solutions to the tasks that will pass the tests. Sometimes these solutions play a significant role in the testing of the learner’s code, and one can always turn to them to get an idea about the expected approach to the task. That last goal, though, is often better served by the workbooks – the worked-out explanations of the tasks and their implementation in code that are included in many katas. - The testing harness.

Finally,`Tests.qs`

file contains the code that verifies whether the learner’s code is correct. It is implemented as a collection of unit tests, one per task, that pass if the learner filled in the right code to solve the task and fail otherwise. (This means that when you start solving the kata in VS or VS Code, all tests are failing – a somewhat scary set up!)

The Jupyter Notebook “frontend” doesn’t support unit tests, so the testing harness is invoked using the`%kata`

magic command included in the code cell that contains the task operation.

The most important part of developing a new task is creating the testing harness for it. When we consider the ways to test a solution, we follow one main principle:

In other words, we test whether the solution accomplishes the given task, not the exact path it takes to do that.

Consider, for example, the following task: given a pair of qubits in the |00⟩ state, prepare one of the Bell states |Φ⁻⟩ = 1/√2 (|00⟩ – |11⟩). There are a lot of ways to do this – start by preparing a different Bell state |Φ⁺⟩ = 1/√2 (|00⟩ + |11⟩) and then adjust the relative phase of the second term by applying the Z gate to one of the qubits, or apply an X gate to one of the qubits before applying the Hadamard gate to it and using it as a control in CNOT gate – the possibilities are endless! At the same time we don’t really care which path to the solution the learner takes – the idea of the task is to practice using Pauli gates and the CNOT gate to prepare entangled states, and if the end result is the right superposition state, the task achieved its goal.

Of course, sometimes the goals of the task are more sophisticated than this. The first time we hosted a workshop using the prototype of the DeutschJozsaAlgorithm kata, one of the attendees went ahead and implemented the classical solution to the problem solved by the Deutsch-Jozsa algorithm (figuring out whether the given function is constant or balanced), applying the quantum oracle to basis states to evaluate the classical function. This is a valid classical approach (and later we added it as a separate task to the ExploringDeutschJozsaAlgorithm tutorial), but not the quantum algorithm we’re looking for! We had to add an extra check to count the number of times the given oracle is applied in the learner’s solution, and if it is more than once, fail the test.

Over the years we have accumulated quite a box of tricks for testing different kinds of programming tasks, and I’ll share some of them in the second part of this post. For now, let’s take a look at the simplest example (that is also historically the first type of tasks developed for the Katas) – testing a state preparation task.

Let’s use our Bell state preparation task again: given a pair of qubits in the |00⟩ state, prepare the state |Φ⁻⟩ = 1/√2 (|00⟩ – |11⟩).

First, how does the task signature look like? We want the task to take a pair of qubits as a parameter and have no return – the result of the task is the change in the qubits’ state. The Q# signature that matches this is

operation PrepareBellStatePhiMinus (qs : Qubit[]) : Unit { // ... }

This is it! In the task we leave the operation body blank and mark the part that needs to be filled by the learner with a `// ...`

comment.

To get the reference solution, we just copy the task signature, rename the operation and fill in the code that solves the task.

operation PrepareBellStatePhiMinus_Reference (qs : Qubit[]) : Unit { H(qs[0]); CNOT(qs[0], qs[1]); Z(qs[0]); }

Now, how can we test this kind of a task?

Remember that Q# doesn’t give us direct programmatic access to the amplitudes of the quantum state vector, since that doesn’t match the physical reality of a quantum-mechanical system. Instead, it offers a variety of operations in the Microsoft.Quantum.Diagnostics namespace that can only be applied when running the code on a simulator – which is the case for the Katas – and allow to provide diagnostics on the simulator and to check various assertions about its state. In our case we’ll run the test on the full state simulator and use AssertAllZero operation which passes if all qubits of the given array are in the |0⟩ state and fails otherwise.

At this point an attentive reader should ask “Wait, we are given the |00⟩ state, we’re not trying to prepare it, are we?” We’ll need to do one more step before we can use this assertion to implement our test, and this step involves the reference solution for the task and the very convenient ability of Q# compiler to generate adjoints of quantum operations automatically.

More specifically, we have the learner’s solution that implements a transformation U, and we need to check whether it transforms the initial |00⟩ state to the required state |Φ⁻⟩:

We also know that our reference solution R performs this transformation correctly:

Let’s apply adjoint of our reference solution R† to both parts of the check we want to do:

We see that if we start with the |00⟩ state and apply first the learner’s solution and then the adjoint of the reference solution, we’ll end up with the |00⟩ state again if and only if the learner’s solution did indeed prepare the |Φ⁻⟩ state. Importantly, the results of this check don’t depend on the path the solution took to arrive to the required state.

The code implementation of this test ends up being shorter than the explanation of the logic behind it: once we add “is Adj” to the signature of the reference implementation to enable automatic adjoint generation,

@Test("QuantumSimulator") operation TestPrepareBellStatePhiMinus () : Unit { use qs = Qubit[2]; PrepareBellStatePhiMinus(qs); Adjoint PrepareBellStatePhiMinus_Reference(qs); AssertAllZero(qs); }

This testing harness can be improved further. For example, the error message it produces, “Qubit in invalid state.”, is not very helpful for the learner. The Superposition kata makes an extra effort to output the desired superposition state and the state prepared by the learner’s solution (using another convenient diagnostic operation DumpMachine) before comparing these states.

In part 2 of this blog post we’ll take a look at other types of programming tasks offered in the Quantum Katas and the tools we use to test them. Stay tuned!

The post Inside the Quantum Katas, part 1 appeared first on Q# Blog.

]]>The post Interning at Microsoft Quantum – 2021 appeared first on Q# Blog.

]]>This summers’ internships turned out to be quite different from what we planned for when we sent out offers to our interns in February. We were looking forward to a perfectly regular summer, the interns flying in from all over the world to join us in Redmond… And then COVID happened, which, among everything else, meant that there would be no travel and no in-person interactions with the interns. Fortunately, Microsoft has been able to save most internships by switching them to virtual format. But that posed a new set of challenges: how to make a virtual experience as immersive, educational, and enjoyable as an in-person internship would have been?

The work on the projects looked very similar to a regular year, with the addition of a fair number of extra meetings. Admittedly, it is a lot easier to catch your mentor online in a scheduled one-on-one than in an impromptu meeting like one would normally do when sharing an office. The interns’ project presentations were not changed much compared to last year as well, with other interns and employees stopping by to listen in a Teams meeting instead of a meeting room.

Social and networking events proved to be more of a challenge. Some of them, like the OneWeek Hackathon and Intern Puzzle Day, switched to online format relatively easily – a lot of the experience in these events depends on one’s team, and both offered great ways to find a good team to hack or to solve puzzles with. The “Introduction to quantum computing” workshop hosted by our team for the interns made the transition nicely as well, attracting over 700 interns from across the company and ending up being one of the favorite intern events throughout the summer. The main downside of the newly online events format? No new cool photos to commemorate them!

Other events required some ingenuity to orchestrate. How do you replace bumping into a fellow intern at the watercooler or joining an employee from a different part of the company for a chat at lunchtime? Our team organized multiple events to attempt to replicate or replace various parts of the experience – from “open office” times with team leaders and weekly brown bags where team members talked about their work to a Q# learners club to weekly online “board game nights” and an occasional virtual escape room. Some of these opportunities were only introduced this year, and we hope that helped to make the virtual experience both useful and memorable!

In the upcoming season we will be offering three different types of internships:

- Research internships are the most traditional of our internships, targeting graduate students pursuing a PhD in quantum computing. (Read more about the past research internships in the last year’s announcement.)
- In 2019 we introduced quantum programming internships, focusing on software projects in Quantum Development Kit or Azure Quantum. I hope to share more information about our interns’ projects later, as they are polished up and/or released to the public. Here is a sneak peek at the project two of our interns worked on – new %trace and %debug commands for Q# Jupyter Notebooks. (You can also read more about the previous quantum programming internships in last year’s announcement.)
- In the new program management internship the intern will work with our Azure customers to design Azure Quantum to help them achieve their goals.

Regardless of the kind of projects our interns will work on, one thing I’m certain about – this will be an awesome experience for them!

Does this sound like a great way to spend your summer? Apply to our open internship positions today! Application deadline is January 8

^{th}, 2021.

**Update (November 23 ^{rd})**: Per the announcement, our 2021 Intern Program will be fully virtual in 2021. As was the case last season, our program is able to support internships for students located in the US and Canada.

The post Interning at Microsoft Quantum – 2021 appeared first on Q# Blog.

]]>The post Q# Advent Calendar 2020 appeared first on Q# Blog.

]]>The rules are simple:

- Reserve a slot by leaving a comment on this post. (You can also tweet about it, but you’ll have to mention @tcNickolas to make sure we’ve seen it!) The slots are assigned on the first come, first serve basis. You do not have to announce the topic of your blog post until you’re ready to publish it, but we’d really love to hear it beforehand. (This also helps other bloggers to pick a topic that is not too close to the ones already covered.)
- Prepare a blog post (in English) about Q#, cool project you’ve done in Q#, learning Q#, teaching Q#, using Q# for research, tools for working with Q#… You got the idea.* Don’t forget to check out the previous calendars for inspiration!
- Publish your blog post on your assigned date. Don’t forget to link back to the Q# Advent Calendar from your post, so that your readers can find the entire advent.
- Leave the link to your blog post in a comment to this post, and we’ll add it to the calendar. If you share a link to your post on Twitter, use hashtags #qsharp and #QsAdvent.

**Q# Advent Calendar accepts only original content.*

Looking forward to reading your Q# stories!

The post Q# Advent Calendar 2020 appeared first on Q# Blog.

]]>The post Celebrating our open source community with Hacktoberfest appeared first on Q# Blog.

]]>The Quantum Development Kit (QDK) includes a lot of components: from the samples and libraries that were released as open source back in 2017, to the compiler and runtime open sourced in 2019, to the newest addition to the roster – Q# language repository that hosts language design discussions. (Here is an excellent overview of the components and open source repositories that are part of the QDK.)

As the footprint of our open source code grew, so did the community around it. The most active of our open source repositories – the collection of tutorials and programming exercises on quantum computing called the Quantum Katas – has over a hundred contributors, only around 20% of them from Microsoft Quantum team!

Some of our contributors have been with us for over a year; it doesn’t seem like a long time, until you remember that the QDK itself is less than three years old! Today I am delighted to recognize one of our most dedicated contributors, Vincent van Wingerden, and to promote him to the role of maintainer of the Quantum Katas. In his day job Vincent is a technical architect at Microsoft for Data & AI, helping people create the best possible data solutions on Azure. He started contributing to the Quantum Katas in November 2019, and since then he did a lot of work on the workbooks – the detailed explanations of the solutions to the programming tasks offered in the tutorials. In fact, Vincent is the second most active contributor to the Katas – and now he has a chance to experience the other side of the open source, helping others to do their first contributions.

Over the past year we hosted several internal Hackathons, including a Hacktoberfest celebration at the Microsoft Garage.

This October, in-person meetups are not really an option, so we decided to take the experience online – and open it to everybody worldwide!

One of the most important things in getting started is finding just the right thing to work on. People new to GitHub need something very simple, so that they can focus on mastering the contribution process itself – it is not complicated but can be baffling when going though it for the first time. Experienced GitHub users might pick a slightly more complicated issue to learn more about quantum computing or compilers. And regular contributors can challenge themselves to do an advanced project, though they are not shy about doing it any time of year!

With this in mind, we selected a variety of issues spanning nearly all areas in the QDK and a broad range of complexity, from small writing tasks to fixing bugs and developing small features.

- The Quantum Katas issues.
- Q# samples issues.
- Q# libraries issues.
- Q# compiler issues.
- Documentation issues.

You can also check out our contribution guide and browse all our repositories to see if there is something not on this list that piques your curiosity.

Ready to start? Here are three easy steps:

- Register for Hacktoberfest. Once you send 4 pull requests to GitHub repositories this October, you’ll be eligible for their “tee or tree” reward – a Hacktoberfest T-shirt or a tree planted on your behalf.
- Join our kick-off call on October 8th to meet the maintainers of our repositories and learn about the areas you can contribute to.
- Head to our open source repositories, pick an issue with Hacktoberfest label and get started!

We’ll be there to answer your questions and guide you through the contributions.

Happy hacking!

The post Celebrating our open source community with Hacktoberfest appeared first on Q# Blog.

]]>We hear from many students that they’re excited about quantum computing,

The post Interning at Microsoft Quantum appeared first on Q# Blog.

]]>We hear from many students that they’re excited about quantum computing, but are not sure whether they should apply. So we’re going to demystify our internships by sharing some of the projects our past interns have worked on and how being a research intern with our team differs from being an engineering intern.

The Microsoft Quantum internship program started back in 2012 with just three research interns. The program has been growing steadily ever since, reaching a total of 21 interns during summer 2019. Research interns are typically graduate students pursuing a PhD in quantum computing or related subjects. Their internship projects involve exploring new research directions under guidance of full-time researchers on our team, resulting in a paper or even a patent. These internships can grow into a long-term research relationship, and several of our former interns have joined our team as full-time employees soon after their internships. Here are just a few examples:

- Bettina Heim worked on decoding surface codes using maximum likelihood decoding.
- Vadym Kliuchnikov developed an algorithm for circuit synthesis – approximating single-qubit unitary operations with a limited set of gates used by some topological quantum computers.
- Thomas Haner worked on reducing resource requirements for evaluating classical functions on quantum computers, including addition using dirty qubits and evaluating piecewise polynomial approximations.
- Adam Paetznick developed a decomposition technique that uses non-deterministic circuits to approximate single-qubit unitary operations.

In summer 2019, undergraduate students joined our internship program for the first time in software engineering positions. These students focused on software-oriented projects such as improving the Quantum Development Kit. Although our undergraduate software engineering internship are much newer, we already have some neat success stories to share:

- Sarah Marshall implemented code completion for Q# and a state visualization tool that allows you to track the state of the Q# program during the simulation – and just this week she joined the team as a full-time software engineer!
- Rory Soiffer built a framework for Q# code optimizations.
- Artem Astapchuk created a set of tutorials on the basics of quantum computing.

Most of our interns join us on the Microsoft Redmond campus. This means they can participate in all summer events there, from the all-Microsoft OneWeek Hackathon and celebration that bring together interns and employees across the company to intern-only events like Microsoft Intern Puzzle Day and workshops hosted by various teams.

*“Introduction to quantum computing” workshop hosted by our team for all Microsoft interns*

They also get ample exposure to various directions of ongoing quantum computing research, both via their fellow interns’ presentations of their projects and via a weekly journal club.

Does this sound like a great way to spend your summer? Apply to our open intern positions today! Application deadline is January 31

^{st}.

The post Interning at Microsoft Quantum appeared first on Q# Blog.

]]>First,

The post Festivus: Q# Feats of Strength appeared first on Q# Blog.

]]>- First, we open-sourced the QDK and deprecated the UserVoice channel, so there is no single channel for QDK feedback any longer.
- Second, our users don’t typically open GitHub issues just to thank the language creators for an especially nice feature!

Instead, we decided to poll our team members for their favorite Q# feature or a particularly useful tool. Check out their replies below – you might find something new to try!

- The partial application syntax to create closures is actually quite nifty and very useful… Here is an example. –
*Alan Geller* - The functor support is very straightforward and easy to use. Just put Adjoint in front of an adjointable operation and [the compiler] figures it out. –
*Scott Carda* - And that we support borrowing is neat too, for the more quantum savvy people. –
*Bettina Heim* - I would highlight that qubit management happens automatically in a well structured context. –
*Andres Paz* - apply … within and AssertProb. –
*Vadym Kliuchnikov* - QDK is open source! Plus first-class functions and operations + partial application lets you do just about everything. –
*Chris Granade* - Tools for testing and debugging and Jupyter Notebooks support: the first feature to make the Quantum Katas possible and the second one to make them beautiful! –
*Mariia Mykhailova* - It is hard to pick just one thing…
- Q# libraries, from simple (but really useful) tools in the Canon to more complex things like the multiplexer and state preparation tools to specialized libraries written in collaboration with domain experts like the chemistry library and the numerics library.
- The resource estimator that allows you to gather metrics such as number of qubits, circuit depth, and circuit size at scale, i.e., for quantum programs that may involve millions of qubits and billions of quantum gates!
- The effortless ease with which simple quantum algorithms such as Bernstein-Vazirani or hidden shift or Simon’s algorithm can be implemented. Simon’s algorithm needs complex post-processing (linear algebra over GF(2)) and I like how this can be done by using Q# in tandem with C#. Also, the synthesis of permutations is a cool feature.

*Martin Roetteler*

How about you – what is your favorite Q# feature?

The post Festivus: Q# Feats of Strength appeared first on Q# Blog.

]]>Let me continue the topic of teaching and learning quantum computing that I touched upon yesterday and share with you the project done by my summer intern Artem Astapchuk –

The post New Tutorials: Learn the Basic Concepts of Quantum Computing appeared first on Q# Blog.

]]>Let me continue the topic of teaching and learning quantum computing that I touched upon yesterday and share with you the project done by my summer intern Artem Astapchuk – a set of tutorials that introduce the most basic concepts used in quantum computing.

The Quantum Katas start with the BasicGates kata – a set of exercises that ask the learner to identify the quantum gate that will perform the described transformation of a qubit state. It seems like a very easy thing to do – how hard can it be to look up a list of quantum gates and match one of them to the task?

Turns out, it is pretty hard for somebody who sees the quantum computing notation for the first time. Even the easiest task that asks to apply the Pauli X gate relies on a lot of implied knowledge. What is a qubit and its state? What are these weird symbols around 0 and 1? What kind of tools do you use to change the state of the qubit? And how do you express all this in Q#?

Historically the Katas sent the learner to find an external source for learning the basic concepts and notations used in quantum computing. However, eventually it started to make more sense to create a set of tutorials that would teach the learner everything they need to start solving the first katas in one place and using one style.

Well, here they are! Two tutorials that cover the math necessary for working with quantum computing – complex arithmetic and linear algebra – are written in Python, and the four that introduce the quantum computing concepts – qubits and superposition, multi-qubit systems and entanglement, and single- and multi-qubit gates – are implemented in Q#.

We tried to steer away from too much theory and to give just the definitions and the tools necessary for getting started (yes, qubit states are described using Hilbert spaces; no, you don’t need to know this to start learning). Instead, we focused on making the learning process as hands-on as possible, using demos and programming exercises to help learner internalize the new concepts and ideas by applying them to solving simple tasks.

For example, the definition of the imaginary unit *i* is immediately followed by a programming task that asks one to calculate the *n*-th power of *i* *iⁿ*; the introduction of the qubit states is followed by a demo that shows how to examine and interpret the qubit state in Q# using the DumpMachine function, and so on.

If you’re looking to get started with quantum computing, give these tutorials a try and let us know what you think!

Meanwhile, we’ll keep working on bringing you more tutorials. Next up: measurements!

The post New Tutorials: Learn the Basic Concepts of Quantum Computing appeared first on Q# Blog.

]]>