Skip to content

Instantly share code, notes, and snippets.

@delapuente
Last active February 9, 2019 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delapuente/34e7cf78f462bcfcb2dbd078e5e6e073 to your computer and use it in GitHub Desktop.
Save delapuente/34e7cf78f462bcfcb2dbd078e5e6e073 to your computer and use it in GitHub Desktop.
Introduction to quantum programming.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Introduction to quantum programming.ipynb",
"version": "0.3.2",
"provenance": [],
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/delapuente/34e7cf78f462bcfcb2dbd078e5e6e073/q-programming-intro.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"metadata": {
"id": "9hUT7yheFslu",
"colab_type": "code",
"outputId": "0412d01c-8987-4553-ccdb-597cd9eefd26",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1213
}
},
"cell_type": "code",
"source": [
"!pip install qiskit"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"Collecting qiskit\n",
" Downloading https://files.pythonhosted.org/packages/7a/4a/bc00cc835794bb5247146d895586284759fe8e726648cfbb2f977e484bec/qiskit-0.7.2.tar.gz\n",
"Collecting qiskit-terra<0.8,>=0.7 (from qiskit)\n",
"\u001b[?25l Downloading https://files.pythonhosted.org/packages/af/61/b54f52ada993927c93adf8fea565951456f4ea691d6b0adca9ef52a04060/qiskit_terra-0.7.0-cp36-cp36m-manylinux1_x86_64.whl (7.3MB)\n",
"\u001b[K 100% |████████████████████████████████| 7.3MB 5.3MB/s \n",
"\u001b[?25hCollecting qiskit-aer<0.2,>=0.1 (from qiskit)\n",
"\u001b[?25l Downloading https://files.pythonhosted.org/packages/19/51/c93d33f5154305d177754507f05d113e13695a93500db38e1224633b9035/qiskit_aer-0.1.1-cp36-cp36m-manylinux1_x86_64.whl (18.5MB)\n",
"\u001b[K 100% |████████████████████████████████| 18.5MB 766kB/s \n",
"\u001b[?25hCollecting ply>=3.10 (from qiskit-terra<0.8,>=0.7->qiskit)\n",
"\u001b[?25l Downloading https://files.pythonhosted.org/packages/a3/58/35da89ee790598a0700ea49b2a66594140f44dec458c07e8e3d4979137fc/ply-3.11-py2.py3-none-any.whl (49kB)\n",
"\u001b[K 100% |████████████████████████████████| 51kB 18.8MB/s \n",
"\u001b[?25hRequirement already satisfied: networkx>=2.2 in /usr/local/lib/python3.6/dist-packages (from qiskit-terra<0.8,>=0.7->qiskit) (2.2)\n",
"Requirement already satisfied: psutil>=5 in /usr/local/lib/python3.6/dist-packages (from qiskit-terra<0.8,>=0.7->qiskit) (5.4.8)\n",
"Collecting marshmallow<3,>=2.16.3 (from qiskit-terra<0.8,>=0.7->qiskit)\n",
"\u001b[?25l Downloading https://files.pythonhosted.org/packages/9a/3c/4cc463c53136dc503f9ee234c4a6592e1c7411cb362f844e80df70361f29/marshmallow-2.18.0-py2.py3-none-any.whl (50kB)\n",
"\u001b[K 100% |████████████████████████████████| 51kB 20.7MB/s \n",
"\u001b[?25hCollecting requests>=2.19 (from qiskit-terra<0.8,>=0.7->qiskit)\n",
"\u001b[?25l Downloading https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl (57kB)\n",
"\u001b[K 100% |████████████████████████████████| 61kB 24.2MB/s \n",
"\u001b[?25hRequirement already satisfied: jsonschema<2.7,>=2.6 in /usr/local/lib/python3.6/dist-packages (from qiskit-terra<0.8,>=0.7->qiskit) (2.6.0)\n",
"Collecting sympy>=1.3 (from qiskit-terra<0.8,>=0.7->qiskit)\n",
"\u001b[?25l Downloading https://files.pythonhosted.org/packages/dd/f6/ed485ff22efdd7b371d0dbbf6d77ad61c3b3b7e0815a83c89cbb38ce35de/sympy-1.3.tar.gz (5.9MB)\n",
"\u001b[K 100% |████████████████████████████████| 5.9MB 4.8MB/s \n",
"\u001b[?25hRequirement already satisfied: numpy>=1.13 in /usr/local/lib/python3.6/dist-packages (from qiskit-terra<0.8,>=0.7->qiskit) (1.14.6)\n",
"Collecting marshmallow-polyfield<4,>=3.2 (from qiskit-terra<0.8,>=0.7->qiskit)\n",
" Downloading https://files.pythonhosted.org/packages/fa/ba/6406b8cce3e42b2838d234310c3605627083bbb8f71dcc312c616480fe92/marshmallow_polyfield-3.2-py2.py3-none-any.whl\n",
"Collecting pillow>=4.2.1 (from qiskit-terra<0.8,>=0.7->qiskit)\n",
"\u001b[?25l Downloading https://files.pythonhosted.org/packages/85/5e/e91792f198bbc5a0d7d3055ad552bc4062942d27eaf75c3e2783cf64eae5/Pillow-5.4.1-cp36-cp36m-manylinux1_x86_64.whl (2.0MB)\n",
"\u001b[K 100% |████████████████████████████████| 2.0MB 14.7MB/s \n",
"\u001b[?25hRequirement already satisfied: scipy!=0.19.1,>=0.19 in /usr/local/lib/python3.6/dist-packages (from qiskit-terra<0.8,>=0.7->qiskit) (1.1.0)\n",
"Collecting requests-ntlm>=1.1.0 (from qiskit-terra<0.8,>=0.7->qiskit)\n",
" Downloading https://files.pythonhosted.org/packages/03/4b/8b9a1afde8072c4d5710d9fa91433d504325821b038e00237dc8d6d833dc/requests_ntlm-1.1.0-py2.py3-none-any.whl\n",
"Requirement already satisfied: decorator>=4.3.0 in /usr/local/lib/python3.6/dist-packages (from networkx>=2.2->qiskit-terra<0.8,>=0.7->qiskit) (4.3.2)\n",
"Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests>=2.19->qiskit-terra<0.8,>=0.7->qiskit) (3.0.4)\n",
"Requirement already satisfied: idna<2.9,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests>=2.19->qiskit-terra<0.8,>=0.7->qiskit) (2.6)\n",
"Requirement already satisfied: urllib3<1.25,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests>=2.19->qiskit-terra<0.8,>=0.7->qiskit) (1.22)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests>=2.19->qiskit-terra<0.8,>=0.7->qiskit) (2018.11.29)\n",
"Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.6/dist-packages (from sympy>=1.3->qiskit-terra<0.8,>=0.7->qiskit) (1.1.0)\n",
"Collecting cryptography>=1.3 (from requests-ntlm>=1.1.0->qiskit-terra<0.8,>=0.7->qiskit)\n",
"\u001b[?25l Downloading https://files.pythonhosted.org/packages/98/71/e632e222f34632e0527dd41799f7847305e701f38f512d81bdf96009bca4/cryptography-2.5-cp34-abi3-manylinux1_x86_64.whl (2.4MB)\n",
"\u001b[K 100% |████████████████████████████████| 2.4MB 14.1MB/s \n",
"\u001b[?25hCollecting ntlm-auth>=1.0.2 (from requests-ntlm>=1.1.0->qiskit-terra<0.8,>=0.7->qiskit)\n",
" Downloading https://files.pythonhosted.org/packages/8e/5b/4047779fb456b0de503c4acb7b166becf2567efb772abb53998440791d3c/ntlm_auth-1.2.0-py2.py3-none-any.whl\n",
"Requirement already satisfied: cffi!=1.11.3,>=1.8 in /usr/local/lib/python3.6/dist-packages (from cryptography>=1.3->requests-ntlm>=1.1.0->qiskit-terra<0.8,>=0.7->qiskit) (1.11.5)\n",
"Requirement already satisfied: six>=1.4.1 in /usr/local/lib/python3.6/dist-packages (from cryptography>=1.3->requests-ntlm>=1.1.0->qiskit-terra<0.8,>=0.7->qiskit) (1.11.0)\n",
"Collecting asn1crypto>=0.21.0 (from cryptography>=1.3->requests-ntlm>=1.1.0->qiskit-terra<0.8,>=0.7->qiskit)\n",
"\u001b[?25l Downloading https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl (101kB)\n",
"\u001b[K 100% |████████████████████████████████| 102kB 30.3MB/s \n",
"\u001b[?25hRequirement already satisfied: pycparser in /usr/local/lib/python3.6/dist-packages (from cffi!=1.11.3,>=1.8->cryptography>=1.3->requests-ntlm>=1.1.0->qiskit-terra<0.8,>=0.7->qiskit) (2.19)\n",
"Building wheels for collected packages: qiskit, sympy\n",
" Building wheel for qiskit (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25h Running setup.py clean for qiskit\n",
" Building wheel for sympy (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25h Stored in directory: /root/.cache/pip/wheels/6c/59/86/478e3c0f298368c119095cc5985dedac57c0e35a85c737f823\n",
"Successfully built sympy\n",
"Failed to build qiskit\n",
"\u001b[31mspacy 2.0.18 has requirement numpy>=1.15.0, but you'll have numpy 1.14.6 which is incompatible.\u001b[0m\n",
"\u001b[31mgoogle-colab 0.0.1a1 has requirement requests~=2.18.0, but you'll have requests 2.21.0 which is incompatible.\u001b[0m\n",
"\u001b[31mcufflinks 0.14.6 has requirement plotly>=3.0.0, but you'll have plotly 1.12.12 which is incompatible.\u001b[0m\n",
"Installing collected packages: ply, marshmallow, requests, sympy, marshmallow-polyfield, pillow, asn1crypto, cryptography, ntlm-auth, requests-ntlm, qiskit-terra, qiskit-aer, qiskit\n",
" Found existing installation: requests 2.18.4\n",
" Uninstalling requests-2.18.4:\n",
" Successfully uninstalled requests-2.18.4\n",
" Found existing installation: sympy 1.1.1\n",
" Uninstalling sympy-1.1.1:\n",
" Successfully uninstalled sympy-1.1.1\n"
],
"name": "stdout"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment