2019-04-30 02:56:51 +08:00
|
|
|
# This code is part of Qiskit.
|
|
|
|
#
|
2019-05-01 04:25:19 +08:00
|
|
|
# (C) Copyright IBM 2018, 2019.
|
2019-04-30 02:56:51 +08:00
|
|
|
#
|
|
|
|
# This code is licensed under the Apache License, Version 2.0. You may
|
|
|
|
# obtain a copy of this license in the LICENSE.txt file in the root directory
|
|
|
|
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
|
2018-10-24 02:20:22 +08:00
|
|
|
#
|
2019-04-30 02:56:51 +08:00
|
|
|
# Any modifications or derivative works of this code must retain this
|
|
|
|
# copyright notice, and modified files need to carry a notice indicating
|
|
|
|
# that they have been altered from the originals.
|
2018-10-24 02:20:22 +08:00
|
|
|
|
2019-11-13 03:25:35 +08:00
|
|
|
"""
|
|
|
|
==========================================
|
2022-08-31 09:33:59 +08:00
|
|
|
Aer Provider (:mod:`qiskit_aer`)
|
2019-11-13 03:25:35 +08:00
|
|
|
==========================================
|
|
|
|
|
2022-08-31 09:33:59 +08:00
|
|
|
.. currentmodule:: qiskit_aer
|
2019-11-13 03:25:35 +08:00
|
|
|
|
|
|
|
Simulator Provider
|
|
|
|
==================
|
|
|
|
|
|
|
|
.. autosummary::
|
|
|
|
:toctree: ../stubs/
|
|
|
|
|
|
|
|
AerProvider
|
|
|
|
|
|
|
|
Simulator Backends
|
|
|
|
==================
|
|
|
|
|
2021-04-01 02:16:44 +08:00
|
|
|
.. autosummary::
|
|
|
|
:toctree: ../stubs/
|
|
|
|
|
|
|
|
AerSimulator
|
|
|
|
|
|
|
|
Legacy Simulator Backends
|
|
|
|
=========================
|
|
|
|
|
2019-11-13 03:25:35 +08:00
|
|
|
.. autosummary::
|
|
|
|
:toctree: ../stubs/
|
|
|
|
|
|
|
|
QasmSimulator
|
|
|
|
StatevectorSimulator
|
|
|
|
UnitarySimulator
|
|
|
|
|
|
|
|
Exceptions
|
|
|
|
==========
|
|
|
|
.. autosummary::
|
|
|
|
:toctree: ../stubs/
|
|
|
|
|
|
|
|
AerError
|
|
|
|
"""
|
2019-06-06 22:13:55 +08:00
|
|
|
|
2022-12-03 01:08:52 +08:00
|
|
|
import platform
|
|
|
|
import sys
|
|
|
|
import warnings
|
|
|
|
|
|
|
|
|
2019-02-16 03:45:07 +08:00
|
|
|
# https://github.com/Qiskit/qiskit-aer/issues/1
|
|
|
|
# Because of this issue, we need to make sure that Numpy's OpenMP library is initialized
|
|
|
|
# before loading our simulators, so we force it using this ugly trick
|
|
|
|
if platform.system() == "Darwin":
|
|
|
|
import numpy as np
|
2023-03-14 04:19:06 +08:00
|
|
|
|
2019-02-16 03:45:07 +08:00
|
|
|
np.dot(np.zeros(100), np.zeros(100))
|
|
|
|
# ... ¯\_(ツ)_/¯
|
|
|
|
|
2019-06-06 22:13:55 +08:00
|
|
|
# pylint: disable=wrong-import-position
|
2023-01-18 22:48:03 +08:00
|
|
|
from qiskit_aer.aerprovider import AerProvider
|
2024-08-20 22:31:34 +08:00
|
|
|
from qiskit_aer.jobs import AerJob
|
2023-01-18 22:48:03 +08:00
|
|
|
from qiskit_aer.aererror import AerError
|
|
|
|
from qiskit_aer.backends import *
|
|
|
|
from qiskit_aer import library
|
|
|
|
from qiskit_aer import quantum_info
|
|
|
|
from qiskit_aer import noise
|
|
|
|
from qiskit_aer import utils
|
|
|
|
from qiskit_aer.version import __version__
|
2018-10-24 02:20:22 +08:00
|
|
|
|
2022-12-03 01:08:52 +08:00
|
|
|
if sys.version_info < (3, 8):
|
|
|
|
warnings.warn(
|
2023-10-26 10:20:27 +08:00
|
|
|
"Using Aer with Python 3.7 is deprecated as of the 0.12.0 release. "
|
|
|
|
"Support for running Aer with Python 3.7 will be removed in a future "
|
2022-12-03 01:08:52 +08:00
|
|
|
"release",
|
|
|
|
DeprecationWarning,
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2018-10-24 02:20:22 +08:00
|
|
|
# Global instance to be used as the entry point for convenience.
|
|
|
|
Aer = AerProvider() # pylint: disable=invalid-name
|