Installation
Python
HQStage comes with minimal requirements. You only need to have a working Python installation on your system. The hqstage
CLI tool requires python>=3.9
. Depending on your operating system you can install
Python following the instructions for Unix (Linux and BSD),
Mac or Windows.
Please try if the correct command in your environment is python
or python3
. Please adapt the following commands accordingly.
Running Python in Windows
Running Python in Windows
Throughout this documentation we assume that you use PowerShell to execute commands.
If you installed Python via WindowsApp store it will be added to the Path and you can use all commands of the form
python ...
in Windows PowerShell. If Python is not in your Path (you get an ObjectNotFound
error when execting Python) you have to replace python
with the path to your python.exe
, e.g.
<venv>\Scripts\python.exe
if you have installed a virtual environment as described below.
Default path Windows PowerShell
Default path Windows PowerShell
The default working directory when starting Windows PowerShell can be C:\Windwos\System32
. This folder is read-only and you will not be able to change or create any files therein.
To avoid errors when running hqstage change directory to another folder, e.g., by typing
cd
Virtual environment
We recommend to install HQStage into a virtual environment using venv or mamba.
For this guide we assume you create a virtual environment using venv
but feel free to use your preferred envrionment management tool.
Once you have installed Python on your system you can create and activate a virtual
environment called “HQStageBase” in your user directory using
Posix:
python -m venv ~/HQStageBase
. ~/HQStageBase/bin/activate
Windows:
python -m venv $env:USERPROFILE\HQStageBase
~\HQStageBase\Scripts\Activate.ps1
We will call the path to your environment, e.g., ~/HQStageBase
, $env:USERPROFILE\HQStageBase
, or <venv>
from now on. If you are using a special shell you might need a different command to activate the environment:
Shell specific activation
Shell specific activation
Posix:
shell | command |
---|---|
sh, bash, dash, zsh | . <venv>/bin/activate |
fish | . <venv>/bin/activate.fish |
csh, tcsh | source <venv>/bin/activate.csh |
Windows:
shell | command |
---|---|
PowerShell | <venv>\Scripts\Activate.ps1 |
Execution policy not allowing scripts error in Windows
Execution policy not allowing scripts error in Windows
If you get an error that execution of scripts is deactivated you can use
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
to allow unrestricted execution of local scripts for the current user. See here for more information on execution policies in Windows.
It is the user’s responsibility to assess the risks of this change in settings.
Instead of allowing execution of scripts you can replace every python
with <venv>\Scripts\python.exe
. In this case you do not have to activate the virtual environment.
Once activated all python commands will run in the virtual environment and pip will install packages into the virtual environment instead of the system wide python installation.
Installing HQStage
Once Python has been setup the hqstage
CLI tool can be installed. HQStage uses open source libraries. A list of used libraries can be found in the cli documentation.
Please follow the download link for HQStage on cloud.quantumsimulations.de/software and copy the corresponding pip command. To see the download link you have to have an active license for HQStage connected to your account. You can request access to a free trial license for the HQStage including access to the modules HQS Noise App and HQS Qorrelator App here. The pip command has the following form:
python3 -m pip install --upgrade --index https://token:user-[a long ID]@license.dev.cloud.quantumsimulations.de/v1/engines/pypi/simple hqstage
In some environments it might be necessary to use python -m pip install ...
instead. If you run into problems with both versions please try just pip install ...
.
Now, hqstage
is available in your Python environment. After restarting your terminal you can
execute hqstage
by running
hqstage