Skip to content

Commit

Permalink
updated arXiv reference (#242)
Browse files Browse the repository at this point in the history
* updated arXiv reference

* updated demo to show output by default

* Update README.rst

* bumped version number
  • Loading branch information
babbush authored and jarrodmcc committed Mar 6, 2018
1 parent 8856404 commit 50129ee
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 41 deletions.
11 changes: 6 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://arxiv.org/abs/1710.07629>`__. 2017.

Expand Down
77 changes: 42 additions & 35 deletions examples/binary_code_transforms_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -16,10 +18,7 @@
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
},
"metadata": {},
"source": [
"# Lowering qubit requirements using binary codes\n",
"## Introduction\n",
Expand All @@ -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",
Expand All @@ -68,10 +76,8 @@
"cell_type": "markdown",
"metadata": {
"code_folding": [
0.0
],
"deletable": true,
"editable": true
0
]
},
"source": [
"## Binary codes\n",
Expand All @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -133,12 +144,8 @@
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -338,7 +345,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.12"
"version": "2.7.13"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion src/openfermion/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 50129ee

Please sign in to comment.