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

Move Aer to its own package #1526

Merged
merged 16 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/neko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ jobs:
- uses: Qiskit/qiskit-neko@main
with:
test_selection: backend
repo_install_command: pip install -e .
11 changes: 8 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -166,6 +168,7 @@ jobs:
run: |
set -e
pip check
rm -rf qiskit_aer
stestr run --slowest
shell: bash
tests_macos:
Expand Down Expand Up @@ -204,6 +207,7 @@ jobs:
run: |
set -e
pip check
rm -rf qiskit_aer
stestr run --slowest
shell: bash
tests_windows:
Expand Down Expand Up @@ -250,5 +254,6 @@ jobs:
set -e
chcp.com 65001
pip check
rm -rf qiskit_aer
stestr run --slowest
shell: bash
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ rhs*_op.pyx
*.whl
*.egg*
build/*
qiskit/providers/aer/backends/libomp.dylib
*libomp.dylib

# Ignore macOS DS_Store
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
16 changes: 6 additions & 10 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions docs/apidocs/aer_extensions.rst
Original file line number Diff line number Diff line change
@@ -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:
2 changes: 1 addition & 1 deletion docs/apidocs/aer_jobs.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _aer-jobs:

.. automodule:: qiskit.providers.aer.jobs
.. automodule:: qiskit_aer.jobs
:no-members:
:no-inherited-members:
:no-special-members:
4 changes: 2 additions & 2 deletions docs/apidocs/aer_library.rst
Original file line number Diff line number Diff line change
@@ -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:
4 changes: 2 additions & 2 deletions docs/apidocs/aer_noise.rst
Original file line number Diff line number Diff line change
@@ -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:
4 changes: 2 additions & 2 deletions docs/apidocs/aer_provider.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _aer-provider:

.. automodule:: qiskit.providers.aer
.. automodule:: qiskit_aer
:no-members:
:no-inherited-members:
:no-special-members:
:no-special-members:
4 changes: 2 additions & 2 deletions docs/apidocs/aer_pulse.rst
Original file line number Diff line number Diff line change
@@ -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:
4 changes: 2 additions & 2 deletions docs/apidocs/aer_utils.rst
Original file line number Diff line number Diff line change
@@ -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:
4 changes: 2 additions & 2 deletions docs/apidocs/parallel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
# (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
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions qiskit/providers/aer/__init__.py → qiskit_aer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

"""
==========================================
Aer Provider (:mod:`qiskit.providers.aer`)
Aer Provider (:mod:`qiskit_aer`)
==========================================

.. currentmodule:: qiskit.providers.aer
.. currentmodule:: qiskit_aer

Simulator Provider
==================
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -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"``
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"``
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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
=========
Expand All @@ -25,7 +25,7 @@
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self,
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`'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self, label, num_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
: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`'
Expand Down Expand Up @@ -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'
Expand Down
Loading