Skip to content

Commit

Permalink
Merge pull request #769 from chriseclectic/stable/0.5-backports
Browse files Browse the repository at this point in the history
Stable/0.5 backports for 0.5.2 release
  • Loading branch information
chriseclectic authored Jun 1, 2020
2 parents 4bec295 + f3d1692 commit 25de39f
Show file tree
Hide file tree
Showing 25 changed files with 270 additions and 156 deletions.
14 changes: 11 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ stage_generic: &stage_generic
else
pip install -U -c constraints.txt qiskit-terra
fi
# Installing qiskit-ibmq-provider stable branch
# This is only needed to suppress warnings when importing Qiskit
- pip install https://github.com/Qiskit/qiskit-ibmq-provider/archive/stable.zip
# Installing qiskit-aer...
- pip install -U -c constraints.txt -r requirements-dev.txt
env:
- QISKIT_SUPPRESS_PACKAGING_WARNINGS=Y

stage_linux: &stage_linux
<<: *stage_generic
Expand All @@ -62,6 +61,7 @@ stage_linux: &stage_linux
- python setup.py bdist_wheel -- -DCMAKE_CXX_COMPILER=g++-7 -DAER_THRUST_BACKEND=OMP -- -j4
- pip install dist/qiskit_aer*whl
script:
- pip check
- stestr run --slowest

stage_osx: &stage_osx
Expand All @@ -71,6 +71,7 @@ stage_osx: &stage_osx
language: generic
python: 3.7
env:
- QISKIT_SUPPRESS_PACKAGING_WARNINGS=Y
- MPLBACKEND=ps
- PYTHON_VERSION=3.7.2
cache:
Expand Down Expand Up @@ -102,6 +103,7 @@ stage_osx: &stage_osx
- python setup.py bdist_wheel -- -- -j4
- pip install dist/qiskit_aer*whl
script:
- pip check
- stestr run --slowest

###############################################################################
Expand Down Expand Up @@ -167,6 +169,7 @@ jobs:
- aer-test/bin/pip install git+https://github.com/Qiskit/qiskit-terra
- aer-test/bin/pip install ../dist/*tar.gz
- aer-test/bin/python ../tools/verify_wheels.py
- aer-test/bin/pip check
# MacOS Wheel
- stage: compile
name: Python Wheel Build MacOS
Expand All @@ -185,6 +188,7 @@ jobs:
- aer-test/bin/pip install git+https://github.com/Qiskit/qiskit-terra
- aer-test/bin/pip install ../dist/*tar.gz
- aer-test/bin/python ../tools/verify_wheels.py
- aer-test/bin/pip check
# Linux Standalone
- stage: compile
name: Standalone Build Linux
Expand Down Expand Up @@ -232,6 +236,7 @@ jobs:
<<: *stage_osx
python: 3.8
env:
- QISKIT_SUPPRESS_PACKAGING_WARNINGS=Y
- PYTHON_VERSION=3.8.1

# MacOS, Python 3.7 (via pyenv)
Expand All @@ -242,6 +247,7 @@ jobs:
env:
- MPLBACKEND=ps
- PYTHON_VERSION=3.7.2
- QISKIT_SUPPRESS_PACKAGING_WARNINGS=Y

# MacOS, Python 3.6 (via pyenv)
- stage: test
Expand All @@ -252,6 +258,7 @@ jobs:
env:
- MPLBACKEND=ps
- PYTHON_VERSION=3.6.5
- QISKIT_SUPPRESS_PACKAGING_WARNINGS=Y

# MacOS, Python 3.5 (via pyenv)
- stage: test
Expand All @@ -262,6 +269,7 @@ jobs:
env:
- MPLBACKEND=ps
- PYTHON_VERSION=3.5.6
- QISKIT_SUPPRESS_PACKAGING_WARNINGS=Y
# "deploy" stage
##########################################################################
#
Expand Down
22 changes: 20 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,16 @@ stages:
- bash: |
tox -edocs
displayName: 'Run Docs build'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: 'docs/_build/html'
archiveType: tar
archiveFile: '$(Build.ArtifactStagingDirectory)/html_docs.tar.gz'
verbose: true
- task: PublishBuildArtifacts@1
displayName: 'Publish docs'
inputs:
pathtoPublish: 'docs/_build/html'
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'html_docs'
- job: 'Windows'
condition: not(startsWith(variables['Build.SourceBranch'], 'refs/tags'))
Expand Down Expand Up @@ -145,6 +151,18 @@ stages:
fi
displayName: "Install dependencies py3.8"
condition: eq(variables['python.version'], '3.8')
- bash: |
set -e
source activate qiskit-aer-$(Build.BuildNumber)
pip install 'numpy<1.19.0'
pip install -r requirements-dev.txt
if [[ $SYSTEM_PULLREQUEST_TARGETBRANCH == *"master"* || $BUILD_SOURCEBRANCH == *"master"* ]] ; then
pip install git+https://github.com/Qiskit/qiskit-terra.git
else
pip install qiskit-terra
fi
displayName: "Install dependencies"
condition: eq(variables['python.version'], '3.5')
- bash: |
set -e
source activate qiskit-aer-$(Build.BuildNumber)
Expand All @@ -155,7 +173,7 @@ stages:
pip install qiskit-terra
fi
displayName: "Install dependencies"
condition: ne(variables['python.version'], '3.8')
condition: and(ne(variables['python.version'], '3.5'), ne(variables['python.version'], '3.8'))
- bash: |
set -e
source activate qiskit-aer-$(Build.BuildNumber)
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = '0.5.1'
release = '0.5.2'

# -- General configuration ---------------------------------------------------

Expand All @@ -65,7 +65,7 @@
'sphinx.ext.viewcode',
'sphinx.ext.extlinks',
'sphinx_tabs.tabs',
'jupyter_sphinx.execute',
'jupyter_sphinx',
'reno.sphinxext',
]
html_static_path = ['_static']
Expand Down
2 changes: 1 addition & 1 deletion qiskit/providers/aer/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.1
0.5.2
20 changes: 10 additions & 10 deletions qiskit/providers/aer/pulse/qutip_lite/dimensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,24 @@
import numpy as np


def flatten(l):
def flatten(lst):
"""Flattens a list of lists to the first level.
Given a list containing a mix of scalars and lists,
flattens down to a list of the scalars within the original
list.
Args:
l (list): Input list
lst (list): Input list
Returns:
list: Flattened list.
"""
if not isinstance(l, list):
return [l]
if not isinstance(lst, list):
return [lst]
else:
return sum(map(flatten, l), [])
return sum(map(flatten, lst), [])


def is_scalar(dims):
Expand Down Expand Up @@ -134,16 +134,16 @@ def type_from_dims(dims, enforce_square=True):
return 'other'


def _enumerate_flat(l, idx=0):
if not isinstance(l, list):
def _enumerate_flat(lst, idx=0):
if not isinstance(lst, list):
# Found a scalar, so return and increment.
return idx, idx + 1
else:
# Found a list, so append all the scalars
# from it and recurse to keep the increment
# correct.
acc = []
for elem in l:
for elem in lst:
labels, idx = _enumerate_flat(elem, idx)
acc.append(labels)
return acc, idx
Expand Down Expand Up @@ -191,7 +191,7 @@ def collapse_dims_super(dims):
return _collapse_dims_to_level(dims, 2)


def enumerate_flat(l):
def enumerate_flat(lst):
"""Labels the indices at which scalars occur in a flattened list.
Given a list containing a mix of scalars and lists,
Expand All @@ -205,4 +205,4 @@ def enumerate_flat(l):
[[[0], [1, 2]], 3]
"""
return _enumerate_flat(l)[0]
return _enumerate_flat(lst)[0]
6 changes: 3 additions & 3 deletions qiskit/providers/aer/pulse/qutip_lite/superoperator.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,13 @@ def vec2mat(vec):
return vec.reshape((n, n)).T


def vec2mat_index(N, I):
def vec2mat_index(N, idx):
"""
Convert a vector index to a matrix index pair that is compatible with the
vector to matrix rearrangement done by the vec2mat function.
"""
j = int(I / N)
i = I - N * j
j = int(idx / N)
i = idx - N * j
return i, j


Expand Down
4 changes: 2 additions & 2 deletions qiskit/providers/aer/utils/noise_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ def solve_quadratic_program(self, P, q):
h = numpy.array(h_data).astype(float)
x = cvxpy.Variable(n)
prob = cvxpy.Problem(
cvxpy.Minimize((1 / 2) * cvxpy.quad_form(x, P) + q.T@x),
[G@x <= h])
cvxpy.Minimize((1 / 2) * cvxpy.quad_form(x, P) + q.T @ x),
[G @ x <= h])
prob.solve()
return x.value
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
fixes:
- |
Fixed bug with statevector and unitary simulators running a number of (parallel)
shots equal to the number of CPU threads instead of only running a single shot.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
fixes:
- |
Fixes the "diagonal" qobj gate instructions being applied incorrectly
in the density matrix Qasm Simulator method.
- |
Fixes bug where conditional gates were not being applied correctly
on the density matrix simulation method.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
fixes:
- |
Fix bug in CZ gate and Z gate for "density_matrix_gpu" and
"density_matrix_thrust" QasmSimulator methods.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
fixes:
- |
Fixes issue where memory requirements of simulation were not being checked
on the QasmSimulator when using a non-automatic simulation method.
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@

requirements = [
'qiskit-terra>=0.12.0',
'numpy>=1.16.3',
'scipy>=1.0',
'numpy>=1.16.3;python_version>"3.5"',
'numpy>=1.16.3,<1.19.0;python_version<"3.6"',
'scipy>=1.0;python_version>"3.5"',
'scipy>=1.0,<1.5.0;python_version<"3.6"',
'cython>=0.27.1',
'pybind11>=2.4' # This isn't really an install requirement,
# Pybind11 is required to be pre-installed for
Expand Down
5 changes: 2 additions & 3 deletions src/controllers/controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,8 @@ bool Controller::validate_memory_requirements(const state_t &state,
if(throw_except) {
std::string name = "";
JSON::get_value(name, "name", circ.header);
throw std::runtime_error("AER::Base::Controller: State " + state.name() +
" has insufficient memory to run the circuit " +
name);
throw std::runtime_error("Insufficient memory to run circuit \"" + name +
"\" using the " + state.name() + " simulator.");
}
return false;
}
Expand Down
Loading

0 comments on commit 25de39f

Please sign in to comment.