Qiskit VSCode Extension: a new tool to enhance your quantum programming experience
Our Qiskit VSCode extension was designed to enable developers to easily integrate Qiskit coding into their regular software workflow using Visual Studio Code, one of the most popular editors. This extension helps users keep Qiskit up to date, detect code errors and autocomplete code. These features aim to help beginners learn the right syntax for Qiskit, and help advanced users and researchers find errors faster and remember parameters for various Qiskit functions. By leveraging this functionality, users can spend more time running experiments instead of troubleshooting errors.
It is available at the Visual Studio Code Marketplace.
As stated in other posts, a central goal of Qiskit is to build a software stack that makes it easy for anyone to use quantum computers. This goal is the inspiration for the Qiskit software roadmap, and will help our community both advance the state of the art in quantum computing and grow to include new people with different skills. The Qiskit team and community are driving innovation across the quantum software stack from libraries and components like Qiskit’s Terra, Aqua, Ignis or Aer, and now we are excited to share new tools that boost productivity and make developing code smoother for quantum computing practitioners.
Visual Studio Code (VSCode) is a popular code editor that embraces the open source philosophy and encourages collaboration. It also allows the community to develop and add extensions that bring new functionality to its users. Some of the new features that our Qiskit VSCode extension add to your VSCode IDE include:
- Seamless integration with the IBM Q Experience platform
- Automatic management of Qiskit dependencies.
- An easy way to run and visualize the results of the experiments.
- Dynamic error detection in the code.
- Code auto-completion.
- Inline documentation.
This extension is open source, so we expect and encourage you to collaborate with us to continue to improve it. We invite you to check out the GitHub repository (https://github.com/Qiskit/qiskit-vscode/).
Getting Started With the Qiskit VSCode Extension
The best way to discover the full power of this tool is to try it :-)
- Python 3.5+ previously installed (or a valid distribution like Conda) and pip 9.0.X+
- A valid IBM Q Experience account with its API token (explained below)
Steps to launch a code example:
- Launch VSCode on your computer, open the extensions tab (shift + cmd/ctrl + X), search for the `qiskit-vscode` extension, and click on the install button. The IDE will reload or ask you to reload manually. And voila! Extension installed. You will now be able to execute OpenQASM or Qiskit code on the Qiskit simulators. Access to real quantum hardware requires an account at IBM Quantum Experience.
- [Optional] Configure your IBM Q Experience token (https://quantumexperience.ng.bluemix.net/qx/experience).
- [Optional] Access your profile (on the top right section of the screen), click on the advanced section and copy your token.
- [Optional] Go to VSCode and launch the Command Palette (shift + cmd/ctrl + P), search for `Enter your QConfig` and press enter. A dialog box will ask for the token information as well as other optional info like your hub/group/project (if you do not know what they are, you can dismiss them).
- Copy the next file into the editor and save it as test.py.
6. Now you can execute the code using the `Run this Python’ button at the top of the editor screen.
Now we need the help of all Qiskitters to make this extension an awesome tool that can make the development of quantum programs easier and much more powerful. We invite you to bring your ideas, any bugs you detect or your own PR’s to the GitHub repository (https://github.com/Qiskit/qiskit-vscode/).