Qiskit is tested and supported on the following 64-bit systems:
- Ubuntu 16.04 or later
- macOS 10.12.6 or later
- Windows 7 or later
Qiskit supports Python 3.5 or later.
We recommend installing Anaconda, a cross-platform Python distribution for scientific computing. Jupyter Notebook, included in Anaconda, is recommended for interacting with the Qiskit tutorials.
Using Qiskit on Windows requires VC++ runtime components. We recommend one of the following:
- Microsoft Visual C++ Redistributable for Visual Studio 2017
- Microsoft Visual C++ Redistributable for Visual Studio 2015
We recommend using Python virtual environments to cleanly separate Qiskit from other applications and improve your experience.
The simplest way to use environments is by using the conda
command, included with Anaconda. A
Conda environment allows you to specify a specific version of Python and set of libraries. Run the
following commands from a terminal window:
conda create -n name_of_my_env python=3
This will create a minimal environment with only Python installed in it. To put yourself inside this environment run:
source activate name_of_my_env
On Windows the command is:
activate name_of_my_env
The final step required is to install Qiskit with the following command:
pip install qiskit qiskit-aqua
There are optional dependencies that are required to use all the visualization functions available in Qiskit. You can install Qiskit along with these optional dependencies by running
pip install qiskit[visualization] qiskit-aqua
When installing the elements and components from source, by default their development
version
(which corresponds to the master
git branch) will be used, as opposed to the stable
version
(which contains the same codebase as the published pip
packages). Since the development
versions of an element or component usually includes new features and changes, in general they
require using the development
version of the rest of the items as well.
In order to work with several components and elements simultaneously, it is recommended that the following steps are followed for each item:
clone the repository.
ensure that the stable version is not installed in the environment:
pip uninstall name-of-the-package
install the package in editable mode. From the root directory of the repository:
pip install -e .
For more information see:
IBM Q offers several real quantum computers and high-performance classical computing simulators through its quantum cloud services with Qiskit.
Create a free IBM Q account to get an API token.
After logging in, navigate to your account settings.
Navigate to the Advanced tab and click the Generate button in the API Token section.
Store your API token locally for later use in a configuration file called qiskitrc
by running
the following Python code:
from qiskit import IBMQ
IBMQ.save_account('MY_API_TOKEN')
where MY_API_TOKEN
should be replaced with your token.
Note
IBM Q Network members must specify more than just an API token, as explained below.
If you are a member of the IBM Q Network, you must pass an additional argument to
IBMQ.save_account()
. The url
argument can be found on your q-console account page, along
with any other additional information required, e.g. proxy information. Pass your API token and the
url
argument by running the following Python code:
from qiskit import IBMQ
IBMQ.save_account('MY_API_TOKEN', url='https://...')
Refer to :ref:`advanced_use_of_ibm_q_devices_label` for more details, such as how to manage multiple IBM Q account credentials.