Skip to content

Commit

Permalink
Merge pull request #2052 from doichanj/release0.13.3
Browse files Browse the repository at this point in the history
Release 0.13.3

This is the Aer 0.13.3 release to support both Qiskit 0.46 and 1.0
  • Loading branch information
mtreinish authored Feb 6, 2024
2 parents 5c33837 + 5baadee commit e3f68bd
Show file tree
Hide file tree
Showing 26 changed files with 260 additions and 219 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ jobs:
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
Expand Down Expand Up @@ -179,7 +178,6 @@ jobs:
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
Expand Down
51 changes: 33 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,18 @@ jobs:
aer-test/bin/pip check
shell: bash
tests_linux:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
name: Linux Python ${{ matrix.python-version }}${{ matrix.qiskit-extra && format(' ({0})', matrix.qiskit-extra) }}
needs: [sdist, lint]
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12.0"]
os: ["ubuntu-latest"]
qiskit-extra: [""]
include:
- python-version: "3.10"
qiskit-extra: "'qiskit>=1.0.0rc1'"

env:
AER_THRUST_BACKEND: OMP
QISKIT_TEST_CAPTURE_STREAMS: 1
Expand All @@ -116,17 +121,19 @@ jobs:
${{ runner.os }}-${{ matrix.python-version}}-pip-test-
${{ runner.os }}-${{ matrix.python-version}}-pip-
${{ runner.os }}-${{ matrix.python-version}}-
- name: Install Deps
run: python -m pip install -U -c constraints.txt -r requirements-dev.txt wheel
- name: Install openblas
run: |
set -e
sudo apt-get update
sudo apt-get install -y libopenblas-dev
shell: bash
- name: Install Aer
- name: Install Aer and dependencies
run: |
python -m pip install -U .
python -m pip install -U \
-c constraints.txt \
-r requirements-dev.txt \
${{ matrix.qiskit-extra }} \
.
- name: Run Tests
run: |
set -e
Expand Down Expand Up @@ -185,13 +192,13 @@ jobs:
stestr run --slowest
shell: bash
tests_macos:
runs-on: ${{ matrix.os }}
runs-on: macOS-latest
name: macOS Python ${{ matrix.python-version }}
needs: [sdist, lint]
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", '3.11', "3.12.0"]
os: ["macOS-latest"]
env:
AER_THRUST_BACKEND: OMP
QISKIT_TEST_CAPTURE_STREAMS: 1
Expand All @@ -214,12 +221,13 @@ jobs:
${{ runner.os }}-${{ matrix.python-version}}-pip-test-
${{ runner.os }}-${{ matrix.python-version}}-pip-
${{ runner.os }}-${{ matrix.python-version}}-
- name: Install Deps
- name: Install Aer and dependencies
run: |
set -e
pip install -U -c constraints.txt -r requirements-dev.txt
- name: Install Aer
run: python -m pip install -U .
pip install -U \
-c constraints.txt \
-r requirements-dev.txt \
.
- name: Run Tests
run: |
set -e
Expand All @@ -228,13 +236,13 @@ jobs:
stestr run --slowest
shell: bash
tests_windows:
runs-on: ${{ matrix.os }}
runs-on: windows-2019
name: Windows Python ${{ matrix.python-version }}
needs: ["lint", "sdist"]
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12.0"]
os: ["windows-2019"]
env:
AER_THRUST_BACKEND: OMP
QISKIT_TEST_CAPTURE_STREAMS: 1
Expand All @@ -259,15 +267,22 @@ jobs:
${{ runner.os }}-${{ matrix.python-version}}-
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Install Deps
run: python -m pip install -U -c constraints.txt -r requirements-dev.txt wheel build
- name: Install Aer Windows
- name: Build Aer Windows
env:
CMAKE_GENERATOR: "Visual Studio 16 2019"
run: |
set -e
pip install build
python -I -m build --wheel
pip install -U dist/*.whl
shell: bash
- name: Install Aer and dependencies
run: |
set -e
shopt -s failglob
pip install -U \
-c constraints.txt \
-r requirements-dev.txt \
dist/*.whl
shell: bash
- name: Run Tests
env:
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/unit-tests-latest-qiskit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,25 @@ jobs:
${{ runner.os }}-${{ matrix.python-version}}-pip-test-
${{ runner.os }}-${{ matrix.python-version}}-pip-
${{ runner.os }}-${{ matrix.python-version}}-
- name: Install Deps
run: |
python -m pip install -U -c constraints.txt -r requirements-dev.txt wheel
pip install -U git+https://github.com/Qiskit/qiskit.git
- name: Install openblas
run: |
set -e
sudo apt-get update
sudo apt-get install -y libopenblas-dev
shell: bash
- name: Install Aer
- name: Install dependencies and Aer
run: |
python -m pip install -U .
python -m pip install -U setuptools wheel
python -m pip install -U \
-c constraints.txt \
-r requirements-dev.txt \
'git+https://github.com/Qiskit/qiskit.git@main' \
.
- name: Run Tests
run: |
set -e
pip check
rm -rf qiskit_aer
stestr run --slowest
shell: bash


10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ $ python
```python
import qiskit
from qiskit_aer import AerSimulator
from qiskit.providers.fake_provider import FakeManilaV2
from qiskit_ibm_runtime import QiskitRuntimeService

# Generate 3-qubit GHZ state
circ = qiskit.QuantumCircuit(3)
Expand All @@ -73,10 +73,10 @@ counts_ideal = result_ideal.get_counts(0)
print('Counts(ideal):', counts_ideal)
# Counts(ideal): {'000': 493, '111': 531}

# Construct a noisy simulator backend from an IBMQ backend
# This simulator backend will be automatically configured
# using the device configuration and noise model
backend = FakeManilaV2()
# Construct a simulator using a noise model
# from a real backend.
provider = QiskitRuntimeService()
backend = provider.get_backend("ibm_kyoto")
aersim_backend = AerSimulator.from_backend(backend)

# Perform noisy simulation
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
author = 'Qiskit Development Team'

# The short X.Y version
version = '0.13.1'
version = '0.13.3'
# The full version, including alpha/beta/rc tags
release = '0.13.1'
release = '0.13.3'

templates_path = ['_templates']

Expand Down
2 changes: 1 addition & 1 deletion qiskit_aer/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.13.2
0.13.3
8 changes: 7 additions & 1 deletion qiskit_aer/primitives/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ def __init__(
If approximation is True, this parameter is ignored and assumed to be False.
"""
super().__init__(options=run_options)
# These three private attributes used to be created by super, but were deprecated in Qiskit
# 0.46. See https://github.com/Qiskit/qiskit/pull/11051
self._circuits = []
self._parameters = []
self._observables = []

backend_options = {} if backend_options is None else backend_options
method = (
Expand Down Expand Up @@ -204,7 +209,8 @@ def _run(
parameter_values,
**run_options,
)
job.submit()
# The public submit method was removed in Qiskit 0.46
(job.submit if hasattr(job, "submit") else job._submit)() # pylint: disable=no-member
return job

def _compute(self, circuits, observables, parameter_values, run_options):
Expand Down
8 changes: 7 additions & 1 deletion qiskit_aer/primitives/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ def __init__(
skip_transpilation: if True, transpilation is skipped.
"""
super().__init__(options=run_options)
# These two private attributes used to be created by super, but were deprecated in Qiskit
# 0.46. See https://github.com/Qiskit/qiskit/pull/11051
self._circuits = []
self._parameters = []

self._backend = AerSimulator()
backend_options = {} if backend_options is None else backend_options
self._backend.set_options(**backend_options)
Expand Down Expand Up @@ -157,7 +162,8 @@ def _run(
self._circuits.append(circuit)
self._parameters.append(circuit.parameters)
job = PrimitiveJob(self._call, circuit_indices, parameter_values, **run_options)
job.submit()
# The public submit method was removed in Qiskit 0.46
(job.submit if hasattr(job, "submit") else job._submit)() # pylint: disable=no-member
return job

@staticmethod
Expand Down
9 changes: 9 additions & 0 deletions releasenotes/notes/fix_for_daily_tests-3fa9df70fb3e53ee.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
fixes:
- |
Removed deprecate function test in
test.terra.states.test_aer_statevector.TestAerStatevector.test_number_to_latex_terms
Sorted the output properties in
test.terra.noise.test_device_models.test_basic_device_gate_errors_from_target_and_properties
to compare correctly.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
fixes:
- |
Fixes test cases failed due to upgrade of Qiskit.
Removed importing Aer from qiskit.
QuantumCircuit.diagonal was deprecated, using circuit.library.Diagonal instead
3 changes: 3 additions & 0 deletions releasenotes/notes/release0.13.3-b144015572a25737.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
prelude: >
Aer 0.13.3 is a minor release to support Qiskit 0.46 and 1.0.
4 changes: 2 additions & 2 deletions test/benchmark/vqe_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
import numpy as np
import multiprocessing
from time import time
from qiskit import Aer
from qiskit.aqua.algorithms import VQE
from qiskit.aqua.components.optimizers import SLSQP
from qiskit.chemistry.applications import MolecularGroundStateEnergy
from qiskit.chemistry.components.initial_states import HartreeFock
from qiskit.chemistry.components.variational_forms import UCCSD
from qiskit.chemistry.drivers import PySCFDriver, UnitsType
from qiskit_aer import AerProvider


class UCCSDBenchmarkSuite:
Expand Down Expand Up @@ -67,7 +67,7 @@ def cb_create_solver(
optimizer=SLSQP(maxiter=5000),
max_evals_grouped=256,
)
vqe.quantum_instance = Aer.get_backend("qasm_simulator")
vqe.quantum_instance = AerProvider.get_backend("qasm_simulator")
vqe.quantum_instance.backend_options["backend_options"] = {
"max_parallel_experiments": threads,
"method": method,
Expand Down
6 changes: 3 additions & 3 deletions test/terra/backends/aer_simulator/test_conditional.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"""
AerSimulator Integration Tests
"""

from ddt import ddt
from test.terra.reference import ref_conditionals
from test.terra.backends.simulator_test_case import SimulatorTestCase, supported_methods

from qiskit import QuantumCircuit
from qiskit.circuit.library import DiagonalGate


@ddt
Expand Down Expand Up @@ -366,13 +366,13 @@ def test_conditional_diagonal(self):
circuit0 = QuantumCircuit(4, 4)
for i in range(1, 4):
circuit0.h(i)
circuit0.diagonal([-1, -1], [1]).c_if(circuit0.clbits[0], 0)
circuit0.append(DiagonalGate([-1, -1]), [1]).c_if(circuit0.clbits[0], 0)
circuit0.save_statevector(label="diff")

circuit1 = QuantumCircuit(4, 4)
for i in range(1, 4):
circuit1.h(i)
circuit1.diagonal([-1, -1], [1]).c_if(circuit1.clbits[0], 1)
circuit1.append(DiagonalGate([-1, -1]), [1]).c_if(circuit1.clbits[0], 1)
circuit1.save_statevector(label="equal")

result = backend.run([circuit, circuit0, circuit1], shots=1).result()
Expand Down
54 changes: 0 additions & 54 deletions test/terra/backends/aer_simulator/test_from_backend.py

This file was deleted.

Loading

0 comments on commit e3f68bd

Please sign in to comment.