Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.13.0 #1953

Closed
wants to merge 1,158 commits into from
Closed

Release 0.13.0 #1953

wants to merge 1,158 commits into from

Conversation

doichanj
Copy link
Collaborator

@doichanj doichanj commented Oct 6, 2023

Summary

Preparation PR for Aer 0.13.0

Details and comments

Required PRs merged for release 0.13.0 are

hhorii and others added 30 commits February 8, 2022 14:33
Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
* Only install numpy and scipy from wheels in build jobs

With recent changes to the upstream numpy and scipy packaging our CI
build jobs are spending most of their time build numpy and/or scipy from
source to test the built wheels function correctly. This is unecessary
as there are compatible wheels available on pypi. To correct this issue
this commit updates the cibuildwheel config used in the wheel build jobs
(both for ci and release artifacts) to only use binary wheels for numpy
and scipy before testing.

* Use manylinux 2014 for py310 wheel builds

In the previous commit we switched to the test configuration to install
numpy and scipy only from binary pre-compiled wheel packages. However,
for scipy and numpy starting in Python 3.10 they only package for
manylinux2014 while for aer we were still using manylinux2010 for all
the builds. To enable building on python 3.10 we need to use
manylinux2014, but for compatibility we still need to use manylinux2010.
This commit makes this change so for python 3.6-3.9 we build on
manylinux2010 and for python 3.10 we build on manylinux 2014.

To facilitate this change the configuration for cibuildwheel is changed
to leverage the pyproject.toml to set the configuration for cibuildwheel
instead of using separate environment variables. This centralizes the
configuration and makes it easier to work with.

* Bump cibuildwheel version

The pyproject.toml based configuration didn't support overrides (which
was leveraged in the previous commit to use a different image for py310)
until v2.2.0 and we were previously using a version older than that.
This commit bumps the cibuildwheel version to the 2.2.x release to
enable the use of this option.

* Use manylinux2010 for all i686 builds

The i686 py310 job was failing because centos7 (which manylinux2014 is
based off of) doesn't have openblas packaged for i686. We orignally
switched both the x86_64 and i686 py310 jobs to use manylinux2014
because numpy and scipy made python 3.10 manylinux2014 and only publish
manylinux2014 wheels. However, numpy/scipy don't support i686 on py310
and we already skip test installs for py310. So regardless we have to
build numpy from source to build aer. So using manylinux2010 which is
centos6 based will enable us to at least build because there is an
openblas package available.
* stop installing stop installing qiskit-terra from source

This changes installation of qiskit-terra in tox.
Recent commit of Qiskit#1448 changed installation of qiskit-terra to use pypi in most CI workflow, but not tox.

* reduce explicit installation of qiskit-terra in tox.ini

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
* Drop support for Python 3.6

Now that Qiskit Aer 0.10.0 has been released that Qiskit no longer
supports python 3.6 (in the lead up to adding support for python 3.10).
This commit officially drops the support for python 3.6 and makes python
3.7 required to install qiskit-aer. It also removes all the ci jobs
still using 3.6 both for testing and building wheels.

* Add release note

* Fix syntax error in job configuration

* Update releasenotes/notes/drop-python36-61553302523fa240.yaml

Co-authored-by: Jake Lishman <jake@binhbar.com>

* Unify cibuildwheel configuration to pyproject.toml

This commit removes all the environment variable usage for default
configuration of cibuildwheel and switches to use the pyproject.toml to
centralize the configuration for all the jobs. Environment variables are
still used for per job custom overrides which don't really fit in the
configuration of the pyproject.toml (mainly cross-build overrides and
GPU configuration).

* Fix toml inline table syntax error

* Add musllinux wheels to skip list too

Newer versions of cibuildwheel support building musllinux wheels for
musl libc based linux distros, such as alpine linux, in addition to
manylinux wheels (which are not compatible with musl libc based
linux distros and only work with glibc distros). The musllinux build
environments are different and not centos based so builds fail in them.
Since we're not supporting musl platforms in qiskit-aer we don't need to
attempt to build wheels for that platform. This commit adds musllinux
builds to the skip list in the common cibuildwheel configuration
accordingly.

Co-authored-by: Jake Lishman <jake@binhbar.com>
Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
* Add cuStateVec support

Added support for cuQuantum, NVIDIA's APIs for quantum computing,
to accelerate statevector, density matrix and unitary simulators by using GPUs.

To include cuQuantum, custom build of Aer is necessary by setting path of
cuQuantum library to CUSTATEVEC_ROOT (Binary distribution will be after
official release of cuQuantum, which is now Beta 2 (0.1.0).

cuStateVector of cuQuantum is enabled by setting device='GPU' and 
cuStateVec_threshold options. cuStateVec is enabled when number of
qubits of input circuit is equal or greater than cuStateVec_threshold.

Since cuQuantum is beta version, there are some limitations:
- cuStateVec is not thread safe, multi-chunk parallelization (cache blocking) is done by single thread (slow)
- Multi-shots parallelization is disabled (single thread, slow)
- Multi-shots batched optimization is not support for cuStateVec

Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>
Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
The constraint on `jupyter_sphinx` was originally added when Python 3.8
had only just come out, because at the time there were no wheels
available for it on Windows, or they were broken.  That is no longer the
case, so now all this constraint was doing was preventing a successful
documentation build on anything other than Python 3.7.

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
This flag enables several unsafe floating-point transformations that are
not generally appropriate for a distributed mathematical library.  Most
importantly, however, `-ffast-math` on `gcc` also forcibly enables the
floating-point "flush to zero" mode for subnormal numbers when the
dynamic library is loaded, which affects not just Qiskit Aer, but every
other floating-point operation in the running process.  This is not our
decision to make for users, and it shouldn't be distributed.
The aer gpu package wheel job for python 3.10 builds in the manylinux2014
container image, while for the older Python versions it uses the
manylinux2010 image. The manylinux2014 image is based on Centos 7 while
the manylinux2010 image is based on Centos 6. During the qiskit-aer
0.10.3 release the gpu wheel job failed because when running the py3.10
build we installed the cuda package for centos 6 in the manylinux2014
centos 7 based image. This caused the job to fail when nvcc was called
because it was not installed properly. To fix this issue the Python 3.10
build is split out into a separate job. This separate job will install
the same cuda version but for centos 7 which is appropriate for the
manylinux2014 image.
…iskit#1446)

* Use unitary equivalence instead of circuit equality in noise tests

Recent qiskit-terra reduces I gates and some tests of Aer failed in equality checks of QuantumCircuit injected as noise.
This PR change a way of equality check from object equality to unitary equivalence of QuantumCircuit.

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: Hiroshi Horii <horii@jp.ibm.com>
Aer has not used Cython at all since late 2020 (see Qiskit#1014), and there
were still a few minor comment references to it in the code.  This also
removes two CMake files that were used during the Cython build process,
but are no longer needed, except for a trivial variable that was only
used in `FindPybind11.cmake`, and is now calculated there.

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
Until 0.8.2,Qiskit-Aer sets options for fusion depending on a method, such as statevector and density_matrix.
However, since AerSimulator introduced in 0.9.0, their default values were fixed for all the methods.
Because density matrix and unitary methods use 2^n times larger memory than statevector does,
performance regressions were happened since 0.9.0.

This commit sets default values for fusion fusion_max_qubit and fusion_threshold based on a method as follows:

    +--------------------------+----------------------+----------------------+
    | Method                   | ``fusion_max_qubit`` | ``fusion_threshold`` |
    +==========================+======================+======================+
    | ``statevector``          | 5                    | 14                   |
    +--------------------------+----------------------+----------------------+
    | ``density_matrix``       | 2                    | 7                    |
    +--------------------------+----------------------+----------------------+
    | ``unitary``              | 5                    | 7                    |
    +--------------------------+----------------------+----------------------+
    | ``superop``              | 2                    | 7                    |
    +--------------------------+----------------------+----------------------+
    | other methods            | 5                    | 14                   |
    +--------------------------+----------------------+----------------------+

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
…#1467)

* Change not to fail to run noisy simulation with T2 > 2 * T1

Previously NoiseModel.from_backend failed when T2 value is greater than 2 * T1,
however, sometimes backend returns such T2 value. 
This change truncates T2 value up to 2 * T1 with issuing a user warning. 

Co-authored-by: Hiroshi Horii <horii@jp.ibm.com>
* Enable multi-chunk parallelization in MPI environment

Previously multi-chunk parallelization was not enabled in MPI environment.
Therefore, shots were not simulated in parallel with multi-GPUs in distributed nodes.
With this change, multiple-GPUs can perform multi-shots simulation in parallel
and then provide performance improvement for noise and intermediate-measurement
simulation in distributed environment.
…#1480)

* Enable cacheblocking of superop operations and fix a bug in measurement with multi-chunks

Previously, superop was not recognized in transplation of cacheblocking and then it was not correctly handled in
multi-gpu environment and hybrid environment with gpu and cpu.
This change enhance cacheblocking for superop and then make density matrix simulation with GPU(s) correctly.
In addition, a measurement issue with cacheblocking was also fixed.
The 3.1 release of Jinja breaks some part of the Sphinx/nbsphinx
pipeline, causing tutorial jobs to fail.  The jinja2 developers consider
this a Sphinx bug, so we need to pin Jinja until a new version of Sphinx
or the nbsphinx extension is released to fix the issue.
* Fix for specification change of cuStateVec APIs

cuQuantum 0.40 changed cuStateVec APIs and this commit is to catch up this change.
Aer supports only APIs of the latest cuQuantum and does not previous versions.
In addition, since memory pool is introduced for cuStateVec, this change enables this function.
Memory pool provides performance for low-qubit simulation.

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
* Improve performance of batched noise simulation based on probabilistic mixture of paulis

This improves performance of noise simulation on GPU(s) for small qubits with statevector method
and noise based on probabilistic mixture of paulis. Before such noise simulation, Aer batched
some shots as a unit of work in GPUs. For each shot, noise model injects some pauli gates.
Previously, this sampling was performed by a single thread and this change parallelize the sampling.

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
* Add a size of required memory in an error message

Previously there is no way to know required memory to simulate a circuit when simulation fails
due to shortage of memory. This change adds required memory and available max memory in
a message of error state.
The to_json() method  is called for each circuit header.
A header may include metadata and metadata can be a python object.
This PR changes serialization of circuit headers to use py::handle without serializing to a json.

Fixes Qiskit#1435


* use python parser for circuit.header

* support metadata copy with parameterization

* avoid serialization of circuit metadata

* use circuit_index to specify metadata

* remove metadata from qobj for Aer to simulate circuits

* add release note

* clear circuite metadata correctly.

* take unnecessary tests for circuit metadata backup/recovery

* work around metadata serialization issue within _run method

* Update releasenotes/notes/remove_circuit_metadata_from_qobj-324e7ea9b369ee67.yaml
Starting with the recently released qiskit-terra 0.20.0 qiskit only
builds packages on manylinux2014 now. This commit update the wheel jobs
for Aer to install the rust compiler and build terra from source when CI uses 
manylinux2010 for i686 builds.
In manylinux2014 for i686, binary of OpenBLAS is not available and its installation
from source codes is necessary. Installation of rust compiler and terra is a
lot less effort than compiling OpenBLAS.
See the details in Qiskit#1498.

* Thread control for Thrust CPU is now same as device=CPU

This commit also includes Qiskit#1497, which fix performance issue in device=Thrust.
A cause of this issue is that Thrust CPU always applied OpenMP for threading
kernel programs without referring to the number of qubits.
This fix applies OpenMP referring to statevector_parallel_threshold parameter
as same as device=CPU.
See the details in Qiskit#1497.

Co-authored-by: Jun Doi <doichan@jp.ibm.com>
The BaseBackend class in qiskit-terra (along with the rest of the legacy
provider interface) is deprecated and being removed soon in
Qiskit/qiskit#7886. To avoid potential compatibility issues or
deprecation warnings we shouldn't be using this class anymore. This
commit removes the last 2 uses of these legacy classes to avoid issues
moving forward.

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
BaseContainer::stream_ is of type cudaStream_t (opaque pointer), cannot be used as an array.
This commit fixes this issue. See the detail in Qiskit#1502.
Currently NoiseModel.from_dict() does not support pauli gate though some backends
returns noise models with it. Therefore, if a returned NoiseModel was transformed to dict with
NoiseModel.to_dict(), from_dict() may fail. This commit fixes this issues by supporting
pauli gate in from_dict(). See the detail in Qiskit#1505 and
Qiskit#1510.
…kit#1508)

* fix a bug in multiplexer

* add multiplexer tests

* make unitary op if multiplexer does not have control qubits
* Addressing default branch naming change

* Update CODE_OF_CONDUCT.md

Updating Code of conduct to match original format

* Correcting qiskit project default branch naming
…ed on the seed of the first circuit (Qiskit#1512)

Currently, a circuit is copied for each parameter set, including seed_simulator
(if seed_simulator is specified as a run option, different seeds are set to circuits). 
Also, if backend.run() simulates multiple circuits without seed_simulator, a seed of 
each circuit is randomly generated and make users to reproduce simulation difficult.
This PR sets seeds deterministically based on the seed of the first circuit in
multi-circuit simulation. 

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
@doichanj
Copy link
Collaborator Author

I fixed wheel-build and wheel-arm64-macos only use shared publisher

doichanj and others added 4 commits October 19, 2023 20:40
* add tests for unreleased Qiskit

* Update .github/workflows/tests.yml

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Scheduled test for latest Qiskit

* run latest Qiskit test at push

* fix test

* fix qiskit test again

* fix test case for runtime parameter binding

* remove on push/pull request from latest Qiskit unit test

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
@woodsp-ibm
Copy link
Member

I note in the requirements it says qiskit-terra >= 0.21

requirements = [
    "qiskit-terra>=0.21.0",
    "numpy>=1.16.3",
    "scipy>=1.0",
]

Is this something that should be changed - elsewhere, with the change over to qiskit that has been used now by many dependents e.g

qiskit>=0.44

which I think is the earliest version that had the change done.

@doichanj
Copy link
Collaborator Author

I would like to rename test/terra in qiskit-aer 0.14.0

setup.py Outdated
@@ -22,7 +22,7 @@
extras_requirements = {"dask": ["dask", "distributed"]}

requirements = [
"qiskit-terra>=0.21.0",
"qiskit>=0.25.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should either be qiskit-terra>=0.25.0 or qiskit>=0.44.0

doichanj and others added 3 commits October 24, 2023 23:50
* Support backendv2

* Change API of aerbackend init

* fix lint

* Fix lint

* Add reset gate

* Return None if the configuration does not have max_experiments

* Change function to constant

* Update code to pass the test

* Remove print

* Fix lint

* Change num of qubits in Estimator

* Skip transpilation

* Change transpile optimization level

* Add release notes

* Change process of cirucit compose by the number of qubits in estimator

* use passmanager for measurement circuits

* refactor (change line order)

* Fix lint

* Add a detail description to the release note

---------

Co-authored-by: ikkoham <ikkoham@users.noreply.github.com>
Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
Co-authored-by: Jun Doi <doichan@jp.ibm.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
@doichanj doichanj added this to the Aer 0.13.0 milestone Oct 26, 2023
1ucian0 and others added 2 commits October 26, 2023 02:20
@doichanj doichanj requested a review from hhorii October 26, 2023 02:22
Copy link
Collaborator

@hhorii hhorii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@doichanj doichanj mentioned this pull request Oct 26, 2023
@doichanj
Copy link
Collaborator Author

I'm sorry but I broke this PR so I opened new PR #1964 for release 0.13.0

@doichanj doichanj closed this Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.