-
Notifications
You must be signed in to change notification settings - Fork 130
Make the most of the QDK and VS Code agent mode
The Quantum Development Kit VS Code Extension works great with agent mode in VS Code. Agent mode is an AI-assisted coding experience, powered by GitHub Copilot, that has powerful capabilities for writing code and performing a variety of other development tasks.
Agent mode works great out of the box, but we can optimize it to work even better with the QDK and Azure Quantum. Here are some tips for a seamless experience:
Add Copilot instructions to your workspace by invoking the command "QDK: Add Copilot instructions file for Q# and OpenQASM".
GitHub Copilot can be configured to look for instruction files. These files provide custom instructions, written in natural language, to customize Copilot for your development flow. Luckily, when it comes to working with the QDK, you don't need to write your own instructions - the QDK includes a prepared set of instructions for Copilot, that include best practices for Q#, OpenQASM and Azure Quantum.
Add these instructions to your settings by opening the command palette (ctrl+shift+p or cmd+shift+p) and choosing "QDK: Add Copilot instructions file for Q# and OpenQASM".
You will see a confirmation prompt before your user configuration gets updated.
Now, whenever you use GitHub Copilot Chat to work in Q# and OpenQASM files, these instructions will be added to your context. You can always manually configure this setting in chat.instructionsFilesLocations
.
Make sure Azure Quantum Development Kit (QDK) tools are enabled in the agent mode tools shown at the bottom of the chat input box.
What makes agent mode so powerful is its ability to call specialized tools that perform specific development tasks.
The QDK extension includes a set of tools to allow working with Q# and Azure Quantum. You can simulate Q#, show circuit diagrams, and perform resource estimation directly from the Copilot chat view. You can also connect to your Azure Quantum workspace, submit jobs, see their status and results, etc.
Make sure these tools are enabled by clicking the Tools icon at the bottom of the chat input box.
This will bring up a list showing all the enabled tools - you'll want to make sure that all the tools under "Azure Quantum Development Kit (QDK)" are enabled.
Choose a model that works best for your workflow, such as Claude 3.7 Sonnet for Q# development.
Copilot will let you use different language models. Different models have different strengths, so it's worth exploring how they perform at the specific tasks you want to do. Take a look at the selections in the drop down at the bottom of the chat input box.
At the time of writing, we've been impressed with Claude 3.7 Sonnet's ability to write and understand Q# code, and to integrate with the Azure Quantum tools - but models change quickly, so do experiment!
You're all set up to explore quantum computing, Q#, OpenQASM and Azure Quantum.
For starters, here are a few prompts you can throw at it - but go ahead and challenge agent mode with your own specific requests and advanced scenarios!
Simulate this program for 1000 shots and show me a histogram.
Submit this Q# program to Azure Quantum.
Add tests for this Q# code.
Show me my recent jobs on Azure Quantum.
Hey, I've been meaning to learn a bit about quantum computing but I have no clue where to even start. Can you just help me write a very simple program, understand it, and maybe even run it on a real quantum computer?
Q# Wiki
Overview
Q# language & features
- Q# Structs
- Q# External Dependencies (Libraries)
- Differences from the previous QDK
- V1.3 features
- Curated list of Q# libraries
- Advanced Topics and Configuration
OpenQASM support
VS Code
Python
Circuit diagrams
Azure Quantum
For contributors