Setup#
Installation#
To install the latest version of Deltakit, run:
pip install deltakit
Installation in a virtual environment or Colab#
In a terminal with your favourite distribution of Python/pip on the path, browse to a working folder for the virtual environment and run:
# please use your virtual environment,
# or create a new one with these commands:
python3 -m venv venv
source venv/bin/activate
# and then install Deltakit:
pip install deltakit
# please use your virtual environment,
# or create a new one with these commands:
python -m venv venv
venv\Scripts\activate
# and then install deltakit:
pip install deltakit
Note: Deltakit depends on stim and other libraries that may need to be compiled from source
during installation. If you have trouble compiling, consider installing
Build Tools for Visual Studio
with the “Desktop development for C++” workload.
# remove conflicting dependency:
!pip uninstall datasets -y
# and then install deltakit:
!pip install deltakit
Authentication#
Some Deltakit code relies on requests to servers sent over the internet, so you’ll need to set up credentials before using Deltakit for the first time.
After visiting the Deltakit website to generate an access token, register it with Deltakit.
from deltakit.explorer import Client
Client.set_token("<your token>")
By default, this token is stored in a configuration file, so this setup only needs
to be performed once. If you prefer, you can add your token manually as an
environment variable
DELTAKIT_TOKEN.
You can check that your token is correctly configured by running the following code:
client = Client.get_instance()
You can provide the resulting client object as an argument to features that
(currently) require communication with servers.