Skip to content

Commit

Permalink
Merge branch 'beta' into 'master' to become PyGSTi version 0.9.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Nielsen committed Mar 2, 2018
2 parents 23470ec + d576137 commit 49bda91
Show file tree
Hide file tree
Showing 577 changed files with 624,058 additions and 90,576 deletions.
27 changes: 26 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,28 @@
*.out
*.coverage*
*.serial
*.cache
.ipynb_checkpoints
test/test_packages/temp_test_files/*
jupyter_notebooks/Tutorials/tutorial_files
jupyter_notebooks/Tutorials/offline
jupyter_notebooks/Examples/example_files
test/test_packages/offline
hooks/etc/permissions.yml
*comm_output*.txt
**offline/
**tutorial_files
*.lprof
*.cache

# Test Metadata #
#################
test/output/*
test/output/pylint/*
test/output/individual_coverage/*/*
test/test_packages/.noseids # Used in running failed tests
test/test_packages/.noseids
test/test_packages/cmp_chk_files/Fake_Dataset_none.txt.cache
**tutorial_files

# Compiled source #
###################
Expand Down Expand Up @@ -66,3 +76,18 @@ HighImpactPaper1/texFiles/.DS_Store
doc/html/*
doc/build/*.rst
doc/build/_build/*

# Customer Data #
#################
scripts/profiling/report/*.ipynb
scripts/profiling/report/Analyze+2Q+data.py
scripts/profiling/report/*.html
scripts/profiling/*.html
scripts/profiling/report/standard_report.py
scripts/profiling/report/tp_report.py
scripts/profiling/report/rigetti_nocache.py

# Profiling data #
scripts/profiling/output
scripts/profiling/data

41 changes: 18 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist: precise
language: python

python:
Expand All @@ -11,15 +12,17 @@ branches:
- develop

env:
- Drivers=True # All of drivers (Tends to take longer, put it first in the mx)
- Default=True # construction, io, objects, tools, optimize, algorithms
- ReportA=True # Only testReport.py (none of the other reports tests)
- ReportB=True # test the other reports tests
- MPI=True # All of MPI

- Drivers=True # First in build mx because long duration
- Algorithms=True
- AlgorithmsB=True
- Default=True # construction, io, objects, tools, optimize
- Report=True
- ReportB=True
- MPI=True

before_install:
- sudo apt-get -qq update
- sudo apt-get -qq install gfortran libblas-dev liblapack-dev >/dev/null
- sudo apt-get -qq install gfortran libblas-dev liblapack-dev
- sudo apt-get -qq install openmpi-bin openmpi-common openssh-client openssh-server libopenmpi1.3 libopenmpi-dbg libopenmpi-dev >/dev/null
- sudo bash CI/install.sh # Only install texlive and extensions if we need them
- "export DISPLAY=:99.0"
Expand All @@ -29,36 +32,28 @@ before_install:
install:
- travis_retry travis_wait pip install -r requirements.txt
- pip install --global-option=build_ext --global-option="-I/usr/include/suitesparse" cvxpy cvxopt >/dev/null
- pip install python-pptx mpi4py zmq coverage >/dev/null
- pip install ipython mpi4py zmq coverage msgpack-python cython psutil >/dev/null
- pip install -e . >/dev/null

cache:
pip: true
timeout: 1000

#Script For default "test" stage
script:
- cd test
- travis_wait 50 python travisTests.py # Tests may take some time!
- cd ..

after_script:
- |
declare exitCode
curl -sSL https://raw.githubusercontent.com/alrra/travis-after-all/1.4.4/lib/travis-after-all.js | node
exitCode=$?
if [ $exitCode -eq 0 ]; then
python CI/deploy
fi
if [ $exitCode -eq 1 ]; then
echo "Build failed - not deploying!!!!!!"
fi
jobs:
include:
- stage: deploy
python: 3.5
env: Drivers=False Algorithms=False AlgorithmsB=False Default=False Report=False ReportB=False MPI=False
script: python CI/deploy

notifications:
email:
on_success: change
on_failure: always


50 changes: 27 additions & 23 deletions CI/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -98,35 +98,39 @@ if TRAVIS_BRANCH == "develop" and TRAVIS_PULL_REQUEST == "false":
branchname]) # View merge tree between beta and (our) develop
output = output.decode('utf-8', 'ignore')
print('Done:')
# print(output)
#print(output)

canMerge = ('<' * 5) not in output # '<' * 5 avoids git finding the expanded string in this file and thinking it is a merge conflict

if canMerge:
print('Merge of develop into beta is possible')
# The below code is active, but only for testing
subprocess.call(['git', 'merge', '--no-ff', '--no-commit', 'develop']) #into beta
print('Merge command finished.')
print('Staging files..')
subprocess.call(['git', 'add', '-u'])
print('Committing..')
subprocess.call(['git', 'commit', '--no-verify', '-m',
'Auto-merged develop -> beta (No conflicts, CI passed)'])
print('Commit finished')

PUSHKEY = os.environ['PUSHKEY']
push_uri = 'https://%s:%s@github.com/pyGSTio/pyGSTi.git' % (USER, PUSHKEY) # yikes
try:
print('Pushing to origin/beta. If this fails, there shouldn\'t be any useful output, since it would contain my access token')
with open(os.devnull, 'w') as FNULL:
result = subprocess.call(['git', 'push', '--no-verify', push_uri, 'beta'], stdout=FNULL, stderr=FNULL)
if result != 0:
print('Secure push failed')
else:
print('Secure push worked')
except:
print('Secure push failed')

merge_output = subprocess.check_output(['git', 'merge', '--no-ff', '--no-commit', 'develop']) #into beta
merge_output = merge_output.decode('utf-8', 'ignore')
if ("Automatic merge failed" in merge_output) or ("CONFLICT" in merge_output):
print('Merge command failed to automatically merge. Exiting without committing!')
else:
print('Merge command automatically merged successfully.')

print('Staging files..')
subprocess.call(['git', 'add', '-u'])
print('Committing..')
subprocess.call(['git', 'commit', '--no-verify', '-m',
'Auto-merged develop -> beta (No conflicts, CI passed)'])
print('Commit finished')

PUSHKEY = os.environ['PUSHKEY']
push_uri = 'https://%s:%s@github.com/pyGSTio/pyGSTi.git' % (USER, PUSHKEY) # yikes
try:
print('Pushing to origin/beta. If this fails, there shouldn\'t be any useful output, since it would contain my access token')
with open(os.devnull, 'w') as FNULL:
result = subprocess.call(['git', 'push', '--no-verify', push_uri, 'beta'], stdout=FNULL, stderr=FNULL)
if result != 0:
print('Secure push failed')
else:
print('Secure push worked')
except:
print('Secure push failed')
else:
print('Potential merge conflicts found! Cannot merge beta into develop')

Expand Down
81 changes: 41 additions & 40 deletions CI/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,44 +20,45 @@ apt-get install libsuitesparse-dev
cp /usr/lib/liblapack.so /usr/lib/libsuitesparseconfig.so


echo "Checking if pdflatex install is needed"

if [ "$ReportA" == "True" ]; then
apt-get -qq install texlive-full
fi

if [ "$Drivers" == "True" ]; then
apt-get -qq install texlive-latex-base
fi

if [ "$ReportA" == "True" ] || [ "$Drivers" == "True" ]; then
echo "Installing pdflatex requirements"
pushd /usr/share/texmf-texlive/
wget http://mirrors.ctan.org/install/macros/latex/contrib/etoolbox.tds.zip
wget http://mirrors.ctan.org/install/macros/latex/contrib/adjustbox.tds.zip
wget http://mirrors.ctan.org/install/macros/latex/contrib/collectbox.tds.zip
wget http://mirrors.ctan.org/install/macros/latex/contrib/pdfcomment.tds.zip
wget http://mirrors.ctan.org/install/macros/latex/contrib/datetime2.tds.zip
wget http://mirrors.ctan.org/install/macros/generic/tracklang.tds.zip
wget http://mirrors.ctan.org/install/macros/latex/contrib/bezos.tds.zip
wget http://mirrors.ctan.org/install/macros/latex/contrib/hyperref.tds.zip
wget http://mirrors.ctan.org/install/macros/latex/contrib/oberdiek.tds.zip
wget http://mirrors.ctan.org/install/macros/generic/ifxetex.tds.zip
wget http://mirrors.ctan.org/install/macros/latex/contrib/standalone.tds.zip
unzip -o etoolbox.tds.zip
unzip -o adjustbox.tds.zip
unzip -o collectbox.tds.zip
unzip -o pdfcomment.tds.zip
unzip -o datetime2.tds.zip
unzip -o tracklang.tds.zip
unzip -o bezos.tds.zip
unzip -o hyperref.tds.zip
unzip -o oberdiek.tds.zip
unzip -o ifxetex.tds.zip
unzip -o standalone.tds.zip
texhash
popd
else
echo "pdflatex is not required for these tests (ReportA is not set to \"True\")"
fi
#Latex is no longer needed!
#echo "Checking if pdflatex install is needed"
#
#if [ "$ReportA" == "True" ]; then
# apt-get -qq install texlive-full
#fi
#
#if [ "$Drivers" == "True" ]; then
# apt-get -qq install texlive-latex-base
#fi
#
#if [ "$ReportA" == "True" ] || [ "$Drivers" == "True" ]; then
# echo "Installing pdflatex requirements"
# pushd /usr/share/texmf-texlive/
# wget http://mirrors.ctan.org/install/macros/latex/contrib/etoolbox.tds.zip
# wget http://mirrors.ctan.org/install/macros/latex/contrib/adjustbox.tds.zip
# wget http://mirrors.ctan.org/install/macros/latex/contrib/collectbox.tds.zip
# wget http://mirrors.ctan.org/install/macros/latex/contrib/pdfcomment.tds.zip
# wget http://mirrors.ctan.org/install/macros/latex/contrib/datetime2.tds.zip
# wget http://mirrors.ctan.org/install/macros/generic/tracklang.tds.zip
# wget http://mirrors.ctan.org/install/macros/latex/contrib/bezos.tds.zip
# wget http://mirrors.ctan.org/install/macros/latex/contrib/hyperref.tds.zip
# wget http://mirrors.ctan.org/install/macros/latex/contrib/oberdiek.tds.zip
# wget http://mirrors.ctan.org/install/macros/generic/ifxetex.tds.zip
# wget http://mirrors.ctan.org/install/macros/latex/contrib/standalone.tds.zip
# unzip -o etoolbox.tds.zip
# unzip -o adjustbox.tds.zip
# unzip -o collectbox.tds.zip
# unzip -o pdfcomment.tds.zip
# unzip -o datetime2.tds.zip
# unzip -o tracklang.tds.zip
# unzip -o bezos.tds.zip
# unzip -o hyperref.tds.zip
# unzip -o oberdiek.tds.zip
# unzip -o ifxetex.tds.zip
# unzip -o standalone.tds.zip
# texhash
# popd
#else
# echo "pdflatex is not required for these tests (ReportA is not set to \"True\")"
#fi

Binary file removed ExampleReport.pdf
Binary file not shown.
52 changes: 43 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,46 @@ This is the root directory of the pyGSTi software, which is a Python
under the GNU General Public License (GPL). Copyright and license information
can be found in ``license.txt``, and the GPL itself in ``COPYING``.

Gate Set Tomography is used to characterize the operations performed by
hardware designed to implement a (small) system of quantum bits (qubits).
Here's the basic idea:

1. you tell pyGSTi what quantum operations you'd like to perform
2. pyGSTi tells you what sequences of operations it want's data for
3. you perform the requested experiments and place the resulting
data (outcome counts) into a text file that looks something like:

```
## Columns = 0 count, 1 count
{} 0 100
Gx 10 90
GxGy 40 60
Gx^4 20 80
```
4. pyGSTi takes the data file and outputs a "report" - currently a
HTML web page.
There are numerous [Tutorial](https://github.com/pyGSTio/pyGSTi/tree/beta/jupyter_notebooks/Tutorials)
and [Example](https://github.com/pyGSTio/pyGSTi/tree/beta/jupyter_notebooks/Examples)
ipython notebooks (especially
[Tutorial 0](https://github.com/pyGSTio/pyGSTi/blob/beta/jupyter_notebooks/Tutorials/00%20Getting%20Started.ipynb)
) included in this repository that demonstrate pyGSTi's
syntax and use, as well as a [FAQ](https://github.com/pyGSTio/pyGSTi/blob/beta/jupyter_notebooks/FAQ.ipynb).
Getting Started:
---------------
pyGSTi is written entirely in Python, and so there's no compiling necessary.
The first step is to install Python (and
[Jupyter notebook](http://jupyter.org/) is highly recommended) if you haven't
already. In order to use pyGSTi you need to tell your Python distribution
where pyGSTi lives, which can be done in one of two ways:
pyGSTi is written almost entirely in Python. Apart from a single optional
Cython module, there's no compiling necessary. The first step is to install
Python (and [Jupyter notebook](http://jupyter.org/) is highly recommended)
if you haven't already. In order to use pyGSTi you need to tell your Python
distribution where pyGSTi lives, which can be done in one of several ways:
* User-Only Installation
To install pyGSTi for the current user, run ``python install_locally.py``
To install pyGSTi for the current user, you can run from the top-level
directory either ``pip install -e .`` or ``python install_locally.py``.
This adds the current pyGSTi path to Python's list of search paths, and
doesn't require administrative access. Typically you want to do this if
Expand All @@ -31,6 +59,8 @@ where pyGSTi lives, which can be done in one of two ways:
You'd also want to use this option if you'd like long-term access the
tutorial notebook files in the ``jupyter_notebooks`` directory under this
one, since this means you'll be keeping this directory around anyway.
The ``pip install -e .`` is slightly preferable since it will automatically
build the optional Cython extension.
* System-Wide Installation
Expand All @@ -53,7 +83,7 @@ where pyGSTi lives, which can be done in one of two ways:
to be the one Python uses when you ``import pygsti``.
Using pyGSTi
----------
------------
After you've installed pyGSTi, you should be able to import the
`pygsti` Python package. The next thing to do is take a look at
Expand All @@ -66,13 +96,17 @@ the tutorials, which you do by:
``jupyter notebook``
The Jupyter server should open up your web browser to the server root, from
where you can start the first "00" tutorial notebook. (Note that the key
where you can start the first "0th" tutorial notebook. (Note that the key
command to execute a cell within the Jupyter notebook is ``Shift+Enter``, not
just ``Enter``.)
just ``Enter``.) Example notebooks, found in the ``jupyter_notebooks/Examples/``
directory, are focused on more specific tasks than the tutorials, and will be
most useful for those looking to get a quick start using pyGSTi in a typical
scenario.
Congratulations! You're up and running with pyGSTi!
Documentation
-------------
Online documentation is hosted on [Read the Docs](http://pygsti.readthedocs.io).
Expand Down
7 changes: 3 additions & 4 deletions doc/build/_templates/my_autosummary_class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
:noindex:

{% if methods %}
.. rubric:: Methods

.. autosummary::
:toctree:
:hidden:
{% for item in methods %}
~{{ name }}.{{ item }}
{%- endfor %}
Expand All @@ -22,12 +21,12 @@

{% block attributes %}
{% if attributes %}
.. rubric:: Attributes

.. autosummary::
:toctree:
:hidden:
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

Loading

0 comments on commit 49bda91

Please sign in to comment.