> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qbraid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment Manager

The [Environment Manager](https://youtu.be/LyavbzSkvRo) 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 and Q# over a range of quantum applications.

Click on the `ENVS` tab in the upper-right of the Lab console to expand the Environment Manager sidebar and view
a list of your currently installed environments. The qBraid "Default" Python environment is pre-installed for all users.

## Install environment

1. In the Environment Manager sidebar, click **Add** to view the environments available to install.

2. Environments are arranged in **groups**. Navigate to the correct environment group such as Qiskit, Pennylane, etc and click to view environments present inside that group.

3. Choose an environment, expand its panel, and click **Install**. Once the installation has started, the panel is moved to the **Environments** tab. Click **Browse Environments** to return to the **Environments** tab and view its progress.

<div style={{ display: "flex", justifyContent: "center", alignItems: "center" }}>
  <img src="https://storage.googleapis.com/qbraid-static-assets/qbraid-docs/lab/env-manager-overview.gif" alt="environment" width="100%" />
</div>

4. When the installation is complete, the environment panel's action button will switch from **Installing…** to **Add kernel**.

5. You can also choose to filter based on the **Package** or **Subject Matter** groups. The **Package** button filters environments based on the primary quantum software package they support, while the **Subject Matter** button filters environments based on the quantum computing domain or application area they are designed for.

<div style={{ display: "flex", justifyContent: "center", alignItems: "center" }}>
  <img src="https://qbraid-static.s3.us-east-1.amazonaws.com/lab-env-manager/filter-buttons-groups.gif" alt="filter buttons" width="100%" />
</div>

### Discover via access code

Environments shared via access code are not publicly listed. To install one of these private environments, first enter the access code
in the "Discover via access code" field and click the "**+**" button. This will add the environment to your sidebar. You can then enter
the environment name in the search bar or scroll to find it, and proceed with step 2 above to install it as usual.

If the environment doesn’t appear in search results after entering the access code, click **Browse Environments** to go back to the
main sidebar, click the **Refresh** icon, and then click **Add** to return to the search page and browse for the environment again. If the
issue persists, ensure that you've entered the correct access code and are searching for the correct environment name. If you continue to
experience problems, please [contact our support team](mailto:contact@qbraid.com).

<div style={{ display: "flex", justifyContent: "center", alignItems: "center" }}>
  <img src="https://mintcdn.com/qbraidco/MWMLuPZDp_BcNo9C/lab/_static/env_discover.png?fit=max&auto=format&n=MWMLuPZDp_BcNo9C&q=85&s=1b7520e5392817dd89797ac1c0dc5bb2" alt="discover" width="100%" data-path="lab/_static/env_discover.png" />
</div>

## Create environment

1. In the Environment Manager sidebar, click **Add**, then click **Create Environment**.

2. Give your custom environment a name, description, add tags, upload a logo, and specify any packages to install using
   a `requirements.txt` format.

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 **Add kernel**, 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 dependencies 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.

### Clone environment

<div
  style={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
gap: "20px",
}}
>
  <div style={{ flex: 1, paddingRight: "20px" }}>
    You can create a custom environment based on an existing one by cloning it. Clicking the **Clone** button will automatically populate the
    `requirements.txt` file and other environment metadata in the "Custom Environment" form. This is useful, for example, if you want to make
    and share changes to an environment you don’t own.
  </div>

  <div style={{ flex: 1, display: "flex", justifyContent: "center" }}>
    <img src="https://mintcdn.com/qbraidco/MWMLuPZDp_BcNo9C/lab/_static/env_clone.png?fit=max&auto=format&n=MWMLuPZDp_BcNo9C&q=85&s=7e5af397bae3e8dbfc1b9334d82bc31d" alt="clone" width="100%" data-path="lab/_static/env_clone.png" />
  </div>
</div>

## Share environment

In qBraid Lab, you can share your custom environments with other users. This will make your environment visible under their **Add**
environment list. They can then install it, and run code using an exact copy of your environment. This includes support for quantum jobs
and any additional configurations.

To share a custom environment, first click the **More** button in the drop-down to open the environment editor. Then, under ‘Share Environment',
enter the qBraid user email, and click **Share**. Alternatively, you can select **Generate Access Code** to create a unique access code. Anyone
with this code will be able to [discover](#discover-via-access-code) and [install](#install-environment) the environment with read-only access.

<div style={{ display: "flex", justifyContent: "center", alignItems: "center" }}>
  <img src="https://mintcdn.com/qbraidco/MWMLuPZDp_BcNo9C/lab/_static/env_more.png?fit=max&auto=format&n=MWMLuPZDp_BcNo9C&q=85&s=46a808f2654f794ecaeb482ce25e403a" width="915" height="849" data-path="lab/_static/env_more.png" />
</div>

When you share an environment on qBraid, either directly or via access code, you're creating a snapshot of your Python virtual environment
with its specific configurations and installed packages. This snapshot is uploaded to the qBraid cloud, creating a static version accessible
to other users. This shared version remains unchanged, even if you make updates to your local environment. To reflect any changes, you'd need
to re-share (or generate a new access code) and overwrite the existing version in the cloud.

Overwriting a globally shared environment doesn't affect versions that other users have already downloaded. Instead, an indicator notifies them
of the availability of an updated version. Currently, users must manually check for this indicator. Also, before installing an updated version,
users must uninstall their current one as maintaining multiple versions of a shared environment isn't supported. Sharing or overwriting globally
doesn't impact your local environment.

## Publish environment

Make your custom environment accessible to the entire qBraid ecosystem by submitting a publish request. Once you've configured your environment to
meet your specifications, open the environment editor using the **More** button and select **Request to publish**. A qBraid admin will review and
test your environment as needed, providing feedback if adjustments are required. Once approved, the environment will be made public, and ownership
will be transferred to qBraid.

## Uninstall / cancel install environment

To uninstall an environment or cancel the installation of an environment, click on **More**, and then **Uninstall** or **Cancel Installation**.

<div style={{ display: "flex", justifyContent: "center", alignItems: "center" }}>
  <img src="https://mintcdn.com/qbraidco/MWMLuPZDp_BcNo9C/lab/_static/env_cancel_uninstall.png?fit=max&auto=format&n=MWMLuPZDp_BcNo9C&q=85&s=1ba3e8de80eb26f858bb4d9ae835d60c" width="3200" height="1380" data-path="lab/_static/env_cancel_uninstall.png" />
</div>

## Install new package

Find the environment into which you want to install the package, expand the environment panel using the carrot drop-down, and then click **More**.

At the bottom of the Python packages list, click **Add a package**. Type in the *exact* name of the package you wish to install into the “Add package…”
search bar, and then hit `Enter` (or click the search icon on the right). This will do a direct search through [PyPI](https://pypi.org/), and return the
*latest* version available to install. To accept, click on the package, and then click **Add**.

<div style={{ display: "flex", justifyContent: "center", alignItems: "center" }}>
  <img src="https://mintcdn.com/qbraidco/9X1oJbJZeO4Arfak/lab/_static/package_install.gif?s=706194c74a30fff1d82525606a2994f7" alt="package installation" width="2560" height="1654" data-path="lab/_static/package_install.gif" />
</div>

While installing, the environment action button will indicate **Installing…**. Once complete, Lab will notify with a pop-up.

## Activate environment (kernel)

Clicking **Add kernel** creates a new ipykernel, see [Add/remove kernels](/v2/lab/user-guide/kernels#add-and-remove-kernels) for more.

<div style={{ display: "flex", justifyContent: "center", alignItems: "center" }}>
  <img src="https://storage.googleapis.com/qbraid-static-assets/qbraid-docs/lab/add-remove-kernel.gif" alt="access key" width="150%" />
</div>

## Featured environments

* [Pennylane Lightning GPU](/v2/lab/user-guide/gpus#pennylane-lightning): Environment for developing with the Pennylane quantum machine learning library with support for GPU-accelerated circuit simulation.
* [Qiskit Aer GPU](/v2/lab/user-guide/gpus#qiskit-aer): Environment for developing with Qiskit Aer using GPU supported simulators: statevector, density matrix, and unitary.
* [Fire Opal](/v2/lab/user-guide/fire-opal): Environment for developing with Fire Opal, a Python package containing a large suite of error suppression techniques intended to improve the quality of quantum algorithm results.

## Permissions

* Some features, such as [publish](#publish-environment), require an Enterprise-level subscription or partnership.
* Access to certain [featured environments](#featured-environments) is limited to certain user groups or [organizations](/v2/home/account).
* Additional access can be granted on request.

For more information, visit our [subscriptions page](https://account.qbraid.com/account/wallet) or contact us at [contact@qbraid.com](mailto:contact@qbraid.com).
