Skip to content

Commit

Permalink
Bump version to 2.7.1 for a patch release (#899)
Browse files Browse the repository at this point in the history
* Considerably reduce sampling in operator estimation UTs

* Make stderr operator estimation change backwards compatible

* Make tomographyexperiment qubits change backwards compatible

* Update the build badges in the README

* Bump version to 2.7.1

* Update the changelog for v2.7.1
  • Loading branch information
karalekas authored May 1, 2019
1 parent ec98e45 commit 5449f9a
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 94 deletions.
7 changes: 3 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ services:
command: ["-S"]
- name: rigetti/quilc
alias: quilc
command: ["-S"]

command: ["-R"]

test:
tags:
- github
script:
- export QVM_URL="http://qvm:5000"
- export COMPILER_URL='http://quilc:6000'
- export QVM_URL='http://qvm:5000'
- export QUILC_URL='tcp://quilc:5555'
- tox -e py36

style:
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
A library for easily generating Quil programs to be executed using the Rigetti Forest platform.
pyQuil is licensed under the [Apache 2.0 license](https://github.com/rigetti/pyQuil/blob/master/LICENSE).

[![Build Status](https://semaphoreci.com/api/v1/rigetti/pyquil/branches/master/badge.svg)](https://semaphoreci.com/rigetti/pyquil)
[![Documentation Status](https://readthedocs.org/projects/pyquil/badge/?version=latest)](http://pyquil.readthedocs.io/en/latest/?badge=latest)
[![pipeline status](https://gitlab.com/rigetti/forest/pyquil/badges/master/pipeline.svg)](https://gitlab.com/rigetti/forest/pyquil/commits/master)
[![Build Status](https://semaphoreci.com/api/v1/rigetti/pyquil/branches/master/shields_badge.svg)](https://semaphoreci.com/rigetti/pyquil)
[![Documentation Status](https://readthedocs.org/projects/pyquil/badge/?version=latest)](http://pyquil.readthedocs.io/en/latest/?badge=latest)


**Please note: To make full use of our SDK, in addition to installing
pyQuil, you will need to have installed quilc and the QVM (compiler
Expand Down
10 changes: 10 additions & 0 deletions docs/source/changes.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Changelog
=========

v2.7.1 (April 30, 2019)
-----------------------

Bugfixes:

- The changes to operator estimation (gh-870, gh-896) were not made in a backwards-compatible
fashion, and therefore this patch release aims to remedy that. Going forward, there will be
much more stringent requirements around backwards compatibility and deprecation.


v2.7 (April 29, 2019)
---------------------

Expand Down
2 changes: 1 addition & 1 deletion pyquil/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2.7.0"
__version__ = "2.7.1"

from pyquil.quil import Program
from pyquil.api import list_quantum_computers, get_qc
74 changes: 72 additions & 2 deletions pyquil/operator_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ class TomographyExperiment:

def __init__(self,
settings: Union[List[ExperimentSetting], List[List[ExperimentSetting]]],
program: Program):
program: Program,
qubits: List[int] = None):
if len(settings) == 0:
settings = []
else:
Expand All @@ -282,6 +283,10 @@ def __init__(self,

self._settings = settings # type: List[List[ExperimentSetting]]
self.program = program
if qubits is not None:
warnings.warn("The 'qubits' parameter has been deprecated and will be removed"
"in a future release of pyquil")
self.qubits = qubits

def __len__(self):
return len(self._settings)
Expand Down Expand Up @@ -714,14 +719,79 @@ class ExperimentResult:

setting: ExperimentSetting
expectation: Union[float, complex]
std_err: Union[float, complex]
total_counts: int
std_err: Union[float, complex] = None
raw_expectation: Union[float, complex] = None
raw_std_err: float = None
calibration_expectation: Union[float, complex] = None
calibration_std_err: Union[float, complex] = None
calibration_counts: int = None

def __init__(self, setting: ExperimentSetting,
expectation: Union[float, complex],
total_counts: int,
stddev: Union[float, complex] = None,
std_err: Union[float, complex] = None,
raw_expectation: Union[float, complex] = None,
raw_stddev: float = None,
raw_std_err: float = None,
calibration_expectation: Union[float, complex] = None,
calibration_stddev: Union[float, complex] = None,
calibration_std_err: Union[float, complex] = None,
calibration_counts: int = None):

object.__setattr__(self, 'setting', setting)
object.__setattr__(self, 'expectation', expectation)
object.__setattr__(self, 'total_counts', total_counts)
object.__setattr__(self, 'raw_expectation', raw_expectation)
object.__setattr__(self, 'calibration_expectation', calibration_expectation)
object.__setattr__(self, 'calibration_counts', calibration_counts)

if stddev is not None:
warnings.warn("'stddev' has been renamed to 'std_err'")
std_err = stddev
object.__setattr__(self, 'std_err', std_err)

if raw_stddev is not None:
warnings.warn("'raw_stddev' has been renamed to 'raw_std_err'")
raw_std_err = raw_stddev
object.__setattr__(self, 'raw_std_err', raw_std_err)

if calibration_stddev is not None:
warnings.warn("'calibration_stddev' has been renamed to 'calibration_std_err'")
calibration_std_err = calibration_stddev
object.__setattr__(self, 'calibration_std_err', calibration_std_err)

def get_stddev(self) -> Union[float, complex]:
warnings.warn("'stddev' has been renamed to 'std_err'")
return self.std_err

def set_stddev(self, value: Union[float, complex]):
warnings.warn("'stddev' has been renamed to 'std_err'")
object.__setattr__(self, 'std_err', value)

stddev = property(get_stddev, set_stddev)

def get_raw_stddev(self) -> float:
warnings.warn("'raw_stddev' has been renamed to 'raw_std_err'")
return self.raw_std_err

def set_raw_stddev(self, value: float):
warnings.warn("'raw_stddev' has been renamed to 'raw_std_err'")
object.__setattr__(self, 'raw_std_err', value)

raw_stddev = property(get_raw_stddev, set_raw_stddev)

def get_calibration_stddev(self) -> Union[float, complex]:
warnings.warn("'calibration_stddev' has been renamed to 'calibration_std_err'")
return self.calibration_std_err

def set_calibration_stddev(self, value: Union[float, complex]):
warnings.warn("'calibration_stddev' has been renamed to 'calibration_std_err'")
object.__setattr__(self, 'calibration_std_err', value)

calibration_stddev = property(get_calibration_stddev, set_calibration_stddev)

def __str__(self):
return f'{self.setting}: {self.expectation} +- {self.std_err}'

Expand Down
Loading

0 comments on commit 5449f9a

Please sign in to comment.