microsoft/qdk
Publicmirrored fromhttps://github.com/microsoft/qdkAvailable
katas/README.md
52lines · modecode
| 1 | # Katas |
| 2 | |
| 3 | A Kata is a top-level container of educational items which are used to explain a particular quantum computing topic using Q#. They are organized in sections which can be of three types: |
| 4 | |
| 5 | - Lessons: text content that sometimes contains Q# code examples. |
| 6 | - Exercises: problems that the user solves by writting Q# code. |
| 7 | - Questions: analytical problems that have a text answer. |
| 8 | |
| 9 | ## Run Katas Online |
| 10 | |
| 11 | Visit [Learn with Azure Quantum katas](https://quantum.microsoft.com/experience/quantum-katas) to try the new online Azure Quantum katas experience, with integrated assistance from Copilot in Azure Quantum. |
| 12 | |
| 13 | ## Build Katas Locally |
| 14 | |
| 15 | We need to build the `playground` module to see the built katas locally. For the detailed instructions, refer to [Building Playground Locally](../playground/README.md#building-the-playground-locally). |
| 16 | |
| 17 | ## Rust crate |
| 18 | |
| 19 | The katas crate exposes an API to check solutions for exercises. |
| 20 | |
| 21 | ## Composition |
| 22 | |
| 23 | Katas are composed through an index.md markdown file that uses macros to indicate how to produce content for different kinds of sections. |
| 24 | |
| 25 | ### Macros |
| 26 | |
| 27 | Macros are meant to insert interactive elements into the content defined through markdown. A macro starts with the `@` character followed by a word inside square brackets where the word represents the name of the macro (e.g. `@[example]`). This is followed by a JSON string enclosed within parenthesis `({...})` where the JSON string represents the properties of the macro that determine the interactive content. The macro is terminated by a line break `\r?\n`. |
| 28 | |
| 29 | The following macros are available for katas composition: |
| 30 | - @[exercise]: Used to create Q# code exercises that we can be automatically verified. |
| 31 | - id: Unique identifier for the exercise. |
| 32 | - title: Title that will be displayed for the exercise. |
| 33 | - path: Path to a folder that contains the description of the exercise. This folder should contain the following files: |
| 34 | - `index.md`: the Markdown description of the exercise. |
| 35 | - `Placeholder.qs`: the Q# code that is given to the learner to start with. |
| 36 | - `Verification.qs`: the Q# code that checks whether the learner's solution is correct. |
| 37 | - `solution.md`: the Markdown description of the solution(s) to the exercise. |
| 38 | - `Solution.qs`: the Q# code that contains a "reference solution" described in `solution.md`. |
| 39 | - qsDependencies: Q# file paths used in addition to `Verification.qs`. This code is not shown to the learner but is used to build the learner's code. The @EntryPoint operation is called to check the solution (eventually, for the convention is to call Kata.Verification.CheckSolution). |
| 40 | - @[example]: Standalone Q# code snippets that can be referenced from markdown files. |
| 41 | - id: Unique identifier for the example. |
| 42 | - codePath: Path to a Q# file that contains the example code. |
| 43 | - @[solution]: represents a solution to a Q# code exercise. It is meant to be compiled as if it was the user authored code that solves a Q# code exercise. It can only be used in solution markdown files. |
| 44 | - id: Unique identifier for the solution. |
| 45 | - codePath: Path to a Q# file that contains the solution code. |
| 46 | - @[section]: A kata is broken into multiple sections. This starts a new section. Exercises are their own sections. |
| 47 | - id: Unique identifier for the section. |
| 48 | - title: Title of the section. |
| 49 | |
| 50 | ## Acknowledgements |
| 51 | |
| 52 | Content of these web-based katas is largely a port of the previous effort located in the [QuantumKatas](https://github.com/microsoft/QuantumKatas) repository. Please refer to that repository for a history of contributions. |
| 53 | |