Skip to content

Commit 005af3e

Browse files
authored
Initial release of FermiLib.
2 parents 28ab90c + af5551d commit 005af3e

File tree

196 files changed

+11709
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+11709
-0
lines changed

.coveralls.yml

Whitespace-only changes.

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.pyc
2+
__pycache__/
3+
.DS_Store
4+
.ipynb_checkpoints/
5+
*lastfailed
6+
*coverage

.travis.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
sudo: false
2+
language: python
3+
matrix:
4+
include:
5+
- os: linux
6+
python: "2.7"
7+
addons:
8+
apt:
9+
sources: ['ubuntu-toolchain-r-test']
10+
packages: ['gcc-4.9', 'g++-4.9']
11+
env: CC=gcc-4.9 CXX=g++-4.9 PYTHON=2.7
12+
- os: linux
13+
python: "3.4"
14+
addons:
15+
apt:
16+
sources: ['ubuntu-toolchain-r-test']
17+
packages: ['gcc-4.9', 'g++-4.9']
18+
env: CC=gcc-4.9 CXX=g++-4.9 PYTHON=3.4
19+
- os: linux
20+
python: "3.5"
21+
addons:
22+
apt:
23+
sources: ['ubuntu-toolchain-r-test']
24+
packages: ['gcc-4.9', 'g++-4.9']
25+
env: CC=gcc-4.9 CXX=g++-4.9 PYTHON=3.5
26+
- os: linux
27+
python: "3.6"
28+
addons:
29+
apt:
30+
sources: ['ubuntu-toolchain-r-test']
31+
packages: ['gcc-4.9', 'g++-4.9']
32+
env: CC=gcc-4.9 CXX=g++-4.9 PYTHON=3.5
33+
34+
before_install:
35+
- pip$PY install --upgrade pip setuptools wheel
36+
37+
install:
38+
- if [ "${PYTHON:0:1}" = "3" ]; then export PY=3; fi
39+
- pip$PY install --only-binary=numpy,scipy numpy scipy
40+
- pip$PY install pybind11
41+
- pip$PY install -r requirements.txt
42+
- pip$PY install pytest-cov
43+
- pip$PY install coveralls
44+
45+
# command to run tests
46+
script: pytest src/fermilib --cov src/fermilib
47+
48+
after_success:
49+
- coveralls
50+

MANIFEST.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
include LICENSE
2+
include MANIFEST.in
3+
include NOTICE
4+
include README.rst
5+
include requirements.txt
6+
include setup.py
7+
8+
recursive-include src *.py *.hdf5 *.npy

NOTICE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FermiLib (www.projectq.ch)
2+
3+
The first release of FermiLib (v0.1a0) was developed by Ryan Babbush (Google), Jarrod McClean (LBNL*), Damian Steiger (ETH, Google), Ian Kivlichan (Harvard University), Thomas Häner (ETH), Vojtech Havlicek, Matthew Neeley (Google), and Wei Sun (Google).
4+
5+
*FermiLib Copyright (c) 2017, All contributors including but not limited to The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.
6+
7+
NOTICE. This Software was developed partially under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights. As such, the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, distribute copies to the public, prepare derivative works, and perform publicly and display publicly, and to permit others to do so.
8+
9+
This first release (v0.1a0) is licensed under the Apache License, Version 2.0 (the "License");
10+
you may not use this file except in compliance with the License.
11+
You may obtain a copy of the License at
12+
13+
http://www.apache.org/licenses/LICENSE-2.0
14+
15+
Unless required by applicable law or agreed to in writing, software
16+
distributed under the License is distributed on an "AS IS" BASIS,
17+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
See the License for the specific language governing permissions and
19+
limitations under the License.

README.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
FermiLib - An open source software for analyzing quantum simulation algorithms
2+
==============================================================================
3+
4+
.. image:: https://travis-ci.org/ProjectQ-Framework/FermiLib.svg?branch=master
5+
:target: https://travis-ci.org/ProjectQ-Framework/FermiLib
6+
7+
.. image:: https://coveralls.io/repos/github/ProjectQ-Framework/FermiLib/badge.svg
8+
:target: https://coveralls.io/github/ProjectQ-Framework/FermiLib
9+
10+
.. image:: https://readthedocs.org/projects/fermilib/badge/?version=latest
11+
:target: http://fermilib.readthedocs.io/en/latest/?badge=latest
12+
:alt: Documentation Status
13+
14+
15+
FermiLib is an open source effort for analyzing quantum simulation algorithms.
16+
17+
The first version (v0.1a0) is an alpha release which features data structures and tools for obtaining and manipulating representations of fermionic Hamiltonians. FermiLib is designed as a library on top of ProjectQ and leverages ProjectQ to compile, emulate and simulate quantum circuits.
18+
19+
Getting started
20+
---------------
21+
22+
To start using FermiLib, simply follow the installation instructions in the `intro <https://github.com/ProjectQ-Framework/FermiLib/tree/master/docs/intro.html>`__. There, you will also find `code examples <https://github.com/ProjectQ-Framework/FermiLib/tree/master/examples.html>`__. Also, make sure to check out the `ProjectQ
23+
website <http://www.projectq.ch>`__ and the detailed `code documentation <https://fermilib.readthedocs.io/>`__.
24+
25+
How to contribute
26+
-----------------
27+
28+
To contribute code please adhere to the following very simple rules:
29+
30+
1. Make sure your new code comes with extensive tests!
31+
2. Make sure you adhere to our style guide. Until we release a code style
32+
guide, just have a look at our code for clues. We mostly follow pep8 and use the pep8 linter to check for it.
33+
3. Put global constants and configuration parameters into src/fermilib/config.py, and
34+
add *from config import ** in the file that uses the constants/parameters.
35+
36+
Documentation can be found `here <https://github.com/ProjectQ-Framework/FermiLib/tree/master/docs/>`_.
37+
38+
Authors
39+
-------
40+
41+
The first release of FermiLib (v0.1a0) was developed by `Ryan Babbush <https://research.google.com/pubs/RyanBabbush.html>`__, `Jarrod McClean <https://crd.lbl.gov/departments/computational-science/ccmc/staff/alvarez-fellows/jarrod-mcclean/>`__, `Damian S. Steiger <http://www.comp.phys.ethz.ch/people/person-detail.html?persid=165677>`__, `Ian D. Kivlichan <http://aspuru.chem.harvard.edu/ian-kivlichan/>`__, `Thomas
42+
Häner <http://www.comp.phys.ethz.ch/people/person-detail.html?persid=179208>`__, `Vojtech Havlicek <https://github.com/VojtaHavlicek>`__, `Matthew Neeley <https://maffoo.net/>`__, and `Wei Sun <https://github.com/Spaceenter>`__.
43+
44+
License
45+
-------
46+
47+
FermiLib is released under the Apache 2 license.

docs/.nojekyll

Whitespace-only changes.

docs/Makefile

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
# Makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
PAPER =
8+
BUILDDIR = _build
9+
10+
# Internal variables.
11+
PAPEROPT_a4 = -D latex_paper_size=a4
12+
PAPEROPT_letter = -D latex_paper_size=letter
13+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
14+
# the i18n builder cannot share the environment and doctrees with the others
15+
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
16+
17+
.PHONY: help
18+
help:
19+
@echo "Please use \`make <target>' where <target> is one of"
20+
@echo " html to make standalone HTML files"
21+
@echo " dirhtml to make HTML files named index.html in directories"
22+
@echo " singlehtml to make a single large HTML file"
23+
@echo " pickle to make pickle files"
24+
@echo " json to make JSON files"
25+
@echo " htmlhelp to make HTML files and a HTML help project"
26+
@echo " qthelp to make HTML files and a qthelp project"
27+
@echo " applehelp to make an Apple Help Book"
28+
@echo " devhelp to make HTML files and a Devhelp project"
29+
@echo " epub to make an epub"
30+
@echo " epub3 to make an epub3"
31+
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
32+
@echo " latexpdf to make LaTeX files and run them through pdflatex"
33+
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
34+
@echo " text to make text files"
35+
@echo " man to make manual pages"
36+
@echo " texinfo to make Texinfo files"
37+
@echo " info to make Texinfo files and run them through makeinfo"
38+
@echo " gettext to make PO message catalogs"
39+
@echo " changes to make an overview of all changed/added/deprecated items"
40+
@echo " xml to make Docutils-native XML files"
41+
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
42+
@echo " linkcheck to check all external links for integrity"
43+
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
44+
@echo " coverage to run coverage check of the documentation (if enabled)"
45+
@echo " dummy to check syntax errors of document sources"
46+
47+
.PHONY: clean
48+
clean:
49+
rm -rf $(BUILDDIR)/*
50+
51+
.PHONY: html
52+
html:
53+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
54+
@echo
55+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
56+
57+
.PHONY: dirhtml
58+
dirhtml:
59+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
60+
@echo
61+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
62+
63+
.PHONY: singlehtml
64+
singlehtml:
65+
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
66+
@echo
67+
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
68+
69+
.PHONY: pickle
70+
pickle:
71+
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
72+
@echo
73+
@echo "Build finished; now you can process the pickle files."
74+
75+
.PHONY: json
76+
json:
77+
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
78+
@echo
79+
@echo "Build finished; now you can process the JSON files."
80+
81+
.PHONY: htmlhelp
82+
htmlhelp:
83+
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
84+
@echo
85+
@echo "Build finished; now you can run HTML Help Workshop with the" \
86+
".hhp project file in $(BUILDDIR)/htmlhelp."
87+
88+
.PHONY: qthelp
89+
qthelp:
90+
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
91+
@echo
92+
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
93+
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
94+
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/FermiLib.qhcp"
95+
@echo "To view the help file:"
96+
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/FermiLib.qhc"
97+
98+
.PHONY: applehelp
99+
applehelp:
100+
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
101+
@echo
102+
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
103+
@echo "N.B. You won't be able to view it unless you put it in" \
104+
"~/Library/Documentation/Help or install it in your application" \
105+
"bundle."
106+
107+
.PHONY: devhelp
108+
devhelp:
109+
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
110+
@echo
111+
@echo "Build finished."
112+
@echo "To view the help file:"
113+
@echo "# mkdir -p $$HOME/.local/share/devhelp/FermiLib"
114+
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/FermiLib"
115+
@echo "# devhelp"
116+
117+
.PHONY: epub
118+
epub:
119+
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
120+
@echo
121+
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
122+
123+
.PHONY: epub3
124+
epub3:
125+
$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
126+
@echo
127+
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
128+
129+
.PHONY: latex
130+
latex:
131+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
132+
@echo
133+
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
134+
@echo "Run \`make' in that directory to run these through (pdf)latex" \
135+
"(use \`make latexpdf' here to do that automatically)."
136+
137+
.PHONY: latexpdf
138+
latexpdf:
139+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
140+
@echo "Running LaTeX files through pdflatex..."
141+
$(MAKE) -C $(BUILDDIR)/latex all-pdf
142+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
143+
144+
.PHONY: latexpdfja
145+
latexpdfja:
146+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
147+
@echo "Running LaTeX files through platex and dvipdfmx..."
148+
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
149+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
150+
151+
.PHONY: text
152+
text:
153+
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
154+
@echo
155+
@echo "Build finished. The text files are in $(BUILDDIR)/text."
156+
157+
.PHONY: man
158+
man:
159+
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
160+
@echo
161+
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
162+
163+
.PHONY: texinfo
164+
texinfo:
165+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
166+
@echo
167+
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
168+
@echo "Run \`make' in that directory to run these through makeinfo" \
169+
"(use \`make info' here to do that automatically)."
170+
171+
.PHONY: info
172+
info:
173+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
174+
@echo "Running Texinfo files through makeinfo..."
175+
make -C $(BUILDDIR)/texinfo info
176+
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
177+
178+
.PHONY: gettext
179+
gettext:
180+
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
181+
@echo
182+
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
183+
184+
.PHONY: changes
185+
changes:
186+
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
187+
@echo
188+
@echo "The overview file is in $(BUILDDIR)/changes."
189+
190+
.PHONY: linkcheck
191+
linkcheck:
192+
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
193+
@echo
194+
@echo "Link check complete; look for any errors in the above output " \
195+
"or in $(BUILDDIR)/linkcheck/output.txt."
196+
197+
.PHONY: doctest
198+
doctest:
199+
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
200+
@echo "Testing of doctests in the sources finished, look at the " \
201+
"results in $(BUILDDIR)/doctest/output.txt."
202+
203+
.PHONY: coverage
204+
coverage:
205+
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
206+
@echo "Testing of coverage in the sources finished, look at the " \
207+
"results in $(BUILDDIR)/coverage/python.txt."
208+
209+
.PHONY: xml
210+
xml:
211+
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
212+
@echo
213+
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
214+
215+
.PHONY: pseudoxml
216+
pseudoxml:
217+
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
218+
@echo
219+
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
220+
221+
.PHONY: dummy
222+
dummy:
223+
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
224+
@echo
225+
@echo "Build finished. Dummy builder generates no files."

0 commit comments

Comments
 (0)