Getting started
Setup a virtual environment and install qnngds
1. Create a new git repository with git init, or follow the instructions at https://github.com/qnngroup/qnn-repo-template to clone a template repository.
This is where your new project will go.
In the same directory as the new git repository, create a new virtual environment.
Using
conda(recommended, miniforge installation instructions):Execute:
conda create -n my-project-env python=3.12 conda activate my-project-env
Install
qnngds(see step 3 below)
Using
uv(recommended, installation instructions):Open a terminal in the directory you want to put your virtual environment.
Execute:
uv venv --python 3.12
Follow the instructions from
uvto activate the environment, as they will differ depending on the platform.Install
qnngds(see step 3 below)
Using
pythonvirtual environment is dispreffered, since one may need to manually install separate version of python if the system python version does not match the requirements forqnngds.
Install
qnngds.Note
If you are on windows, you will need to install gdspy manually before installing qnngds. You will need to download the prebuilt wheel file at [github.com/hetizmann/gdspy/releases](https://github.com/heitzmann/gdspy/releases/tag/v1.6.12). If you’ve followed the instructions this far, you’ve installed
python3.12, but the wheel was built withpython3.8. To disable the version check, replacecp38withcp312(or the appropriate version string based on the installed python version) in the filename for the wheel. Then run the following:pip install path/to/gdspy-1.6.12-cp312-cp312-win_amd64.whl
Now that you’ve activated your venv, install the package from pypi.
Using
condaorpythonvenv:pip install qnngds
Using
uvuv pip install qnngds
Installing unreleased development versions of qnngds
Note
This process is not tested on Windows. It should work, but it’s possible additional programs need to be installed.
To install a development version of
qnngdsthat hasn’t been released on pypi yet, first cloneqnngdsfrom github onto your local machine.Follow steps 1 and 2 from the above section.
When installing
qnngds, replace the command[uv] pip install qnngdswith[uv] pip install -e /path/to/cloned/copy/of/qnngds. Note that this will be a different path from the repo you set up earlier.