之前我在文章中介紹瞭如何安裝Pyquil, Pyquil在實現如下這些擴展功能的時候,
需要再安裝一個Grove包。它的安裝還是比較麻煩的,而且github和它的documentation更新有些不及時。大家在閱讀documentation的同時,可以參考一下我的安裝方法。
How to install the Grove package
- Create a new environment and activate that environment
conda create -n pyquil-grove python=3.6
conda activate pyquil-grove
- Install some useful tools
conda install jupyter
conda install matplotlib
conda install scipy
pip install opencv-python
- Install PyQuil
Please follow the instruction in this link.
- Install Grove
pip install quantum-grove==2.0.0b0
Note that if we directly install grove using pip install quantum-grove
, the version 1.7.0 will be installed, and some errors will happen during importing the packages. Thus we need to install the 2.0.0 version of it to avoid the problem.
If we would like to use the tomography tool in Grove, which relies on the external packages qutip and and cvxpy, we need to install some more packages. We can first attempt to just run (the two txt files below can be downloaded here):
pip install -r requirements.txt
pip install -r optional-requirements.txt
If the installation of the optional requirements fails, we can manually install the individual packages as
pip install cython==0.24.1
pip install scs==1.2.6
pip install qutip==4.1
pip install cvxpy==0.4.11
During the installation of qutip, an error showing gcc: error trying to exec 'cc1plus': execvp: No such file or directory
and error: command 'gcc' failed with exit status 1
may occur. And we need to install g++ to solve it:
sudo apt-get install g++