Commit Graph

1597 Commits

Author SHA1 Message Date
derwind 4e10831f89
Fix how to reference to config.cuStateVec_enable (#1749)
* Fix how to reference to config.cuStateVec_enable

* Add a release note

* Update fix-cuStateVec_enable-0936f2269466e3be.yaml

---------

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-03-18 13:57:43 +00:00
derwind 92f8bd856d
Remove a release note in an invalid location (#1750)
Essentially equivalent content is already incorporated in #1739.
2023-03-18 11:51:25 +00:00
Luciano Bello 7b3ab2059a
deploy documentation in qiskit.org/ecosystem (#1748)
* deploy documentation in qiskit.org/ecosystem

* comment
2023-03-16 13:15:16 +00:00
Matthew Treinish 8f08f72273
Add git blame ignore file (#1745)
This commit adds a new file with the SHA1 of commits to ignore when
running git blame. This is important because of the recent adoption of
black and clang-format as our code formatting tool in #1630 we caused a
large amount of code churn to change the code formatting. However, using
the ignore file is a local opt-in feature for git and not something we
can enable globally by default. To facilitate this a section is added to
the bottom of the contributing guide to document how this file can be
used.
2023-03-14 00:17:15 +00:00
Hiroshi Horii 0366c51c0e
add code-formatting with black for python and with clang-format for c++ (#1630)
* add black and clang-format

* apply black and clang-format

* manually format codes that were not covered in black and clang-format

* add targets of clang-format and clean up tox.ini

* apply black with new configuration

* Update CONTRIBUTING.md

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

* Update .github/workflows/tests.yml

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

* reformat qiskit_aer, test, tools, and setup.py with length 100

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
2023-03-13 20:19:06 +00:00
Sam James 6f600adcf2
Remove redundant wheel dep from pyproject.toml (#1741)
Remove the redundant `wheel` dependency, as it is added by the backend automatically.

Listing it explicitly in the documentation was a historical mistake and has been fixed since,
see: [pypa/setuptools@f7d30a9](f7d30a9529).

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-03-10 12:14:03 +00:00
Matthew Treinish aebfb3eac4
Bump version string post release (#1740)
Now that qiskit-aer 0.12.0 is out the door we should bump the version
string on main to show that the version we're installing is newer
than what's been released. This commit opens development for 0.13.0
on the main branch.
2023-03-10 10:50:29 +00:00
Matthew Treinish 2377d2efb4
Prepare 0.12.0 release (#1739)
* Prepare 0.12.0 release

This commit prepares for the 0.12.0 release. It moves the release notes
to a self contained directory for the release and updates the wording
and details of the release notes. Once this commit merges it should be
the tagged commit for the release.

* Add aer density matrix release note

* Apply suggestions from code review

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

* Update releasenotes/notes/0.12/add-NoiseModel-from_backendproperties-1a3d6d976133a661.yaml

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

* Update releasenotes/notes/0.12/tensor_network_gpu-e8eb3e40be3c35f7.yaml

* Use full path for intersphinx refs

---------

Co-authored-by: Jake Lishman <jake@binhbar.com>
2023-03-09 20:11:29 +00:00
Hiroshi Horii 7ce492ea2b
Use qiskit_sphinx_theme for API doc (#1733)
* Update sphinx theme

* add sphinx.ext.intersphinx for links to qiskit api

* clean up requirements-dev.txt for docs

* reduce tabs from docs

* reduce gallery.css

* Update sphinx theme

* clean up docs conf

* modify docs conf

---------

Co-authored-by: Hitomi Takahashi <hitomi@jp.ibm.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-03-09 15:20:43 +00:00
Hitomi Takahashi dafe9a3572
add docs for density matrix (#1738)
Co-authored-by: Hiroshi Horii <horii@jp.ibm.com>
2023-03-09 13:23:16 +00:00
Hiroshi Horii 5e5f22cc63
Simulate `QuantumCircuit` without QObj (#1717)
With this commit, Aer simulates `QuantumCircuit` without converting it to QObj.
Previously, QObj is generated from `QuantumCircuit` objects in python, and then
C++ parses QObj to construct own circuit representation `AER::Circuit` for simulation.
Now, Aer binds this `AER::Circuit` with a python class `AerCircuit` and directly
generates from `QuantumCircuit` to `AerCircuit`. In addition, configuration for simulation
is changed from json to `AerConfig` that be bound to `AER::Config`.
This commit will improve performance of low-qubit simulation without any modification
of application codes.

* add AerCircuit and a path to run simulation without QObj
* Remove AerOp from AerCircuit
* fix lint errors
* revert qobj deprecation
* fix executor specification in AerBackend
* fix bugs in direct execution
* set final operation in AerCircuit
* fix lint errors
* use AerJob and add reno
* support directly-added qubits
* fix qobj execution
* fix qobj execution, contd.
* fix set state with a matrix
* inline malloc in matrix
* rename malloc_array in AER::Vector to resolve conflicts of signature
* rename methods to handle QuantumCircuit in AerBackend and deprecate AerJob.qobj()
* simplify AerCircuit
* avoid pickling of AerCircuit in assemble_circuits
* back _execute_circuits as abstract method
* introduce AER::Config to reduce JSON overheads for configuration
* fix a bug in get_value to load config
* enable AerConfig
* fix lint
* deprecate backend.run(validate=True) and clean codes in AerBackend
* add assertion in test_auto_method
* fix bugs in last commits
* correct test cases to test auto option
2023-03-09 01:21:15 +09:00
Matthew Treinish d3a05ba647
Add docs publishing job (#1589)
This commit adds a new CI job for publishing documentation on release.
Now that qiskit-aer is a self contained package with it's own namespace
the documentation build no longer needs to be combined into the main
qiskit docs anymore. As such this commit will enable aer ci to publish
built documentation for the project to:

https://qiskit.org/documentation/aer

on every release.

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
2023-03-08 10:28:55 +09:00
Toshinari Itoko f205ddfc51
Remove deprecated functions in noise module (#1624)
Remove deprecated functions in noise module, e.g. NoiseModel.add_nonlocal_quantum_error, support of json-like input for QuantumError and standard_gates argument in many standard_errors.
Note that NoiseModel.from_dict is NOT removed exceptionally until alternative methods for serialize/deserialize NoiseModel objects are provided.

* Remove deprecated functions related with NoiseModel
* Remove deprecated functions in QuantumError
* Remove deprecated functions in utils
* Remove deprecated errorutils
* Remove deprecated arguments of functions in standard_erros
* Update tests not to use deprecated functions
* Lint
* Add release note
* Fix a mistake in warnings
* Improve release note
* Fix typos
* Move imports to the top level
* Fix docs and lint

---------

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
2023-03-08 00:34:13 +09:00
derwind 897e51e7a6
Implement AerDensityMatrix (#1732)
Provides `AerDensityMatrix` that inherits `qiskit.quantum_info.states.DensityMatrix` with
Aer's kernel to calculate density matrix for a `QuantumCircuit`. 

* Implement AerDensityMatrix and its tests
* Add a release note
* Add 2023 to Copyright
* Update explanation for data
* Fix lint errors
* Fix a lint error
* Set different seed for each sampling in AerDensityMatrix
2023-03-01 01:59:41 +09:00
acastanedam 472d719f17
Fix for BLA_VENDOR when compiling from source (#1731)
This commit allows developers to build custom blas libtaries with BLA_VENDOR.
Previously, this BLA_VENDOR was always set to OpenBLAS and other blas
libraries were only set if OpenBLAS is not found. 

* fix conan version
* add reno and allow the latest 1.X of Conan
* fix_blas_vendor: set properly a specified BLAS type
* fix_blas_vendor: add release note
---------

Co-authored-by: Hiroshi Horii <horii@jp.ibm.com>
2023-02-27 11:25:02 +09:00
Hiroshi Horii 67407b1d3c
Add `initialize_density_matrix()` into `AerState` to set initial data of density matrix (#1616)
Adds `initialize_density_matrix()` that allows `AerState` to initialize its density matrix.
This new function is not public and will not affect any public interface of Aer.

Co-authored-by: Ikko Hamamura <ikkoham@users.noreply.github.com>
Co-authored-by: Jun Doi <doichan@jp.ibm.com>
Co-authored-by: derwind <uncertainty_principle_ss@yahoo.co.jp>
Co-authored-by: Jake Lishman <jake@binhbar.com>
2023-02-25 00:14:33 +09:00
Matthew Treinish 82eb26cab1
Deprecate PulseSimulator backend (#1728)
* Deprecate PulseSimulator backend

This commit deprecates the PulseSimulator backend for qiskit aer. For
the past several releases development on the pulse simulator has mostly
been frozen as the combined efforts for improving pulse level simulation
have been working on Qiskit Dynamics instead. This commit marks the
legacy PulseSimulator as deprecated and points existing users to Qiskit
Dynamics instead.

Closes #1722

* handle deprecation of pulse simulation in tests

---------

Co-authored-by: Hiroshi Horii <horii@jp.ibm.com>
Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
2023-02-24 13:28:22 +09:00
Hiroshi Horii c48b0a82c4
Pin the version of conan with 1.X to work around API changes in conan 2.0 (#1729)
Specify a version of conan to build Aer with 1.X.
This is a quick fix to work around an issue related to API changes in conan 2.0.

* fix conan version
* add reno and allow the latest 1.X of Conan
2023-02-24 08:18:54 +09:00
Ikko Hamamura ce9a860554
[perf] improve _convert_circuit_binds (#1726)
Improves performance to convert parameter structure for Aer's bindings.
Aer uses index-based parameter-bindings that specify position of value 
in gate array and parameter arrays. Qiskit uses a dict that associate 
`Parameter`s with values. That is, Aer converts the dict-based to Aer's bindings
while resolving `ParamterExpression` by setting specified values.
Previously, the logic of this conversion was not efficient to resolve 
`ParameterExpression` with redundant value specification. With this commit,
values are efficiently selected and performance to resolve `ParamterExpression`
is improved. Consequently, performance to simulate parameterized circuits will be 
improved.

* improve _convert_circuit_binds
* add error message
* add test
2023-02-21 20:22:11 +09:00
Ikko Hamamura c8e3f17834
Fix AerError in Estimator to warn (#1727)
Correct API break due to #1716 Add abelian_grouping to Estimator.
abelian_grouping an argument of the constructor of Estimator is ignored
if approximation an other argument of the constructor is True.

* AerError to warn
* warn to docstring
* rm warn
* add test
2023-02-21 14:59:00 +09:00
Ikko Hamamura 7b4bc1e359
Add abelian_grouping to Estimator (#1716)
Add support of abelian_grouping for Estimator.  
In default, Estimator groups the qubit-wise commutable observables to improve performance 
by reducing the number of circuits to be simulated.

* Add abelian_grouping option.
* refactor
* refactor
* ignore W503 in pycodestyle
* add reno
---------

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
2023-02-15 01:43:35 +09:00
Jun Doi f4b743ee3e
Optimization of stabilizer simulator (#1715)
Optimizes stabilizer simulator performance by changing data layout of its state.
Most of its data access become contiguous and CPU cache effectively work for it.
In addition, integer bit operations are refactored for performance.

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
2023-02-13 10:38:44 +09:00
Hiroshi Horii f22d61208b
support break_loop and continue_loop (#1719)
`AerSimulator` supports `break_loop` and `continue_loop` instructions when used
as backends for the Terra `qiskit.compiler.transpile` function.  The simulators already
did support these, but had just not been reporting it.

* support break_lopp and continue_loop
* add reno
* move break_loop and continue_loop from BASIS_GATES to _CUSTOM_INSTR
* Update releasenotes/notes/support_break_and_continue_gates-bf30316fcacd4b6b.yaml
* run break_loop and continue_loop instructions in test
---------
Co-authored-by: Jake Lishman <jake@binhbar.com>
2023-02-10 11:34:23 +09:00
Hiroshi Horii f4982e4f56
Support kraus operation in AerStatevector (#1662)
`AerStatevector` supports `kraus` gate that applies one of the Kraus operators is applied randomly
to the quantum state based on the error probabilities.

* use more gates for AerState to call state_controller
* take assertion for parameter checking to use IndexError and take debug codes
* add more tests for AerStatevector
* fix lint
* update aer_runtime to use cu that has four parameters
* update seed for multiple calls of sample_memory
* correct seed_simulator update in AerStatevector
* support kraus in AerStatevector
* add release note
* slightly simplify test_kraus for AerStatevector
* Fix a test
- The correct answers are made from an error-free circuit
- Take global phases into account
* fix test for AerStatevector
* Update releasenotes/notes/support_kraus-ec31e636c6793b8c.yaml

---------

Co-authored-by: derwind <uncertainty_principle_ss@yahoo.co.jp>
Co-authored-by: Jake Lishman <jake@binhbar.com>
2023-02-09 10:17:53 +09:00
merav-aharoni b9f35590c5
MPS: Changed the apply_measure algorithm (#1713)
Changed the apply_measure algorithm so that it does not move the qubits to the sorted positions before measuring. Instead, we measure the qubits in the order of the current MPS structure and then sort the measurement outcomes as a post-process. Beside fixing the issue, this is expected to improve performance and enable more accurate representation of entangled states. 

* Changed the apply_measure algorithm so that it does not move the qubits to the sorted order before measurement. Instead it sorts the measurement outcomes as a post-processing step.

* Update releasenotes/notes/mps_fix_apply_measure-84c29a728ae0e717.yaml

Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com>

* Update src/simulators/matrix_product_state/matrix_product_state_internal.cpp

Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com>

* Update src/simulators/matrix_product_state/matrix_product_state_internal.cpp

Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com>

* Added const to the new methods. Added comment to sort_qubits_by_ordering

* Added comments with examples

---------

Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com>
Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
2023-02-07 22:00:46 +09:00
Jun Doi 0955beeab4
Fix errors when disabling cuQuantum for GPU simulator (#1714) 2023-02-06 11:28:32 +09:00
Ikko Hamamura fe49f3ec1e
Remove deprecated methods and args in Primitives (#1711)
`BaseSampler` and `BaseEstimator` in terra deprecated circuits, observables and
parameters as arguments for their constructors. They will be reduced in the next
release of terra (0.24). Because it took three months since terra started warning of
deprecation for these arguments, Aer reduces them from their arguments before
terra's PR (Qiskit/qiskit-terra#9480) is released.

* Remove deprecated methods and args in Primitives
* add reno

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
2023-02-01 01:14:02 +09:00
Hiroshi Horii a93390cac9
add a work around for Aer installation issue in Neko (#1703) 2023-01-31 12:38:11 +00:00
Jun Doi 3e34a24bf9
Implement GPU tensor network simulator by using cuTensorNet (#1637)
* Implement tensor network simulator by using cuTensorNet

Implementing general tensor network simulator for GPU accelerated by
NVIDIA's cuTensoNet APIs of cuQuantum SDK. Any quantum circuits can
be translated into tensor network and can be simulated.
This method supports both statevector and density matrix simulations,
noise simulation can be done by single shot with density matrix
if there is no save_statevector operation.
This method supports parallelization by multiple GPUs and MPI processes
by using tensor network slicing technique.

* fix aer_simulator.py
* return values in TensorNetContractorDummy
* Fix for cuQuantum 22.11.0
* remove dependencieis to shot branching
* fix test cases, remove remaining shot-branching options
* add release note, fix available_methods to handle tensor_network
* fix available_methods
* spdlog version

---------

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
2023-01-30 11:57:34 +09:00
derwind 4297171078
Add release note (#1705)
Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
2023-01-27 13:07:12 +00:00
Jun Doi cec5c11513
Fix test_aer_statevector (#1710)
* fix test_aer_statevector

* add plot directive to docs

* fix test_aer_statevector and remove reno

Co-authored-by: Hiroshi Horii <horii@jp.ibm.com>
2023-01-27 09:55:59 +00:00
derwind 0b96118f99
Guarantee ndarray contiguity (#1685)
* Guarantee np.ndarray contiguity

* Add __init__.py to run tests for terra.states

based on the approval in #1673

* Guarantee np.ndarray contiguity if not

* Install matplotlib for plot_state_qsphere according to CI log

* Addressed pylint's point (W0621)

* Install seaborn for plot_state_qsphere according to CI log

* Fix typo: Install seaborn for plot_state_qsphere according to CI log

* Fix suppressions for Jupyter warnings

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
2023-01-24 06:45:16 +00:00
derwind 481f9a53b9
Add `__init__.py` to run tests for terra.states (#1673)
* Add __init__.py to run tests for terra.states

* Update tests to follow https://github.com/Qiskit/qiskit-terra/pull/8273

* Install matplotlib for plot_state_qsphere according to CI log

* Install seaborn for plot_state_qsphere according to CI log

* Fix suppressions for Jupyter warnings

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
2023-01-24 02:44:38 +00:00
Ryuhei Yoshida 979d42feea
Add NoiseModel.from_backend_properties (#1474)
* Add classmethod from_backend_properties for NoiseModel

* Add test for NoiseModel.from_backend_propeties

* Delete deperecated arguments form from_backend_properties

* Shorten the document for :func:`from_backend_properties`

* Add release note for `from_backendproperties`

* Delete unncessary warning

Co-authored-by: Toshinari Itoko <15028342+itoko@users.noreply.github.com>

* Delete unncessary warning

Co-authored-by: Toshinari Itoko <15028342+itoko@users.noreply.github.com>

* Add type annotation for the definitiion of dt.

* Delete unnecessary the `with` clouse

* Change :func: to :meth:

* Delete devices limitation on the docstring of from_backend_poroperties

Co-authored-by: Toshinari Itoko <15028342+itoko@users.noreply.github.com>

* Add the introduction of this new function at release note

* Correct the main document of from_backend_properties

* Add argument `dt` for `from_backend_properties`

The document is based
on https://qiskit.org/documentation/stubs/qiskit.providers.BackendV2.html#qiskit.providers.BackendV2.

* Correct docstring for Exception in `from_backend_properties`

* Add trucate_t2_value to get delay_pass in `from_backend_properties`

* format code

* change dt: float =0 to dt: Optional[float] = None

Co-authored-by: Toshinari Itoko <15028342+itoko@users.noreply.github.com>

* Change document of the dafulat value of dt to None.

Co-authored-by: Toshinari Itoko <15028342+itoko@users.noreply.github.com>

* Correct docstring to add the description of `dt`.

* Correct docstring to explicitly show the argument gate_lengths and dt is Optional.

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
Co-authored-by: Toshinari Itoko <15028342+itoko@users.noreply.github.com>
2023-01-19 09:54:10 +00:00
Jun Doi 08d3739b1d
Fix multi-shots batched execution on GPU (#1701)
Batched shots execution uses classical registers on GPU memory, and memory space for creg is reserved before allocating chunks. To reserve this, bits count for classical register should be set before allocation, but bits count was not set correctly. This caused infinite loop to find available memory on GPU.
This fix set bits count of classical register before the allocation for batched shots execution.

* Fix creg bits is not set before reserving memory on GPU

* added release note

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
2023-01-19 14:55:44 +09:00
Luciano Bello 6e2e68f518
Remove qobj argument, deprecated in 0.8.0 (#1635)
* Remove qobj argument, deprecated in 0.8.0

* reno

* Fix typos in release note

Co-authored-by: Jake Lishman <jake@binhbar.com>
Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
2023-01-19 03:05:45 +00:00
Kazuki Tsuoka 7085b9f47b
Remove deprecated module import (#1690)
Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
2023-01-18 23:42:45 +00:00
Ansah Mohammad 036e6ceb9f
Replace IBMQ with IBM Quantum in Aer documention. (#1691)
* replaced IBMQ with IBM Quantum fixing #1633

* replaced IBMQ with IBM Quantum fixing #1633

* Update aer_simulator.py

* Fixed IBM QUANTUM to IBM Quantum

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
2023-01-18 19:15:56 +00:00
Jake Lishman 697e4e10c2
Remove setup_requires and forced pip installs in setup.py (#1693)
* Remove setup_requires and forced pip installs in setup.py

Executing manual `pip install` commands from within `setup.py` is
somewhat frowned upon from a Python packaging perspective.  By far the
preferred mechanism now is to clearly state the build dependencies in a
non-code format (`pyproject.toml`), and let a PEP-517-compatible builder
handle virtual-environment isolation and dependency management.

We already had the dependencies declared statically, this commit just
removes the residual code in `setup.py`.

* Update CI build scripts

* Add missing build install

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
2023-01-19 02:23:01 +09:00
Matthew Treinish 4f959fd61d
Switch from relative to absolute imports in root qiskit_aer (#1696)
Previously the root of the qiskit_aer we were exporing certain modules
and objects using relative imports to do this. However, the qiskit
package sets up a metaimporter to redirect imports from
qiskit.providers.aer to qiskit_aer (for backwards compatibility with the
old aer name) the source package for these relative imports can get
confused on subsequent imports if something also uses the legacy name
(which qiskit itself does on it's optional imports to aer, so that it
supports >1 version). While all the code functions correctly in this
case Python emits a warning saying the package __spec__ doesn't match
anymore. The simplest way to address these warnings is to use an
absoulte import with the package name in it so there is no ambiguity in
the source package on imports.

This commit makes that change to the root of the pacakge which fixes the
warnings. The only thing I'm not sure of is if any other relative
imports elsewhere in the qiskit_aer package will have the same problem
or if this is fixed by just updating the root package. We might need to
do further testing to check.

Fixes #1692
2023-01-18 23:48:03 +09:00
Ikko Hamamura 707e14f8c9
Fix `Sampler` with multiple classical registers (#1680)
* fix #1679

* fix a test
2023-01-06 12:58:50 +00:00
Matthew Treinish 0f98dd476a
Fix BackendV2 support in AerSimulator.from_backend() (#1678)
* Fix BackendV2 support in AerSimulator.from_backend()

This commit fixes supported for insantiating a AerSimulator object with
the from_backend() method using a BackendV2 instance. Previously this
method pre-emptively raised an AerError as the code wasn't present to
correctly handle creating an AerSimulator instance using the backend.
This commit fixes this so this no longer errors and works as expected.

Fixes #1617

* Use assertDictAlmostEqual in v2 tests
2022-12-06 10:15:15 +09:00
Will Shanks ea41b11394
Specify package_data explicitly (#1677)
Currently, there are non-Python needed in the qiskit_aer package:
`VERSION.txt` and `instructions_table.csv`. These are included in the
wheel through the use of the `include_package_data=True` option to
`setup()`, but scikit-build, in a deviation from setuptools' behavior,
ends up including everything in `MANIFEST.in` when this option is used,
as reported
[here](https://github.com/scikit-build/scikit-build/issues/590). This
behavior results in many extraneous files being included in the wheel.
This PR works around this quirk by explicitly including the necessary
files with the `package_data` argument of `setup()` instead of using
`include_package_data`.

Closes #1457
2022-12-05 19:36:27 +00:00
Matthew Treinish ca8bd21869
Add ECR gate support to aer simulators (#1674)
* Add ECR gate support to aer simulators

This commit adds support for the ECR (echo cross resonance) gate as
described in [1] and [2] to aer. This is an entangling gate used on
some IBM backends and being able for aer to simulate is import to be
able to simulate those backends. Support for the gate is added to the
density matrix, statvector, super operator, and unitary simulators.

[1] https://arxiv.org/abs/2008.08571
[2] https://qiskit.org/documentation/stubs/qiskit.circuit.library.ECRGate.html

* Fix matrix definition

* Add tests

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
2022-12-02 21:26:38 +00:00
Matthew Treinish 5aeadd5f5e
Deprecate Python 3.7 support in Qiskit Aer (#1671)
* Deprecate Python 3.7 support in Qiskit Aer

This commit deprecates Python 3.7 support. During the deprecation window
we will continue to fully support Python 3.7 and test it in CI, but it will
emit a warning that we will be removing support for 3.7 in the future to
inform users to upgrade to Python 3.8 or newer. The removal will occur
during a future release at some point over the summer as the upstream
Python EoL date is in June 2023. [1]

[1] https://devguide.python.org/versions/

* Fix lint

* Move comment before if block
2022-12-02 17:08:52 +00:00
Hiroshi Horii a71f17f6b8
Set different seed for each sampling in AerStatevector (#1663)
* update seed for multiple calls of sample_memory

* correct seed_simulator update in AerStatevector

* set seed in AerState explicitly and reuse AerState in AerStatevector for sampling

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-12-02 15:34:46 +00:00
Toshinari Itoko 58b86e1b8f
Fix incorrect computation of excited state population (#1672)
This commits fixed a bug in NoiseModel.from_backend where using the temperature kwarg with
a non-default value would incorrectly compute the excited state population for the specified temperature.
Previously, there was an additional factor of 2 in the Boltzman distribution calculation leading to
an incorrect smaller value for the excited state population.

* Fix a bug in computation of excited population
* Improve reno
* Reword reno
2022-12-02 12:24:23 +09:00
Hiroshi Horii bce31507b9
Use more gates for AerState to call state_controller (#1643)
`AerStatevector` wrongly assumed that methods of `AerState` support `mc*` instructions.
With this commit, `AerStatevector` use basic gates supported in specified method.

* use more gates for AerState to call state_controller
* take assertion for parameter checking to use IndexError and take debug codes
* add more tests for AerStatevector
* fix lint
* update aer_runtime to use cu that has four parameters
2022-11-30 15:40:59 +09:00
Toshinari Itoko eab7d8904c
Fix device noise model from BackendV2 not to have excessive quantum errors on measures/resets (#1649)
* Fix devide noise model from target

* Add release note

* Upgrade device noise models not to have errors on resets

* Revert the previous upgrade and fix the bug so that the behevior is the same as for backend v1
2022-11-30 02:40:43 +00:00
derwind e2bdd76f06
Support for initialization from Statevector (#1644)
This commit allows construct of `AerStatevector` directly from Terra's `Statevector`.

* Support for initialization from Statevector
* Add release note
* Initialize with AerStatevector prior to Statevector
* add a test to initialize with AerStatevector

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
2022-11-29 23:58:24 +09:00