The qBraid Lab Environment Manager is a streamlined quantum software package and virtual environment management system provided to qBraid end-users through a simple, intuitive graphical user interface. It offers curated development environments in Python, Julia, C++, and Q# over a range of quantum applications, is highly customizable, and facilitates direct connections to quantum hardware.
To expand the Environment Manager sidebar, click on Envs in the upper-right of the Lab console. My Environments are your currently installed environments. The qBraid Default Python environment is pre-installed for all users. For Standard/Pro users, a number of other environments are also available pre-installed. These include Microsoft QDK (Q#), the Intel® Quantum SDK (C++), Bloqade (Julia), cuQuantum (CUDA), and more.
qBraid Lab provides a suite of 30+ pre-packaged virtual environments dedicated to popular quantum software packages. These include but are not limited to Qiskit, Cirq, Amazon Braket, Pennylane, PyQuil, TensorFlow Quantum, and more. Each environment incorporates not only the primary packages but also recommended add-ons and configurations. Environments are pre-configured to function out-of-the-box, eliminating the hassle of manual installations and potential dependency conflicts.
Comprehensive Environment Search:
Locate and install the ideal environment for your project by searching by name, description, tag, or package. This intuitive search feature ensures you find an environment tailored to your use case.
Stay updated without the hassle. Minor software updates are reflected in the pre-packaged environments, which users can reinstall to access. For significant or breaking updates, entirely new environments are made available, preserving the integrity of projects relying on earlier versions.
Customize and Share:
Customize pre-packaged environments by installing or upgrading packages, or create your own custom environments that can be shared directly with other qBraid Lab users.
Detailed Dependency Overview:
Each environment showcases a complete list of its packages, akin to a pip freeze. Users can browse and search through these packages pre- and post-installation, making it easy to keep track of the tools at their disposal. This package list is dynamically updated to mirror any user-driven changes.
Direct Hardware Connectivity:
Environments marked with the
quantum-jobstag can be used to connect directly to a range of QPU devices from leading providers, including IonQ, Oxford Quantum Circuits, QuEra, Rigetti, and AWS on-demand simulators, with no additional access keys required.
For those who prefer terminal-based interactions, qBraid Lab provides a command-line interface that mirrors the functionalities of the GUI-based Environment Manager. Users can activate environments, manage kernels, install new packages, enable quantum jobs, and much more directly from their terminal.
1. In the Environment Manager sidebar, click Add to view the environments available to install.
2. Choose an environment, expand its pannel, and click Install.
3. Once the installation has started, the pannel is moved to the My Environments tab. Click Browse Environments to return to the My Environments tab and view its progress.
4. When the installation is complete, the environment panel’s action button will switch from Installing… to Activate.
1. In the Environment Manager sidebar, click Add, then click New Environment.
2. Give your custom environment a name, description, add tags, upload a logo,
and specify any packages to install using a
After clicking Create, a new environment panel is created for your custom environment. You can view the environment’s install progress by returning to My Environments.
3. Once the environment has been created and any package installations have finished, the environment panel’s action button will switch from Installing… to Activate, and the installed packages number will be updated.
4. Click on More to verify/view the environment’s list of installed packages. You can use the search bar or scroll through the Python package (pip) list to find the exact versions of all packages and package dependecies that were installed. From the More pop-out, you can also install additional packages, remove packages, add/delete tags, and edit the environment’s description.
Uninstall / cancel install environment
To uninstall an environment or cancel the installation of an environment, click on More, and then Uninstall or Cancel Installation.
Install new package
There are three ways to install a new package into an environment on qBraid:
2. IPython magic command
From inside a notebook, run your pip command using the “magic”
% operator to install
the desired package(s) within the current kernel:
%pip install [pkgs]
3. Directly from terminal
From Launcher, under “Other”, click on Terminal. By default, your qBraid terminal opens using
Python (and pip) from
/opt/conda/bin. Packages that are installed directly at this top-level
will not persist between sessions. Instead, use the qBraid CLI to list your environments,
$ qbraid envs list # installed environments: # qsharp /opt/.qbraid/environments/qsharp_b54crn default jobs /opt/.qbraid/environments/qbraid_000000 qbraid_sdk jobs /home/jovyan/.qbraid/environments/qbraid_sdk_9j9sjy qiskit /home/jovyan/.qbraid/environments/qiskit_9y9siy
activate an environment, and perform your pip installs from there. For example, installing pytket into the qiskit environment:
$ qbraid envs activate qiskit $ python -m pip install pytket $ deactivate
Activate environment (kernel)
Clicking Activate creates a new ipykernel, see Add/remove kernels for more.
qBraid environments are simply Python virtual environments in disguise. There are two directories where qBraid environment can be found. One at the system level, and one at the local / user level:
$ echo $QBRAID_USR_ENVS /home/jovyan/.qbraid/environments $ echo $QBRAID_SYS_ENVS /opt/.qbraid/environments
The environments at the the system level are reset each time you launch Lab, so any changes made to these environments will not persist between sessions. The user level environments are yours to modify: any and all changes you make to these environments will still be there the next time to launch Lab. The qBraid CLI provides convenient short-cuts to activate and install pacakages into your qBraid environments, however all of the traditional commands to activate and manipulate Python venvs still apply. For example, you can activate an environment using the source command:
$ source $QBRAID_USR_ENVS/<slug>/pyenv/bin/activate
If you’re working in terminal, you don’t specifically need to activate a qBraid environment, as you can just specify the full path to that environment’s
Python interpreter when invoking Python, e.g.
/<path-to-venv>/bin/python. The same is true for
pip commands. So if you are attempting to install
new packages into a qBraid environment from terminal or inside a notebook, make sure to use the full pip path, or use one of the three approaches
detailed above. Simply running
pip install ... will default to
/opt/conda/bin/pip, which will cause dependency conflicts, and the installed packages will be overridden the next time you launch lab.