Quantum Computing
Подготовка среды | |
Установка qiskit | |
IBM Quantum | |
Учебные материалы |
Подготовка среды
Установите Anaconda , Jupyter Notebook и некоторые полезные библиотеки по инструкции
IBM Quantum
Аккаунт можно создать на
quantum-computing.ibm.com
Токен можно скопировать с
отсюда
Установка qiskit
pip install qiskit
Collecting qiskit Downloading qiskit-0.25.3.tar.gz (4.5 kB) Collecting qiskit-terra==0.17.1 Downloading qiskit_terra-0.17.1-cp38-cp38-manylinux2010_x86_64.whl (6.1 MB) |████████████████████████████████| 6.1 MB 4.2 MB/s Collecting qiskit-aer==0.8.2 Downloading qiskit_aer-0.8.2-cp38-cp38-manylinux2010_x86_64.whl (18.0 MB) |████████████████████████████████| 18.0 MB 1.9 MB/s Collecting qiskit-ibmq-provider==0.12.3 Downloading qiskit_ibmq_provider-0.12.3-py3-none-any.whl (198 kB) |████████████████████████████████| 198 kB 4.8 MB/s Collecting qiskit-ignis==0.6.0 Downloading qiskit_ignis-0.6.0-py3-none-any.whl (207 kB) |████████████████████████████████| 207 kB 3.9 MB/s Collecting qiskit-aqua==0.9.1 Downloading qiskit_aqua-0.9.1-py3-none-any.whl (2.1 MB) |████████████████████████████████| 2.1 MB 8.3 MB/s Collecting numpy>=1.16.3 Downloading numpy-1.20.2-cp38-cp38-manylinux2010_x86_64.whl (15.4 MB) |████████████████████████████████| 15.4 MB 3.8 MB/s Collecting pybind11>=2.6 Downloading pybind11-2.6.2-py2.py3-none-any.whl (191 kB) |████████████████████████████████| 191 kB 4.2 MB/s Collecting scipy>=1.0 Downloading scipy-1.6.3-cp38-cp38-manylinux1_x86_64.whl (27.2 MB) |████████████████████████████████| 27.2 MB 3.9 MB/s Collecting pandas<=1.2.3 Downloading pandas-1.2.3-cp38-cp38-manylinux1_x86_64.whl (9.7 MB) |████████████████████████████████| 9.7 MB 4.4 MB/s Collecting quandl<=3.6.0 Downloading Quandl-3.6.0-py2.py3-none-any.whl (26 kB) Collecting retworkx<=0.8.0,>=0.7.0 Downloading retworkx-0.8.0-cp38-cp38-manylinux2010_x86_64.whl (1.0 MB) |████████████████████████████████| 1.0 MB 43.7 MB/s Collecting fastdtw<=0.3.4 Downloading fastdtw-0.3.4.tar.gz (133 kB) |████████████████████████████████| 133 kB 40.5 MB/s Collecting sympy<=1.7.1,>=1.3 Downloading sympy-1.7.1-py3-none-any.whl (5.9 MB) |████████████████████████████████| 5.9 MB 4.8 MB/s Collecting scipy>=1.0 Downloading scipy-1.6.1-cp38-cp38-manylinux1_x86_64.whl (27.3 MB) |████████████████████████████████| 27.3 MB 60.0 MB/s Collecting dlx<=1.0.4 Downloading dlx-1.0.4.tar.gz (5.5 kB) Collecting yfinance<=0.1.55 Downloading yfinance-0.1.55.tar.gz (23 kB) Collecting scikit-learn<=0.24.1,>=0.20.0 Downloading scikit_learn-0.24.1-cp38-cp38-manylinux2010_x86_64.whl (24.9 MB) |████████████████████████████████| 24.9 MB 3.4 MB/s Requirement already satisfied: psutil<=5.8.0,>=5 in /home/andrei/.local/lib/python3.8/site-packages (from qiskit-aqua==0.9.1->qiskit) (5.8.0) Collecting docplex<=2.20.204 Downloading docplex-2.20.204.tar.gz (611 kB) |████████████████████████████████| 611 kB 4.6 MB/s Requirement already satisfied: setuptools>=40.1.0 in /home/andrei/anaconda3/envs/quantum_env/lib/python3.8/site-packages (from qiskit-aqua==0.9.1->qiskit) (52.0.0.post20210125) Collecting numpy>=1.16.3 Downloading numpy-1.20.1-cp38-cp38-manylinux2010_x86_64.whl (15.4 MB) |████████████████████████████████| 15.4 MB 4.9 MB/s Collecting h5py<=3.1.0 Downloading h5py-3.1.0-cp38-cp38-manylinux1_x86_64.whl (4.4 MB) |████████████████████████████████| 4.4 MB 8.6 MB/s Requirement already satisfied: python-dateutil>=2.8.0 in /home/andrei/anaconda3/envs/quantum_env/lib/python3.8/site-packages (from qiskit-ibmq-provider==0.12.3->qiskit) (2.8.1) Collecting requests>=2.19 Using cached requests-2.25.1-py2.py3-none-any.whl (61 kB) Requirement already satisfied: nest-asyncio!=1.1.0,>=1.0.0 in /home/andrei/anaconda3/envs/quantum_env/lib/python3.8/site-packages (from qiskit-ibmq-provider==0.12.3->qiskit) (1.5.1) Collecting websockets>=8 Downloading websockets-9.0.1-cp38-cp38-manylinux2010_x86_64.whl (101 kB) |████████████████████████████████| 101 kB 9.5 MB/s Collecting requests-ntlm>=1.1.0 Downloading requests_ntlm-1.1.0-py2.py3-none-any.whl (5.7 kB) Collecting urllib3>=1.21.1 Using cached urllib3-1.26.4-py2.py3-none-any.whl (153 kB) Collecting dill>=0.3 Downloading dill-0.3.3-py2.py3-none-any.whl (81 kB) |████████████████████████████████| 81 kB 8.9 MB/s Requirement already satisfied: jsonschema>=2.6 in /home/andrei/anaconda3/envs/quantum_env/lib/python3.8/site-packages (from qiskit-terra==0.17.1->qiskit) (3.2.0) Collecting python-constraint>=1.4 Downloading python-constraint-1.4.0.tar.bz2 (18 kB) Collecting ply>=3.10 Downloading ply-3.11-py2.py3-none-any.whl (49 kB) |████████████████████████████████| 49 kB 6.6 MB/s Collecting fastjsonschema>=2.10 Downloading fastjsonschema-2.15.0-py3-none-any.whl (21 kB) Requirement already satisfied: six in /home/andrei/anaconda3/envs/quantum_env/lib/python3.8/site-packages (from docplex<=2.20.204->qiskit-aqua==0.9.1->qiskit) (1.15.0) Requirement already satisfied: pyrsistent>=0.14.0 in /home/andrei/anaconda3/envs/quantum_env/lib/python3.8/site-packages (from jsonschema>=2.6->qiskit-terra==0.17.1->qiskit) (0.17.3) Requirement already satisfied: attrs>=17.4.0 in /home/andrei/anaconda3/envs/quantum_env/lib/python3.8/site-packages (from jsonschema>=2.6->qiskit-terra==0.17.1->qiskit) (20.3.0) Collecting pytz>=2017.3 Downloading pytz-2021.1-py2.py3-none-any.whl (510 kB) |████████████████████████████████| 510 kB 21.0 MB/s Collecting inflection>=0.3.1 Downloading inflection-0.5.1-py2.py3-none-any.whl (9.5 kB) Collecting more-itertools Downloading more_itertools-8.7.0-py3-none-any.whl (48 kB) |████████████████████████████████| 48 kB 5.3 MB/s Collecting idna<3,>=2.5 Using cached idna-2.10-py2.py3-none-any.whl (58 kB) Requirement already satisfied: certifi>=2017.4.17 in /home/andrei/anaconda3/envs/quantum_env/lib/python3.8/site-packages (from requests>=2.19->qiskit-ibmq-provider==0.12.3->qiskit) (2020.12.5) Collecting chardet<5,>=3.0.2 Using cached chardet-4.0.0-py2.py3-none-any.whl (178 kB) Collecting cryptography>=1.3 Using cached cryptography-3.4.7-cp36-abi3-manylinux2014_x86_64.whl (3.2 MB) Collecting ntlm-auth>=1.0.2 Downloading ntlm_auth-1.5.0-py2.py3-none-any.whl (29 kB) Requirement already satisfied: cffi>=1.12 in /home/andrei/anaconda3/envs/quantum_env/lib/python3.8/site-packages (from cryptography>=1.3->requests-ntlm>=1.1.0->qiskit-ibmq-provider==0.12.3->qiskit) (1.14.5) Requirement already satisfied: pycparser in /home/andrei/anaconda3/envs/quantum_env/lib/python3.8/site-packages (from cffi>=1.12->cryptography>=1.3->requests-ntlm>=1.1.0->qiskit-ibmq-provider==0.12.3->qiskit) (2.20) Collecting joblib>=0.11 Downloading joblib-1.0.1-py3-none-any.whl (303 kB) |████████████████████████████████| 303 kB 3.6 MB/s Collecting threadpoolctl>=2.0.0 Downloading threadpoolctl-2.1.0-py3-none-any.whl (12 kB) Collecting mpmath>=0.19 Downloading mpmath-1.2.1-py3-none-any.whl (532 kB) |████████████████████████████████| 532 kB 28.4 MB/s Collecting multitasking>=0.0.7 Downloading multitasking-0.0.9.tar.gz (8.1 kB) Collecting lxml>=4.5.1 Downloading lxml-4.6.3-cp38-cp38-manylinux2014_x86_64.whl (6.8 MB) |████████████████████████████████| 6.8 MB 10.2 MB/s Building wheels for collected packages: qiskit, dlx, docplex, fastdtw, python-constraint, yfinance, multitasking Building wheel for qiskit (setup.py) ... done Created wheel for qiskit: filename=qiskit-0.25.3-py3-none-any.whl size=3073 sha256=11b36e659623b662bf7a32a8003f56826496923f5aef5e71012211dcc4512cce Stored in directory: /home/andrei/.cache/pip/wheels/70/6d/dc/ab0077f24ecc95415f0fdfbc71714dfa9edfc7aecce193fe97 Building wheel for dlx (setup.py) ... done Created wheel for dlx: filename=dlx-1.0.4-py3-none-any.whl size=5709 sha256=4e90cff62adfb8e39787302a31404184ab2c2e58d6d50b5182140afa8a454012 Stored in directory: /home/andrei/.cache/pip/wheels/c4/03/f9/7afbf40e0c3d6928d16bcadb46264a6e68704998ec72f7ea13 Building wheel for docplex (setup.py) ... done Created wheel for docplex: filename=docplex-2.20.204-py3-none-any.whl size=675361 sha256=c217e6a922af9c2c36ddff398157a7636b58d680286766b8a28fbb59b56ec87b Stored in directory: /home/andrei/.cache/pip/wheels/1b/8c/d4/30a423fc8850be566fbbf6f229d0f216d28d69674bd4bd6b3f Building wheel for fastdtw (setup.py) ... done Created wheel for fastdtw: filename=fastdtw-0.3.4-py3-none-any.whl size=3588 sha256=af6aa2334c156e0208db7c8f54ace5b7280dc1ec9d9d2a6ccf52cba0f621c1a1 Stored in directory: /home/andrei/.cache/pip/wheels/e9/ac/30/c962f9d759dd68cb5482727c44441fdfb48040fdbe983857e8 Building wheel for python-constraint (setup.py) ... done Created wheel for python-constraint: filename=python_constraint-1.4.0-py2.py3-none-any.whl size=24079 sha256=9605f8f61e84c63ff4e86523564bc41ac47d5bf817f92261ba9cd8d191116682 Stored in directory: /home/andrei/.cache/pip/wheels/86/ba/5c/4e9115777de42c6a2e1ca77ef7c9d0d479254c5080341b55c5 Building wheel for yfinance (setup.py) ... done Created wheel for yfinance: filename=yfinance-0.1.55-py2.py3-none-any.whl size=22616 sha256=7d191c454b638ff9c25ff55b4da4c2b1cd039116fec9c12df5fec95b3f3db883 Stored in directory: /home/andrei/.cache/pip/wheels/b4/c3/39/9c01ae2b4726f37024bba5592bec868b47a2fab5a786e8979a Building wheel for multitasking (setup.py) ... done Created wheel for multitasking: filename=multitasking-0.0.9-py3-none-any.whl size=8368 sha256=8034f7cf764e7e9e54bc58b49d9d5d89807e4a99afa9289adce17a859643e662 Stored in directory: /home/andrei/.cache/pip/wheels/57/6d/a3/a39b839cc75274d2acfb1c58bfead2f726c6577fe8c4723f13 Successfully built qiskit dlx docplex fastdtw python-constraint yfinance multitasking Installing collected packages: numpy, mpmath, urllib3, sympy, scipy, retworkx, pytz, python-constraint, ply, idna, fastjsonschema, dill, chardet, threadpoolctl, requests, qiskit-terra, pandas, ntlm-auth, multitasking, more-itertools, lxml, joblib, inflection, cryptography, yfinance, websockets, scikit-learn, requests-ntlm, quandl, qiskit-ignis, pybind11, h5py, fastdtw, docplex, dlx, qiskit-ibmq-provider, qiskit-aqua, qiskit-aer, qiskit Successfully installed chardet-4.0.0 cryptography-3.4.7 dill-0.3.3 dlx-1.0.4 docplex-2.20.204 fastdtw-0.3.4 fastjsonschema-2.15.0 h5py-3.1.0 idna-2.10 inflection-0.5.1 joblib-1.0.1 lxml-4.6.3 more-itertools-8.7.0 mpmath-1.2.1 multitasking-0.0.9 ntlm-auth-1.5.0 numpy-1.20.1 pandas-1.2.3 ply-3.11 pybind11-2.6.2 python-constraint-1.4.0 pytz-2021.1 qiskit-0.25.3 qiskit-aer-0.8.2 qiskit-aqua-0.9.1 qiskit-ibmq-provider-0.12.3 qiskit-ignis-0.6.0 qiskit-terra-0.17.1 quandl-3.6.0 requests-2.25.1 requests-ntlm-1.1.0 retworkx-0.8.0 scikit-learn-0.24.1 scipy-1.6.1 sympy-1.7.1 threadpoolctl-2.1.0 urllib3-1.26.4 websockets-9.0.1 yfinance-0.1.55
scipy-1.6.1 может быть не самой последней версией
В этом случае вы увидите небольшой даунгрейд
Installing collected packages: scipy, qiskit Attempting uninstall: scipy Found existing installation: scipy 1.6.2 Uninstalling scipy-1.6.2: Successfully uninstalled scipy-1.6.2 Successfully installed qiskit-0.25.3 scipy-1.6.1
Запустите Jupyter Notebook и выполните в нём следующие команды (нужно будет вставить токен, скопированный с сайта IBM)
from qiskit import IBMQ
IBMQ.save_account('ваш токен')
IBMQ.load_account()
<AccountProvider for IBMQ(hub='ibm-q', group='open', project='main')>
Учебные материалы
qiskit-textbook
qiskit-tutorials
git clone https://github.com/Qiskit/qiskit-tutorials
git clone https://github.com/qiskit-community/qiskit-textbook