From 50129ee7cc5ba7f6c150e8c0d9f7e509a46ba877 Mon Sep 17 00:00:00 2001 From: Ryan Babbush Date: Mon, 5 Mar 2018 22:34:15 -0800 Subject: [PATCH] updated arXiv reference (#242) * updated arXiv reference * updated demo to show output by default * Update README.rst * bumped version number --- README.rst | 11 ++-- examples/binary_code_transforms_demo.ipynb | 77 ++++++++++++---------- src/openfermion/_version.py | 2 +- 3 files changed, 49 insertions(+), 41 deletions(-) diff --git a/README.rst b/README.rst index ac26ea010..c3c9219a9 100644 --- a/README.rst +++ b/README.rst @@ -152,11 +152,12 @@ How to cite =========== When using OpenFermion for research projects, please cite: - Jarrod R. McClean, Ian D. Kivlichan, Damian S. Steiger, Kevin J. Sung, - Yudong Cao, Chengyu Dai, E. Schuyler Fried, Craig Gidney, Thomas Häner, - Vojtĕch Havlíček, Cupjin Huang, Zhang Jiang, Matthew Neeley, Jhonathan Romero, - Nicholas Rubin, Nicolas P. D. Sawaya, Kanav Setia, Sukin Sim, Wei Sun, - Fang Zhang and Ryan Babbush. + Jarrod R. McClean, Ian D. Kivlichan, Kevin J. Sung, Damian S. Steiger, + Yudong Cao, Chengyu Dai, E. Schuyler Fried, Craig Gidney, Brendan Gimby, + Thomas Häner, Tarini Hardikar, Vojtĕch Havlíček, Cupjin Huang, Zhang Jiang, + Matthew Neeley, Thomas O'Brien, Isil Ozfidan, Maxwell D. Radin, Jhonathan Romero, + Nicholas Rubin, Nicolas P. D. Sawaya, Kanav Setia, Sukin Sim, Mark Steudtner, + Wei Sun, Fang Zhang and Ryan Babbush. *OpenFermion: The Electronic Structure Package for Quantum Computers*. `arXiv:1710.07629 `__. 2017. diff --git a/examples/binary_code_transforms_demo.ipynb b/examples/binary_code_transforms_demo.ipynb index ade753809..2afc113ea 100644 --- a/examples/binary_code_transforms_demo.ipynb +++ b/examples/binary_code_transforms_demo.ipynb @@ -2,8 +2,10 @@ "cells": [ { "cell_type": "code", - "execution_count": null, - "metadata": {}, + "execution_count": 1, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "# This code block is for automatic testing purposes, please ignore.\n", @@ -16,10 +18,7 @@ }, { "cell_type": "markdown", - "metadata": { - "deletable": true, - "editable": true - }, + "metadata": {}, "source": [ "# Lowering qubit requirements using binary codes\n", "## Introduction\n", @@ -42,13 +41,22 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false, - "deletable": true, - "editable": true - }, - "outputs": [], + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "('These three expressions are equivalent: \\n', [W0 W1] + [W1] + [1])\n", + "[W0 W1] + [W0] + [1]\n", + "[W0 W1] + [W1] + [1]\n", + "The native data type structure can be seen here:\n", + "[(0, 1), (1,), ('one',)]\n", + "('We can always evaluate the expression for instance by the vector (w0, w1, w2) = (1, 0, 0):', 1)\n" + ] + } + ], "source": [ "from openfermion.ops import SymbolicBinary\n", "\n", @@ -68,10 +76,8 @@ "cell_type": "markdown", "metadata": { "code_folding": [ - 0.0 - ], - "deletable": true, - "editable": true + 0 + ] }, "source": [ "## Binary codes\n", @@ -80,13 +86,21 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false, - "deletable": true, - "editable": true - }, - "outputs": [], + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[[1, 0, 0], [0, 1, 0]], '[[W0],[W1],[W0] + [W1] + [1]]']\n", + "('number of qubits: ', 2, ' number of Fermion modes: ', 3)\n", + "('encoding matrix: \\n', array([[1, 0, 0],\n", + " [0, 1, 0]]))\n", + "('decoder: ', [[W0], [W1], [W0] + [W1] + [1]])\n" + ] + } + ], "source": [ "from openfermion.ops import BinaryCode\n", "\n", @@ -100,10 +114,7 @@ }, { "cell_type": "markdown", - "metadata": { - "deletable": true, - "editable": true - }, + "metadata": {}, "source": [ "The code used in the example above, is in fact the (odd) Checksum code, and is implemented already - along with a few other examples from arxiv:1712.07067. In addition to the $\\text{checksum_code}$ the functions $\\text{weight_one_segment_code}$, $\\text{weight_two_segment_code}$, that output a subcode each, as well as $\\text{weight_one_binary_addressing_code}$ can be found under openfermion.transforms._code_transform_functions.\n", "\n", @@ -133,12 +144,8 @@ }, { "cell_type": "code", - "execution_count": 11, - "metadata": { - "collapsed": false, - "deletable": true, - "editable": true - }, + "execution_count": 4, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -338,7 +345,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", - "version": "2.7.12" + "version": "2.7.13" } }, "nbformat": 4, diff --git a/src/openfermion/_version.py b/src/openfermion/_version.py index b89ff0fa3..dcc0c5955 100644 --- a/src/openfermion/_version.py +++ b/src/openfermion/_version.py @@ -11,4 +11,4 @@ # limitations under the License. """Define version number here and read it from setup.py automatically""" -__version__ = "0.3" +__version__ = "0.4"