- Visual Studio Code
- An IBM Quantum premium account
To install the extension
- Launch Visual Studio Code
- Click on the Extensions tab
- Search for
qiskit-vscode
- Click Install for the "Qiskit Code Assistant"
To remove the extension
- Go into the Extensions tab in Visual Studio Code
- Select the Qiskit Code Assistant extension under the INSTALLED section
- Click Uninstall
To make calls to the service API the extension requires an IBM Quantum API token.
- Open the IBM Quantum website in your browser
- Login with your IBM Quantum account
- Copy the API token displayed on the upper right side of the webpage (after logging in)
When the extension first starts the status bar will show a spinning icon meaning it is trying to connect to the service
If successful, the status will change to display the model name
If the spinning icon disappears and the status bar remains with the "No Model Selected" message then you may need to enter your API Token.
-
In Visual Studio Code press
Cmd/Ctrl+Shift+P
to open the VS Code command palette -
Type
Qiskit
-
Select the Qiskit Code Assistant: Set IBM Quantum API token command
-
Paste the IQP API token copied earlier from IBM Quantum page and hit Enter.
By default, the extension will use the granite-8b-qiskit
model. It will appear in the Model Picker in the bottom status bar.
The first time you use the granite-8b-qiskit
model a model info view will open and explain a little about the model with links to documentation and the model's license. It will also list some major restrictions that you should be aware of when using the model. Clicking Accept
will accept the model disclaimer and enable the model for code generation.
Once you've accepted the model disclaimer you can open a new file and start typing. If you type Ctrl+.
, some faded text should appear with model-generated suggestions.
You may press Tab
to accept the model-generated suggestion or press ESC
to cancel/reject the model-generated suggestion.
Afterwards, you may type Ctrl+.
again to generate additional suggestions. Also, when you see the faded text (i.e., model-generated suggestion) you can type Alt/Option+]
and Alt/Option+[
to cycle forward and backward, respectively, through the suggestions (if available). You can also hover the cursor over the faded
text to use the pop-up toolbar to cycle through the suggestions.
If necessary, you can update some settings for the extension.
-
To change the instance of the Qiskit Code Assistant Service that the extension should use you can edit the
Qiskit Code Assistant: Url
in the User Settings -
Keyboard shortcuts can be changed by searching for
qiskit-vscode
in the Keyboard Shortcuts settings -
The Telemetry can be disabled by unchecking the
qiskitCodeAssistant.enableTelemetry
setting or turningoff
thetelemetry.telemetryLevel
setting:NOTE: The telemetry does not collect your code nor the suggested code completions. What is collected is whether a code suggestion was accepted or dismissed.
If you are not seeing the extension status bar in Visual Studio Code, check the extension is installed and enabled under the Extensions tab.
If the extension is installed and enabled, but not able to select a model, make sure your current API Token has been added and the Qiskit Code Assistant: Url
setting is properly configured.
General feedback can be provided to the Qiskit Code Assistant team by clicking on the Provide feedback
icon in status bar (left of the Qiskit Code Assistant model info).
Feedback for a specific prompt and generated code suggestion can be provided by clicking on the thumbs up
/thumbs down
icons that appear immediately above the suggested code block.