Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You down with plt (yeah you know me) [Issue 97] #119

Merged
merged 23 commits into from
May 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
351 changes: 351 additions & 0 deletions examples/state_and_process_plots.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,351 @@
{
joshcombes marked this conversation as resolved.
Show resolved Hide resolved
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# State and Process Plots"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Some states"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# python related things\n",
"import numpy as np\n",
"from matplotlib import pyplot as plt\n",
"\n",
"# quantum related things\n",
"from pyquil.gate_matrices import X, Y, Z, H, CNOT, CZ\n",
"from forest.benchmarking.superoperator_tools import *\n",
"from forest.benchmarking.utils import n_qubit_pauli_basis\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Define some quantum states"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Single qubit quantum states"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ZERO = np.array([[1, 0], [0, 0]])\n",
"ONE = np.array([[0, 0], [0, 1]])\n",
"\n",
"plus = np.array([[1], [1]]) / np.sqrt(2)\n",
"minus = np.array([[1], [-1]]) / np.sqrt(2)\n",
"PLUS = plus @ plus.T.conj()\n",
"MINUS = minus @ minus.T.conj()\n",
"\n",
"plusy = np.array([[1], [1j]]) / np.sqrt(2)\n",
"minusy = np.array([[1], [-1j]]) / np.sqrt(2)\n",
"PLUSy = plusy @ plusy.T.conj()\n",
"MINUSy = minusy @ minusy.T.conj()\n",
"\n",
"MIXED = np.eye(2)/2\n",
"\n",
"single_qubit_states = [('0',ZERO),('1',ONE),('+',PLUS),('-',MINUS),('+i',PLUSy),('-i',MINUSy)]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Two qubit quantum states"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"P00 = np.kron(ZERO, ZERO)\n",
"P01 = np.kron(ZERO, ONE)\n",
"P10 = np.kron(ONE, ZERO)\n",
"P11 = np.kron(ONE, ONE)\n",
"\n",
"bell = 1/np.sqrt(2) * np.array([[1, 0, 0, 1]])\n",
"BELL = np.outer(bell, bell)\n",
"\n",
"two_qubit_states = [('00',P00), ('01',P01), ('10',P10), ('11',P11),('BELL',BELL)]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Two types of Pauli Representation of a quantum state"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# convert to pauli basis\n",
"n_qubits = 1\n",
"pl_basis_oneq = n_qubit_pauli_basis(n_qubits)\n",
"c2p_oneq = computational2pauli_basis_matrix(2*n_qubits)\n",
"oneq_states_pl = [ (state[0], np.real(c2p_oneq@vec(state[1]))) for state in single_qubit_states]\n",
"\n",
"n_qubits = 2\n",
"pl_basis_twoq = n_qubit_pauli_basis(n_qubits)\n",
"c2p_twoq = computational2pauli_basis_matrix(2*n_qubits)\n",
"twoq_states_pl = [ (state[0], np.real(c2p_twoq@vec(state[1]))) for state in two_qubit_states]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from forest.benchmarking.plotting.state_process import plot_pauli_rep_of_state, plot_pauli_bar_rep_of_state"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Single Qubit states"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# can plot vertically\n",
"fig, ax = plt.subplots(1)\n",
"plot_pauli_rep_of_state(oneq_states_pl[0][1], ax, pl_basis_oneq.labels, 'State is |0>')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# or can plot horizontally\n",
"for state in oneq_states_pl:\n",
" fig, ax = plt.subplots(1)\n",
" plot_pauli_rep_of_state(state[1].transpose(), ax, pl_basis_oneq.labels, 'State is |'+state[0]+'>')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"for state in oneq_states_pl:\n",
" fig, ax = plt.subplots(1)\n",
" plot_pauli_bar_rep_of_state(state[1].flatten(), ax, pl_basis_oneq.labels, 'State is |'+state[0]+'>')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Two qubit states"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# can plot vertically \n",
"fig, ax = plt.subplots(1)\n",
"plot_pauli_rep_of_state(twoq_states_pl[0][1], ax, pl_basis_twoq.labels, 'State is |0>')\n",
"# can plot horizontially\n",
"fig, ax = plt.subplots(1)\n",
"plot_pauli_rep_of_state(twoq_states_pl[0][1].transpose(), ax, pl_basis_twoq.labels, 'State is |0>')\n",
"fig, ax = plt.subplots(1)\n",
"plot_pauli_rep_of_state(twoq_states_pl[-1][1].transpose(), ax, pl_basis_twoq.labels, 'State is BELL')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Also bar plots \n",
"fig, ax = plt.subplots(1)\n",
"plot_pauli_bar_rep_of_state(twoq_states_pl[-1][1].flatten(), ax, pl_basis_twoq.labels, 'State is BELL')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Plot a Quantum Process as a Pauli Transfer Matrix"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Xpl = kraus2pauli_liouville(X)\n",
"Hpl = kraus2pauli_liouville(H)\n",
"from forest.benchmarking.plotting.state_process import plot_pauli_transfer_matrix"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"f, (ax1) = plt.subplots(1, 1, figsize=(5, 4.2))\n",
"plot_pauli_transfer_matrix(np.real(Xpl), ax1, pl_basis_oneq.labels, 'X gate')\n",
"\n",
"f, (ax1) = plt.subplots(1, 1, figsize=(5, 4.2))\n",
"plot_pauli_transfer_matrix(np.real(Hpl), ax1, pl_basis_oneq.labels, 'H gate')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"CNOTpl = kraus2pauli_liouville(CNOT)\n",
"CZpl = kraus2pauli_liouville(CZ)\n",
"\n",
"f, (ax1) = plt.subplots(1, 1, figsize=(5, 4.2))\n",
"plot_pauli_transfer_matrix(np.real(CNOTpl), ax1, pl_basis_twoq.labels, 'CNOT')\n",
"f, (ax1) = plt.subplots(1, 1, figsize=(5, 4.2))\n",
"plot_pauli_transfer_matrix(np.real(CZpl), ax1, pl_basis_twoq.labels, 'CZ')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Hinton Plots for states and processes"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The warning here is the `hinton_real` function only works for plotting a real matrix so the user has to be careful. It will take the absolute value of complex numbers."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Visualize a real state in the computational basis"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from forest.benchmarking.utils import n_qubit_computational_basis\n",
"from forest.benchmarking.plotting.hinton import hinton_real\n",
"oneq = n_qubit_computational_basis(1)\n",
"oneq_latex_labels = [r'$|{}\\rangle$'.format(''.join(j)) for j in oneq.labels]\n",
"\n",
"_ = hinton_real(ZERO, max_weight=1.0, xlabels=oneq_latex_labels, ylabels=oneq_latex_labels, ax=None, title=r'$|0\\rangle$')\n",
"_ = hinton_real(MINUS, max_weight=1.0, xlabels=oneq_latex_labels, ylabels=oneq_latex_labels, ax=None, title=r'$|-\\rangle$')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Visualize a Process Pauli basis\n",
"The Pauli representation is real so we can plot any process"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"_ = hinton_real(Xpl, max_weight=1.0, xlabels=pl_basis_oneq.labels, ylabels=pl_basis_oneq.labels, ax=None, title='X gate')\n",
"_ = hinton_real(Hpl, max_weight=1.0, xlabels=pl_basis_oneq.labels, ylabels=pl_basis_oneq.labels, ax=None, title='H gate')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"So far things look the same as the `plot_pauli_transfer_matrix` but we can plot using the traditional Hinton diagram colors, now the size of the squares makes a difference."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from matplotlib import cm\n",
"_ = hinton_real(Hpl, max_weight=1.0, xlabels=pl_basis_oneq.labels, ylabels=pl_basis_oneq.labels,cmap = cm.Greys_r, ax=None, title='Good H gate')\n",
"_ = hinton_real(Hpl-0.3, max_weight=1.0, xlabels=pl_basis_oneq.labels, ylabels=pl_basis_oneq.labels, cmap = cm.Greys_r, ax=None, title='Bad H gate')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"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.6.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
28 changes: 25 additions & 3 deletions examples/tomography_process.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,35 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "NameError",
"evalue": "name 'process_choi_ideal' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m--------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-7-cb314dff65b7>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mfig\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0max1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0max2\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mplt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msubplots\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfigsize\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m12\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m5\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 6\u001b[0;31m \u001b[0mplot_pauli_transfer_matrix\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mchoi2pauli_liouville\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mprocess_choi_ideal\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0max1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtitle\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'Ideal'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 7\u001b[0m \u001b[0mplot_pauli_transfer_matrix\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mchoi2pauli_liouville\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mprocess_choi_est\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0max2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtitle\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'Estimate'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[0mplt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtight_layout\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNameError\u001b[0m: name 'process_choi_ideal' is not defined"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAsoAAAEzCAYAAAAo4yUMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAEUpJREFUeJzt3VGIpXd5x/HfY7ap1EYtzQqS3ZhIN9VFC6ZDSBFqirYkuUgu2koCwVqCi7aRglJIsaQSr6zUgrCtLlRSBY3RC1lwJVAbCYix2RCNJiGyRms2SrNqzI1oDH16cY5lsvlv5p3Zd2ayO58PDMw552XO8+bMPnxzZs6c6u4AAADP9qLtHgAAAF6IhDIAAAwIZQAAGBDKAAAwIJQBAGBAKAMAwMCaoVxVH6+qJ6rqW6e4varqI1V1rKoeqKpL5x8TgKnsbYB5THlG+bYkVz7P7Vcl2bf8OJDkX09/LABOw22xtwFO25qh3N13J/nJ8xxybZJP9MI9SV5eVa+ca0AA1sfeBpjHHL+jfEGSx1ZdPr68DoAXJnsbYIJdW3lnVXUgix/z5SUvecnvv+Y1r9nKuweYxX333fej7t693XNsNjsbOFtsdG/PEcqPJ9m76vKe5XXP0d2HkhxKkpWVlT569OgMdw+wtarqv7d7htM0aW/b2cDZYqN7e45fvTic5G3LV1FfnuS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text/plain": [
"<matplotlib.figure.Figure at 0x12c740240>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import matplotlib.pyplot as plt\n",
"from forest.benchmarking.superoperator_tools import choi2pauli_liouville\n",
"from forest.benchmarking.tomography import plot_pauli_transfer_matrix\n",
"from forest.benchmarking.plotting.state_process import plot_pauli_transfer_matrix\n",
"\n",
"fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12,5))\n",
"plot_pauli_transfer_matrix(choi2pauli_liouville(process_choi_ideal), ax1, title='Ideal')\n",
Expand Down
Loading