Created
November 16, 2020 08:13
-
-
Save splch/cb9b5b683f2e77c4e876afedeed30d8d to your computer and use it in GitHub Desktop.
Circuit for Quantum Teleportation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"/opt/conda/lib/python3.7/site-packages/qiskit/providers/ibmq/ibmqfactory.py:192: UserWarning: Timestamps in IBMQ backend properties, jobs, and job results are all now in local time instead of UTC.\n", | |
" warnings.warn('Timestamps in IBMQ backend properties, jobs, and job results '\n" | |
] | |
} | |
], | |
"source": [ | |
"%matplotlib inline\n", | |
"# Importing standard Qiskit libraries and configuring account\n", | |
"from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute, Aer, IBMQ\n", | |
"from qiskit.compiler import transpile, assemble\n", | |
"from qiskit.tools.jupyter import *\n", | |
"from qiskit.visualization import *\n", | |
"from qiskit_textbook.tools import random_state\n", | |
"from qiskit.extensions import Initialize\n", | |
"from random import choice\n", | |
"# Loading your IBM Q account(s)\n", | |
"IBMQ.load_account()\n", | |
"backend = Aer.get_backend('qasm_simulator')" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnEAAAEDCAYAAABaj1JvAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAp2ElEQVR4nO3de3RU9b3+8WdmEgg0ICAqd1ouATKQILfijSSKXKwixRigLQcpLhDCqlA4wlkoiNAsQCQUL1SrQC1LrAmg2ANy1ENCrVUBCT+I0MilB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j9+Uk//bp0ufOv5bj8beqe6dvqBxamuLBgM6vfr3tYnn/6tfNn3WzXTuJF3y+uN3PNJBw4f1W9feVOXipLH49H4n9wT8hKxKZGbXAQ6e/actny4U+fOX6DAAQCsuOG6JhqY8s17yHp0TYjoAiddLD/DBt1W/h6yOnVilfGj1IgucJLUrnVz3dYnqfzfKT9MjpgCJ7mgxO3atUv33XefmjZtqri4OHXs2FEzZ86slX29/3Gh/nnmrPrf0rNWXh8AgHDc0qub2rVpoUYN4zWkf9WXKiNNfP16Gja4nyTpnjtuUpNGDS1PFJ4Bt/VWs+uaqPn116r/rZH189/Rl1O3b9+ufv36qXXr1po+fbratm2rgwcP6v3339dLL710xW1nLHjB0JQAAADhmT99XNjrOvphv1OnTtX3vvc9ffjhh+V/YUG6+ARqAAAAN3Psmbh//vOfatCggSZNmqRf//rXtbqvs2fPacFvVqt1i+s15v7BtbovAACAcDj2TNypU6cUCASu+iGFV3M59a8HDnMZFgAA1JrqXE517I0NjRs3ltfr1ZEjR2yPAgAAYJxjL6dKUlpamj755BN9+umnatiwdu5y2fyXHdq0ZasyRw1V6xbX18o+AAAAqsuxZ+IkadGiRSotLVXfvn21cuVKbd68Wb/73e/04IMP1sjrnz17Tn/66P+pU7vWFDgAABBRHPueOEnq2bOn/vKXv+ixxx7TlClTdObMGbVu3VojRoyokdc/+WWJ6tWry3PhAABAxHH05VQTAoFAxD9RGgAARB9KHAAAgANxigkAAMCBKHEAAAAORIkDAABwIEocAACAA1HiAAAAHIgSBwAA4ECUOAAAAAeixAEAADgQJQ4AAMCBKHEAAAAORIkDAABwIEocAACAA1HiAAAAHIgSBwAA4ECUOAAAAAeixAEAADgQJQ4AAMCBKHEAAAAORIkDAABwIEocAACAA1HiAAAAHIgSBwAA4ECUOAAAAAeixAEAADgQJQ4AAMCBKHEAAAAORIkDAABwoP8PgLlGGtyyUWIAAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<Figure size 808.997x325.08 with 1 Axes>" | |
] | |
}, | |
"execution_count": 2, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"## SETUP\n", | |
"bowls = ['000', '111', '101']\n", | |
"bowl = choice(bowls)\n", | |
"qc = QuantumCircuit(len(bowl)+1, len(bowl))\n", | |
"\n", | |
"\n", | |
"## STEP 0\n", | |
"# Initalize porridge qubits to 1/√(2)|+> + 1/√(2)|->\n", | |
"qc.h(range(len(bowl)))\n", | |
"# Initalize DJ qubit to -|1>\n", | |
"qc.x(len(bowl))\n", | |
"qc.h(len(bowl))\n", | |
"qc.barrier()\n", | |
"\n", | |
"## STEP 1\n", | |
"# Encode bowl of porridge as a constant or balanced function\n", | |
"for qubit, spoonful in enumerate(bowl):\n", | |
" if spoonful == '1':\n", | |
" qc.x(qubit)\n", | |
"qc.barrier()\n", | |
"\n", | |
"# Check to apply C-NOT gates\n", | |
"if len(set(bowl)) == 1:\n", | |
" for qubit in range(len(bowl)):\n", | |
" qc.cx(qubit, len(bowl))\n", | |
" qc.barrier()\n", | |
"\n", | |
"## STEP 3\n", | |
"# Repeat step 1\n", | |
"for qubit, spoonful in enumerate(bowl):\n", | |
" if spoonful == '1':\n", | |
" qc.x(qubit)\n", | |
"qc.barrier()\n", | |
"\n", | |
"## STEP 4\n", | |
"# Apply H-gates\n", | |
"qc.h(range(len(bowl)))\n", | |
"qc.barrier()\n", | |
"\n", | |
"## STEP 5\n", | |
"# Measure\n", | |
"qc.measure(range(len(bowl)), range(len(bowl)))\n", | |
"\n", | |
"qc.draw()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAc0AAAFCCAYAAACTo4YQAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAacUlEQVR4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Kdh/xmwFbg2M7tHrUDpIGFoSoe4+rXMXwDnZ+byhrYpwJuBD1CtBPSezFw9aoVKBwFvBJIOfa8BHqN63ASArGzIzK9QvXD6KeBfjk550sHD0JQOfY9SnYL9k4g4ec/jJXtk5i7gduC80ShOOpgYmtIhLjN3An8IvBhYDMyOiBMjYixARBwNnAM8NHpVSgcHr2lKbaK+CtAngAup3myyAngCeDuwGfhAZv549CqUWp+hKbWZ+uMnFwDvpFoy7yHgq5n5f0azLulgYGhKbSwiDsvMX492HdLBwtCUJKmQNwJJklTI0JQkqZChKUlSIUNTkqRChqYkSYUMTUmSChmakiQV+iepyFjkTOXakgAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<Figure size 504x360 with 1 Axes>" | |
] | |
}, | |
"execution_count": 3, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"results = execute(qc, backend=backend).result()\n", | |
"answer = results.get_counts()\n", | |
"plot_histogram(answer)" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.7.8" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 4 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment