mirror of https://github.com/Qiskit/qiskit-aer.git
Move Aer to its own package (#1526)
Namespace packages are constant source of problems for users. The python packaging ecosystem around splitting packages across namespaces is fragile at the best of times and can often leave a you with an environment that isn't recoverable (especially when mixing install methods). There is also a performance hit whenever there is a piece of the namespace we allow external packages to extend since it requires doing a full python path search which can be slow depending on the backing I/O and the number of paths in sys.path for an environment. This commit addresses the piece from the aer perspective by moving qiskit.providers.aer to it's own package and namespace 'qiskit_aer'. Co-authored-by: Hiroshi Horii <horii@jp.ibm.com>
This commit is contained in:
parent
788e2c31c8
commit
13937fdb59
|
@ -14,3 +14,4 @@ jobs:
|
|||
- uses: Qiskit/qiskit-neko@main
|
||||
with:
|
||||
test_selection: backend
|
||||
repo_install_command: pip install -e .
|
||||
|
|
|
@ -37,8 +37,8 @@ jobs:
|
|||
- name: Run Lint
|
||||
run: |
|
||||
set -e
|
||||
pycodestyle --ignore=E402,W504 --max-line-length=100 qiskit/providers/aer
|
||||
pylint -j 2 -rn qiskit/providers/aer
|
||||
pycodestyle --ignore=E402,W504 --max-line-length=100 qiskit_aer
|
||||
pylint -j 2 -rn qiskit_aer
|
||||
sdist:
|
||||
runs-on: ${{ matrix.platform.os }}
|
||||
needs: ["lint"]
|
||||
|
@ -116,11 +116,13 @@ jobs:
|
|||
sudo apt-get install -y libopenblas-dev
|
||||
shell: bash
|
||||
- name: Install Aer
|
||||
run: python -m pip install -U .
|
||||
run: |
|
||||
python -m pip install -U .
|
||||
- name: Run Tests
|
||||
run: |
|
||||
set -e
|
||||
pip check
|
||||
rm -rf qiskit_aer
|
||||
stestr run --slowest
|
||||
shell: bash
|
||||
tests-json-input:
|
||||
|
@ -166,6 +168,7 @@ jobs:
|
|||
run: |
|
||||
set -e
|
||||
pip check
|
||||
rm -rf qiskit_aer
|
||||
stestr run --slowest
|
||||
shell: bash
|
||||
tests_macos:
|
||||
|
@ -204,6 +207,7 @@ jobs:
|
|||
run: |
|
||||
set -e
|
||||
pip check
|
||||
rm -rf qiskit_aer
|
||||
stestr run --slowest
|
||||
shell: bash
|
||||
tests_windows:
|
||||
|
@ -250,5 +254,6 @@ jobs:
|
|||
set -e
|
||||
chcp.com 65001
|
||||
pip check
|
||||
rm -rf qiskit_aer
|
||||
stestr run --slowest
|
||||
shell: bash
|
||||
|
|
|
@ -18,7 +18,7 @@ rhs*_op.pyx
|
|||
*.whl
|
||||
*.egg*
|
||||
build/*
|
||||
qiskit/providers/aer/backends/libomp.dylib
|
||||
*libomp.dylib
|
||||
|
||||
# Ignore macOS DS_Store
|
||||
.DS_Store
|
||||
|
|
|
@ -296,7 +296,7 @@ ignore-mixin-members=yes
|
|||
# (useful for modules/projects where namespaces are manipulated during runtime
|
||||
# and thus existing member attributes cannot be deduced by static analysis. It
|
||||
# supports qualified module names, as well as Unix pattern matching.
|
||||
ignored-modules=matplotlib.cm,numpy.random
|
||||
ignored-modules=matplotlib.cm,numpy.random,qiskit.providers
|
||||
|
||||
# List of class names for which member attributes should not be checked (useful
|
||||
# for classes with dynamically set attributes). This supports the use of
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# be linked statically per Apple's indications.
|
||||
|
||||
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
|
||||
file(STRINGS "qiskit/providers/aer/VERSION.txt" VERSION_NUM)
|
||||
file(STRINGS "qiskit_aer/VERSION.txt" VERSION_NUM)
|
||||
|
||||
include(CheckLanguage)
|
||||
project(qasm_simulator VERSION ${VERSION_NUM} LANGUAGES CXX C)
|
||||
|
@ -327,7 +327,7 @@ set(AER_LIBRARIES
|
|||
set(AER_COMPILER_DEFINITIONS ${AER_COMPILER_DEFINITIONS} ${CONAN_DEFINES})
|
||||
if(SKBUILD) # Terra Addon build
|
||||
set(AER_LIBRARIES ${AER_LIBRARIES} AER_DEPENDENCY_PKG::muparserx)
|
||||
add_subdirectory(qiskit/providers/aer/backends/wrappers)
|
||||
add_subdirectory(qiskit_aer/backends/wrappers)
|
||||
add_subdirectory(src/open_pulse)
|
||||
else() # Standalone build
|
||||
|
||||
|
|
16
MANIFEST.in
16
MANIFEST.in
|
@ -1,18 +1,14 @@
|
|||
include MANIFEST.in
|
||||
include README.md
|
||||
include pyproject.toml
|
||||
recursive-include qiskit *pyx
|
||||
recursive-include qiskit *pxd
|
||||
recursive-include qiskit *.pxi
|
||||
recursive-include qiskit *cpp
|
||||
recursive-include qiskit *hpp
|
||||
recursive-include qiskit_aer *cpp
|
||||
recursive-include qiskit_aer *hpp
|
||||
graft src
|
||||
graft contrib
|
||||
include qiskit/providers/aer/backends/wrappers/CMakeLists.txt
|
||||
include qiskit/providers/aer/backends/wrappers/bindings.cc
|
||||
include qiskit/providers/aer/pulse/qutip_extra_lite/cy/CMakeLists.txt
|
||||
include qiskit/providers/aer/VERSION.txt
|
||||
include qiskit/providers/aer/library/instructions_table.csv
|
||||
include qiskit_aer/backends/wrappers/CMakeLists.txt
|
||||
include qiskit_aer/backends/wrappers/bindings.cc
|
||||
include qiskit_aer/VERSION.txt
|
||||
include qiskit_aer/library/instructions_table.csv
|
||||
include CMakeLists.txt
|
||||
include cmake/*.cmake
|
||||
# Exclude static libraries (they are all compressed with 7z)
|
||||
|
|
|
@ -48,7 +48,7 @@ $ python
|
|||
```python
|
||||
import qiskit
|
||||
from qiskit import IBMQ
|
||||
from qiskit.providers.aer import AerSimulator
|
||||
from qiskit_aer import AerSimulator
|
||||
|
||||
# Generate 3-qubit GHZ state
|
||||
circ = qiskit.QuantumCircuit(3)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.. _aer-circuit-extensions:
|
||||
|
||||
.. automodule:: qiskit.providers.aer.extensions
|
||||
.. automodule:: qiskit_aer.extensions
|
||||
:no-members:
|
||||
:no-inherited-members:
|
||||
:no-special-members:
|
||||
:no-special-members:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.. _aer-jobs:
|
||||
|
||||
.. automodule:: qiskit.providers.aer.jobs
|
||||
.. automodule:: qiskit_aer.jobs
|
||||
:no-members:
|
||||
:no-inherited-members:
|
||||
:no-special-members:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.. _aer-library:
|
||||
|
||||
.. automodule:: qiskit.providers.aer.library
|
||||
.. automodule:: qiskit_aer.library
|
||||
:no-members:
|
||||
:no-inherited-members:
|
||||
:no-special-members:
|
||||
:no-special-members:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.. _aer-noise:
|
||||
|
||||
.. automodule:: qiskit.providers.aer.noise
|
||||
.. automodule:: qiskit_aer.noise
|
||||
:no-members:
|
||||
:no-inherited-members:
|
||||
:no-special-members:
|
||||
:no-special-members:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.. _aer-provider:
|
||||
|
||||
.. automodule:: qiskit.providers.aer
|
||||
.. automodule:: qiskit_aer
|
||||
:no-members:
|
||||
:no-inherited-members:
|
||||
:no-special-members:
|
||||
:no-special-members:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.. _aer-pulse:
|
||||
|
||||
.. automodule:: qiskit.providers.aer.pulse
|
||||
.. automodule:: qiskit_aer.pulse
|
||||
:no-members:
|
||||
:no-inherited-members:
|
||||
:no-special-members:
|
||||
:no-special-members:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.. _aer-utils:
|
||||
|
||||
.. automodule:: qiskit.providers.aer.utils
|
||||
.. automodule:: qiskit_aer.utils
|
||||
:no-members:
|
||||
:no-inherited-members:
|
||||
:no-special-members:
|
||||
:no-special-members:
|
||||
|
|
|
@ -43,7 +43,7 @@ Example: Threadpool execution
|
|||
|
||||
import qiskit
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from qiskit.providers.aer import AerSimulator
|
||||
from qiskit_aer import AerSimulator
|
||||
from math import pi
|
||||
|
||||
# Generate circuit
|
||||
|
@ -78,7 +78,7 @@ guard it by an ``if __name__ == "__main__":`` block.
|
|||
.. code-block:: python
|
||||
|
||||
import qiskit
|
||||
from qiskit.providers.aer import AerSimulator
|
||||
from qiskit_aer import AerSimulator
|
||||
from dask.distributed import LocalCluster, Client
|
||||
from math import pi
|
||||
def q_exec():
|
||||
|
|
|
@ -123,7 +123,7 @@ add_module_names = False
|
|||
# (e.g., if this is set to ['foo.'], then foo.bar is shown under B, not F).
|
||||
# This can be handy if you document a project that consists of a single
|
||||
# package. Works only for the HTML builder currently.
|
||||
modindex_common_prefix = ['qiskit.providers']
|
||||
modindex_common_prefix = ['qiskit_aer']
|
||||
|
||||
# -- Configuration for extlinks extension ------------------------------------
|
||||
# Refer to https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
|
||||
"""
|
||||
==========================================
|
||||
Aer Provider (:mod:`qiskit.providers.aer`)
|
||||
Aer Provider (:mod:`qiskit_aer`)
|
||||
==========================================
|
||||
|
||||
.. currentmodule:: qiskit.providers.aer
|
||||
.. currentmodule:: qiskit_aer
|
||||
|
||||
Simulator Provider
|
||||
==================
|
|
@ -70,7 +70,7 @@ class AerSimulator(AerBackend):
|
|||
|
||||
The final state of the simulator can be saved to the returned
|
||||
``Result`` object by appending the
|
||||
:func:`~qiskit.providers.aer.library.save_state` instruction to a
|
||||
:func:`~qiskit_aer.library.save_state` instruction to a
|
||||
quantum circuit. The format of the final state will depend on the
|
||||
simulation method used. Additional simulation data may also be saved
|
||||
using the other save instructions in :mod:`qiskit.provider.aer.library`.
|
||||
|
@ -296,7 +296,7 @@ class AerSimulator(AerBackend):
|
|||
|
||||
* ``stabilizer_max_snapshot_probabilities`` (int): set the maximum
|
||||
qubit number for the
|
||||
`~qiskit.providers.aer.extensions.SnapshotProbabilities`
|
||||
`~qiskit_aer.extensions.SnapshotProbabilities`
|
||||
instruction (Default: 32).
|
||||
|
||||
These backend options only apply when using the ``"extended_stabilizer"``
|
|
@ -59,18 +59,18 @@ class PulseSimulator(AerBackend):
|
|||
|
||||
The ``PulseSimulator`` simulates continuous time Hamiltonian dynamics of a quantum system,
|
||||
with controls specified by pulse :class:`~qiskit.Schedule` objects, and the model of the
|
||||
physical system specified by :class:`~qiskit.providers.aer.pulse.PulseSystemModel` objects.
|
||||
physical system specified by :class:`~qiskit_aer.pulse.PulseSystemModel` objects.
|
||||
Results are returned in the same format as when jobs are submitted to actual devices.
|
||||
|
||||
**Examples**
|
||||
|
||||
The minimal information a ``PulseSimulator`` needs to simulate is a
|
||||
:class:`~qiskit.providers.aer.pulse.PulseSystemModel`, which can be supplied either by
|
||||
:class:`~qiskit_aer.pulse.PulseSystemModel`, which can be supplied either by
|
||||
setting the backend option before calling ``run``, e.g.:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
backend_sim = qiskit.providers.aer.PulseSimulator()
|
||||
backend_sim = qiskit_aer.PulseSimulator()
|
||||
|
||||
# Set the pulse system model for the simulator
|
||||
backend_sim.set_options(system_model=system_model)
|
||||
|
@ -85,7 +85,7 @@ class PulseSimulator(AerBackend):
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
backend_sim = qiskit.providers.aer.PulseSimulator()
|
||||
backend_sim = qiskit_aer.PulseSimulator()
|
||||
|
||||
# Assemble schedules using PulseSimulator as the backend
|
||||
pulse_qobj = assemble(schedules, backend=backend_sim)
|
||||
|
@ -99,21 +99,21 @@ class PulseSimulator(AerBackend):
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
armonk_sim = qiskit.providers.aer.PulseSimulator.from_backend(FakeArmonk())
|
||||
armonk_sim = qiskit_aer.PulseSimulator.from_backend(FakeArmonk())
|
||||
pulse_qobj = assemble(schedules, backend=armonk_sim)
|
||||
armonk_sim.run(pulse_qobj)
|
||||
|
||||
In the above example, the ``PulseSimulator`` copies all configuration and default data from
|
||||
``FakeArmonk()``, and as such has the same affect as ``FakeArmonk()`` when passed as an
|
||||
argument to ``assemble``. Furthermore it constructs a
|
||||
:class:`~qiskit.providers.aer.pulse.PulseSystemModel` from the model details in the supplied
|
||||
:class:`~qiskit_aer.pulse.PulseSystemModel` from the model details in the supplied
|
||||
backend, which is then used in simulation.
|
||||
|
||||
**Supported PulseQobj parameters**
|
||||
|
||||
* ``qubit_lo_freq``: Local oscillator frequencies for each :class:`DriveChannel`.
|
||||
Defaults to either the value given in the
|
||||
:class:`~qiskit.providers.aer.pulse.PulseSystemModel`, or is calculated directly
|
||||
:class:`~qiskit_aer.pulse.PulseSystemModel`, or is calculated directly
|
||||
from the Hamiltonian.
|
||||
* ``meas_level``: Type of desired measurement output, in ``[1, 2]``.
|
||||
``1`` gives complex numbers (IQ values), and ``2`` gives discriminated states ``|0>`` and
|
||||
|
@ -138,7 +138,7 @@ class PulseSimulator(AerBackend):
|
|||
|
||||
The simulator uses the ``zvode`` differential equation solver method through ``scipy``.
|
||||
Simulation is performed in the rotating frame of the diagonal of the drift Hamiltonian
|
||||
contained in the :class:`~qiskit.providers.aer.pulse.PulseSystemModel`. Measurements
|
||||
contained in the :class:`~qiskit_aer.pulse.PulseSystemModel`. Measurements
|
||||
are performed in the `dressed basis` of the drift Hamiltonian.
|
||||
|
||||
**Other options**
|
|
@ -195,7 +195,7 @@ class QasmSimulator(AerBackend):
|
|||
|
||||
* ``stabilizer_max_snapshot_probabilities`` (int): set the maximum
|
||||
qubit number for the
|
||||
`~qiskit.providers.aer.extensions.SnapshotProbabilities`
|
||||
`~qiskit_aer.extensions.SnapshotProbabilities`
|
||||
instruction (Default: 32).
|
||||
|
||||
These backend options only apply when using the ``"extended_stabilizer"``
|
|
@ -43,7 +43,7 @@ target_include_directories(controller_wrappers PRIVATE ${AER_SIMULATOR_CPP_SRC_D
|
|||
PRIVATE ${AER_SIMULATOR_CPP_EXTERNAL_LIBS})
|
||||
target_link_libraries(controller_wrappers ${AER_LIBRARIES})
|
||||
target_compile_definitions(controller_wrappers PRIVATE ${AER_COMPILER_DEFINITIONS})
|
||||
install(TARGETS controller_wrappers LIBRARY DESTINATION qiskit/providers/aer/backends)
|
||||
install(TARGETS controller_wrappers LIBRARY DESTINATION qiskit_aer/backends)
|
||||
|
||||
# Install redistributable dependencies
|
||||
install(FILES ${BACKEND_REDIST_DEPS} DESTINATION qiskit/providers/aer/backends)
|
||||
install(FILES ${BACKEND_REDIST_DEPS} DESTINATION qiskit_aer/backends)
|
|
@ -12,10 +12,10 @@
|
|||
|
||||
"""
|
||||
===========================================================
|
||||
Circuit Extensions (:mod:`qiskit.providers.aer.extensions`)
|
||||
Circuit Extensions (:mod:`qiskit_aer.extensions`)
|
||||
===========================================================
|
||||
|
||||
.. currentmodule:: qiskit.providers.aer.extensions
|
||||
.. currentmodule:: qiskit_aer.extensions
|
||||
|
||||
Snapshots
|
||||
=========
|
||||
|
@ -25,7 +25,7 @@ Snapshots
|
|||
Adding nonlocal noise to a noise model is deprecated as of qiskit-aer
|
||||
0.9.0 and will be removed no earlier than 3 months from that release date.
|
||||
They have been superceded by the save instructions in the
|
||||
:mod:`qiskit.providers.aer.library` module.
|
||||
:mod:`qiskit_aer.library` module.
|
||||
|
||||
Snapshot instructions allow taking a snapshot of the current state of the
|
||||
simulator without effecting the outcome of the simulation. These can be
|
|
@ -49,7 +49,7 @@ class Snapshot(Instruction):
|
|||
This instruction has been deprecated and will be removed no earlier
|
||||
than 3 months from the 0.9.0 release date. It has been superseded by
|
||||
the save instructions in
|
||||
:mod:`qiskit.providers.aer.library` module.
|
||||
:mod:`qiskit_aer.library` module.
|
||||
"""
|
||||
warn('The `Snapshot` instruction will be deprecated in the'
|
||||
' future. It has been superseded by the `SaveStatevector`'
|
|
@ -36,7 +36,7 @@ class SnapshotDensityMatrix(Snapshot):
|
|||
|
||||
This instruction has been deprecated and will be removed no earlier
|
||||
than 3 months from the 0.9.0 release date. It has been superseded by the
|
||||
:class:`qiskit.providers.aer.library.SaveDensityMatrix` instruction.
|
||||
:class:`qiskit_aer.library.SaveDensityMatrix` instruction.
|
||||
"""
|
||||
warn('The `SnapshotDensityMatrix` instruction has been deprecated as of'
|
||||
' qiskit-aer 0.9. It has been superseded by the `SaveDensityMatrix`'
|
||||
|
@ -64,7 +64,7 @@ def snapshot_density_matrix(self, label, qubits=None):
|
|||
|
||||
This instruction has been deprecated and will be removed no earlier
|
||||
than 3 months from the 0.9.0 release date. It has been superseded by the
|
||||
:class:`qiskit.providers.aer.library.save_density_matrix`
|
||||
:class:`qiskit_aer.library.save_density_matrix`
|
||||
circuit method.
|
||||
"""
|
||||
warn('The `snapshot_density_matrix` circuit method has been deprecated as of'
|
|
@ -43,8 +43,8 @@ class SnapshotExpectationValue(Snapshot):
|
|||
|
||||
This instruction has been deprecated and will be removed no earlier
|
||||
than 3 months from the 0.9.0 release date. It has been superseded by the
|
||||
:class:`qiskit.providers.aer.library.SaveExpectationValue` and
|
||||
:class:`qiskit.providers.aer.library.SaveExpectationValueVariance`
|
||||
:class:`qiskit_aer.library.SaveExpectationValue` and
|
||||
:class:`qiskit_aer.library.SaveExpectationValueVariance`
|
||||
instructions.
|
||||
"""
|
||||
warn('The `SnapshotExpectationValue` instruction has been deprecated as of'
|
||||
|
@ -152,8 +152,8 @@ def snapshot_expectation_value(self, label, op, qubits,
|
|||
|
||||
This instruction has been deprecated and will be removed no earlier
|
||||
than 3 months from the 0.9.0 release date. It has been superseded by the
|
||||
:func:`qiskit.providers.aer.library.save_expectation_value` and
|
||||
:func:`qiskit.providers.aer.library.save_expectation_value_variance`
|
||||
:func:`qiskit_aer.library.save_expectation_value` and
|
||||
:func:`qiskit_aer.library.save_expectation_value_variance`
|
||||
circuit methods.
|
||||
"""
|
||||
warn('The `snapshot_expectation_value` circuit method has been deprecated as of'
|
|
@ -37,8 +37,8 @@ class SnapshotProbabilities(Snapshot):
|
|||
|
||||
This instruction has been deprecated and will be removed no earlier
|
||||
than 3 months from the 0.9.0 release date. It has been superseded by the
|
||||
:class:`qiskit.providers.aer.library.SaveProbabilities` and
|
||||
:class:`qiskit.providers.aer.library.SaveProbabilitiesDict`
|
||||
:class:`qiskit_aer.library.SaveProbabilities` and
|
||||
:class:`qiskit_aer.library.SaveProbabilitiesDict`
|
||||
instructions.
|
||||
"""
|
||||
warn('The `SnapshotProbabilities` instruction has been deprecated as of'
|
||||
|
@ -69,8 +69,8 @@ def snapshot_probabilities(self, label, qubits, variance=False):
|
|||
|
||||
This instruction has been deprecated and will be removed no earlier
|
||||
than 3 months from the 0.9.0 release date. It has been superseded by the
|
||||
:func:`qiskit.providers.aer.library.save_probabilities` and
|
||||
:func:`qiskit.providers.aer.library.save_probabilities_dict`
|
||||
:func:`qiskit_aer.library.save_probabilities` and
|
||||
:func:`qiskit_aer.library.save_probabilities_dict`
|
||||
circuit methods.
|
||||
"""
|
||||
warn('The `snapshot_probabilities` circuit method has been deprecated as of'
|
|
@ -42,7 +42,7 @@ class SnapshotStabilizer(Snapshot):
|
|||
|
||||
This instruction has been deprecated and will be removed no earlier
|
||||
than 3 months from the 0.9.0 release date. It has been superseded by the
|
||||
:class:`qiskit.providers.aer.library.SaveStabilizer` instruction.
|
||||
:class:`qiskit_aer.library.SaveStabilizer` instruction.
|
||||
"""
|
||||
warn('The `SnapshotStabilizer` instruction will be deprecated in the'
|
||||
' future. It has been superseded by the `save_stabilizer`'
|
||||
|
@ -72,7 +72,7 @@ def snapshot_stabilizer(self, label):
|
|||
|
||||
This instruction has been deprecated and will be removed no earlier
|
||||
than 3 months from the 0.9.0 release date. It has been superseded by the
|
||||
:func:`qiskit.providers.aer.library.save_stabilizer` circuit
|
||||
:func:`qiskit_aer.library.save_stabilizer` circuit
|
||||
method.
|
||||
"""
|
||||
warn('The `snapshot_stabilizer` circuit method has been deprecated as of'
|
|
@ -41,7 +41,7 @@ class SnapshotStatevector(Snapshot):
|
|||
|
||||
This instruction has been deprecated and will be removed no earlier
|
||||
than 3 months from the 0.9.0 release date. It has been superseded by the
|
||||
:class:`qiskit.providers.aer.library.SaveStatevector` instruction.
|
||||
:class:`qiskit_aer.library.SaveStatevector` instruction.
|
||||
"""
|
||||
warn('The `SnapshotStatevector` instruction will be deprecated in the'
|
||||
'future. It has been superseded by the `SaveStatevector`'
|
||||
|
@ -71,7 +71,7 @@ def snapshot_statevector(self, label):
|
|||
|
||||
This instruction has been deprecated and will be removed no earlier
|
||||
than 3 months from the 0.9.0 release date. It has been superseded by the
|
||||
:class:`qiskit.providers.aer.library.save_statevector` circuit
|
||||
:class:`qiskit_aer.library.save_statevector` circuit
|
||||
method.
|
||||
"""
|
||||
warn('The `snapshot_statevector` circuit method has been deprecated as of'
|
|
@ -13,10 +13,10 @@
|
|||
# that they have been altered from the originals.
|
||||
"""
|
||||
================================================
|
||||
Aer Jobs (:mod:`qiskit.providers.aer.jobs`)
|
||||
Aer Jobs (:mod:`qiskit_aer.jobs`)
|
||||
================================================
|
||||
|
||||
.. currentmodule:: qiskit.providers.aer.jobs
|
||||
.. currentmodule:: qiskit_aer.jobs
|
||||
|
||||
This module contains classes and functions to manage Aer jobs.
|
||||
|
|
@ -427,7 +427,7 @@ class AerJobSet(Job):
|
|||
worker: retrive job used to submit with this job id.
|
||||
|
||||
Returns:
|
||||
A list of :class:`~qiskit.providers.aer.AerJob`
|
||||
A list of :class:`~qiskit_aer.AerJob`
|
||||
instances that represents the submitted jobs.
|
||||
|
||||
Raises:
|
|
@ -11,10 +11,10 @@
|
|||
# that they have been altered from the originals.
|
||||
"""
|
||||
=========================================================
|
||||
Instruction Library (:mod:`qiskit.providers.aer.library`)
|
||||
Instruction Library (:mod:`qiskit_aer.library`)
|
||||
=========================================================
|
||||
|
||||
.. currentmodule:: qiskit.providers.aer.library
|
||||
.. currentmodule:: qiskit_aer.library
|
||||
|
||||
This library contains custom qiskit :class:`~qiskit.QuantumCircuit`
|
||||
:class:`~qiskit.circuit.Instruction` subclasses that can be used
|
||||
|
@ -90,8 +90,8 @@ for density matrix method etc.).
|
|||
to all qubits in a run circuit.
|
||||
|
||||
.. note::
|
||||
The :class:`~qiskit.providers.aer.StatevectorSimulator` (and
|
||||
:class:`~qiskit.providers.aer.UnitarySimulator`) backend automatically
|
||||
The :class:`~qiskit_aer.StatevectorSimulator` (and
|
||||
:class:`~qiskit_aer.UnitarySimulator`) backend automatically
|
||||
append every run circuit with the a :func:`SaveStatevector``
|
||||
(:func:`SaveUnitary``) instruction using the default label. Hence adding
|
||||
any additional save instructions of that type will require specifying a
|
|
@ -12,10 +12,10 @@
|
|||
|
||||
r"""
|
||||
================================================
|
||||
Noise Models (:mod:`qiskit.providers.aer.noise`)
|
||||
Noise Models (:mod:`qiskit_aer.noise`)
|
||||
================================================
|
||||
|
||||
.. currentmodule:: qiskit.providers.aer.noise
|
||||
.. currentmodule:: qiskit_aer.noise
|
||||
|
||||
This module contains classes and functions to build a noise model for
|
||||
simulating a Qiskit quantum circuit in the presence of errors.
|
||||
|
@ -25,7 +25,7 @@ Building Noise Models
|
|||
=====================
|
||||
|
||||
The :class:`NoiseModel` class is used to represent noise model for the
|
||||
:class:`~qiskit.providers.aer.QasmSimulator`. It can be used to construct
|
||||
:class:`~qiskit_aer.QasmSimulator`. It can be used to construct
|
||||
custom noise models for simulator, to to automatically generate a basic
|
||||
device noise model for an IBMQ backend.
|
||||
|
||||
|
@ -45,7 +45,7 @@ details.
|
|||
from qiskit import QuantumCircuit, execute
|
||||
from qiskit import IBMQ, Aer
|
||||
from qiskit.visualization import plot_histogram
|
||||
from qiskit.providers.aer.noise import NoiseModel
|
||||
from qiskit_aer.noise import NoiseModel
|
||||
|
||||
# Build noise model from backend properties
|
||||
provider = IBMQ.load_account()
|
||||
|
@ -90,7 +90,7 @@ documentation for the :class:`NoiseModel` class for additional details.
|
|||
|
||||
from qiskit import QuantumCircuit, execute, Aer
|
||||
from qiskit.visualization import plot_histogram
|
||||
import qiskit.providers.aer.noise as noise
|
||||
import qiskit_aer.noise as noise
|
||||
|
||||
# Error probabilities
|
||||
prob_1 = 0.001 # 1-qubit gate
|
|
@ -205,7 +205,7 @@ def basic_device_gate_errors(properties,
|
|||
filterwarnings(
|
||||
"ignore",
|
||||
category=DeprecationWarning,
|
||||
module="qiskit.providers.aer.noise.errors.errorutils"
|
||||
module="qiskit_aer.noise.errors.errorutils"
|
||||
)
|
||||
depol_error = _device_depolarizing_error(
|
||||
qubits, error_param, relax_error, standard_gates, warnings=warnings)
|
|
@ -231,7 +231,7 @@ def _standard_gate_instruction(instruction, ignore_phase=True):
|
|||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings("ignore",
|
||||
category=DeprecationWarning,
|
||||
module="qiskit.providers.aer.noise.errors.errorutils")
|
||||
module="qiskit_aer.noise.errors.errorutils")
|
||||
|
||||
# Check for single-qubit reset Kraus
|
||||
if name == "kraus":
|
||||
|
@ -711,7 +711,7 @@ def _make_unitary_instruction(mat, qubits, standard_gates=True):
|
|||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings("ignore",
|
||||
category=DeprecationWarning,
|
||||
module="qiskit.providers.aer.noise.errors.errorutils")
|
||||
module="qiskit_aer.noise.errors.errorutils")
|
||||
res = _standard_gate_instruction(instruction)
|
||||
else:
|
||||
res = [instruction]
|
||||
|
@ -906,7 +906,7 @@ def kraus2instructions(kraus_ops, standard_gates, atol=ATOL_DEFAULT):
|
|||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings("ignore",
|
||||
category=DeprecationWarning,
|
||||
module="qiskit.providers.aer.noise.errors.errorutils")
|
||||
module="qiskit_aer.noise.errors.errorutils")
|
||||
instructions.append(make_kraus_instruction(non_unitaries, qubits))
|
||||
probabilities.append(prob_kraus)
|
||||
# Normalize probabilities to account for any rounding errors
|
|
@ -136,7 +136,7 @@ class QuantumError(BaseOperator, TolerancesMixin):
|
|||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings("ignore",
|
||||
category=DeprecationWarning,
|
||||
module="qiskit.providers.aer.noise.errors.errorutils")
|
||||
module="qiskit_aer.noise.errors.errorutils")
|
||||
noise_ops = kraus2instructions(
|
||||
noise_ops, standard_gates, atol=atol)
|
||||
else:
|
||||
|
@ -301,7 +301,7 @@ class QuantumError(BaseOperator, TolerancesMixin):
|
|||
warnings.filterwarnings(
|
||||
"ignore",
|
||||
category=DeprecationWarning,
|
||||
module="qiskit.providers.aer.noise.errors.errorutils"
|
||||
module="qiskit_aer.noise.errors.errorutils"
|
||||
)
|
||||
circ.append(UnitaryGate(label=dic['name'],
|
||||
data=standard_gate_unitary(dic['name'])),
|
|
@ -77,10 +77,10 @@ class NoiseModel:
|
|||
"""Noise model class for Qiskit Aer simulators.
|
||||
|
||||
This class is used to represent noise model for the
|
||||
:class:`~qiskit.providers.aer.QasmSimulator`. It can be used to construct
|
||||
:class:`~qiskit_aer.QasmSimulator`. It can be used to construct
|
||||
custom noise models for simulator, or to automatically generate a basic
|
||||
device noise model for an IBMQ backend. See the
|
||||
:mod:`~qiskit.providers.aer.noise` module documentation for additional
|
||||
:mod:`~qiskit_aer.noise` module documentation for additional
|
||||
information.
|
||||
|
||||
**Example: Basic device noise model**
|
||||
|
@ -92,7 +92,7 @@ class NoiseModel:
|
|||
.. code-block:: python
|
||||
|
||||
from qiskit import IBMQ, Aer
|
||||
from qiskit.providers.aer.noise import NoiseModel
|
||||
from qiskit_aer.noise import NoiseModel
|
||||
|
||||
provider = IBMQ.load_account()
|
||||
backend = provider.get_backend('ibmq_vigo')
|
||||
|
@ -108,7 +108,7 @@ class NoiseModel:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
import qiskit.providers.aer.noise as noise
|
||||
import qiskit_aer.noise as noise
|
||||
|
||||
# Error probabilities
|
||||
prob_1 = 0.001 # 1-qubit gate
|
||||
|
@ -145,9 +145,9 @@ class NoiseModel:
|
|||
Additional Information:
|
||||
Errors added to the noise model will have their instruction
|
||||
appended to the noise model basis_gates if the instruction is in
|
||||
the :class:`~qiskit.providers.aer.QasmSimulator` basis_gates. If
|
||||
the :class:`~qiskit_aer.QasmSimulator` basis_gates. If
|
||||
the instruction is not in the
|
||||
:class:`~qiskit.providers.aer.QasmSimulator` basis_gates it is
|
||||
:class:`~qiskit_aer.QasmSimulator` basis_gates it is
|
||||
assumed to be a label for a standard gate, and that gate should be
|
||||
added to the `NoiseModel` basis_gates either using the init method,
|
||||
or the :meth:`add_basis_gates` method.
|
||||
|
@ -389,12 +389,12 @@ class NoiseModel:
|
|||
filterwarnings(
|
||||
"ignore",
|
||||
category=DeprecationWarning,
|
||||
module="qiskit.providers.aer.noise"
|
||||
module="qiskit_aer.noise"
|
||||
)
|
||||
filterwarnings(
|
||||
"ignore",
|
||||
category=PendingDeprecationWarning,
|
||||
module="qiskit.providers.aer.noise"
|
||||
module="qiskit_aer.noise"
|
||||
)
|
||||
gate_errors = basic_device_gate_errors(
|
||||
properties,
|
||||
|
@ -974,7 +974,7 @@ class NoiseModel:
|
|||
with catch_warnings():
|
||||
filterwarnings("ignore",
|
||||
category=DeprecationWarning,
|
||||
module="qiskit.providers.aer.noise")
|
||||
module="qiskit_aer.noise")
|
||||
qerror = QuantumError(noise_ops)
|
||||
qerror._id = error.get('id', None) or qerror.id
|
||||
if all_gate_qubits is not None:
|
|
@ -12,10 +12,10 @@
|
|||
|
||||
"""
|
||||
===================================================
|
||||
Primitives (:mod:`qiskit.providers.aer.primitives`)
|
||||
Primitives (:mod:`qiskit_aer.primitives`)
|
||||
===================================================
|
||||
|
||||
.. currentmodule:: qiskit.providers.aer.primitives
|
||||
.. currentmodule:: qiskit_aer.primitives
|
||||
|
||||
This module is Aer implementation of primitives.
|
||||
See the docs https://qiskit.org/documentation/apidoc/primitives.html for general descriptions.
|
|
@ -14,10 +14,10 @@
|
|||
|
||||
"""
|
||||
=======================================================
|
||||
Pulse System Models (:mod:`qiskit.providers.aer.pulse`)
|
||||
Pulse System Models (:mod:`qiskit_aer.pulse`)
|
||||
=======================================================
|
||||
|
||||
.. currentmodule:: qiskit.providers.aer.pulse
|
||||
.. currentmodule:: qiskit_aer.pulse
|
||||
|
||||
This module contains classes and functions to build a pulse system model
|
||||
for simulating a Qiskit pulse schedule.
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue