Installation¶
Before you can use the cutqc2 package, ensure that your system meets the following prerequisites:
Python 3.12 or later
Pip package manager
Clone the repository and enter it:
git clone https://github.com/vineetbansal/cutqc2.git
cd cutqc2
Creating a cutqc2 environment¶
All of cutqc2’s dependencies are on PyPI. We have developed and tested cutqc2 on Python 3.12, but it should work on later Python versions as well.
You can create a new virtual environment using venv, and install dependencies using pip.
Verify that Python 3.12 or newer is installed on your system.
python --version
Create a new environment and activate it.
python -m venv .venv source .venv/bin/activate
In the activated environment, install the package in editable mode, along with its
devanddocsextras:pip install -e .[dev,docs]
Using a different Python version than the system default¶
If your Python version is not 3.12 or later, or if you’re getting errors when using a non-tested Python version, we recommend using the uv tool to create a virtual environment with the correct Python version.
uv is quick to install and easy to use, both locally as well as on research clusters.
Once uv is installed:
Create a new environment with Python 3.12 and activate it.
uv venv --python 3.12 source .venv/bin/activate
In the activated environment, install the package in editable mode, along with its
devanddocsextras:uv pip install -e .[dev,docs]
cutqc2 environment using conda¶
If you prefer using conda, you can use the provided environment.yml file to create a new conda environment with all the necessary dependencies pinned to versions that have worked for us in the past.
Note
cutqc2can get all its dependencies frompypiusingpipand does not need conda for environment management. Nevertheless, this might be the easiest option for most users who already have access to thecondaexecutable locally or through a research cluster. The providedenvironment.ymlfile has the defaults channel disabled, and can be used to create a new conda environment with all the necessary dependencies. It can therefore be used without getting a business or enterprise license from Anaconda. (See Anaconda FAQs)
Create a new conda environment named
cutqc2with Python version 3.12.conda create --name cutqc2 python=3.12 pip
Activate the environment.
conda activate cutqc2
The command prompt will change to indicate the new conda environment by prepending
(cutqc2).In the activated environment, install the dependencies provided in
environment.yml:conda env update --file environment.yml
In the activated environment, install the package in editable mode without dependencies.
pip install -e . --no-deps