mirror of https://github.com/Qiskit/qiskit-aer.git
Release 0.7.0 (#993)
* Move release notes to 0.7 folder * Update readme example to include ideal and noisy simulation
This commit is contained in:
parent
d64c06ddfc
commit
65e60bfffc
50
README.md
50
README.md
|
@ -41,43 +41,41 @@ $ python
|
|||
```
|
||||
|
||||
```python
|
||||
from qiskit import QuantumCircuit, execute
|
||||
from qiskit import Aer, IBMQ
|
||||
from qiskit.providers.aer.noise import NoiseModel
|
||||
|
||||
# Choose a real device to simulate from IBMQ provider
|
||||
provider = IBMQ.load_account()
|
||||
backend = provider.get_backend('ibmq_vigo')
|
||||
coupling_map = backend.configuration().coupling_map
|
||||
|
||||
# Generate an Aer noise model for device
|
||||
noise_model = NoiseModel.from_backend(backend)
|
||||
basis_gates = noise_model.basis_gates
|
||||
import qiskit
|
||||
from qiskit import IBMQ
|
||||
from qiskit.providers.aer import QasmSimulator
|
||||
|
||||
# Generate 3-qubit GHZ state
|
||||
num_qubits = 3
|
||||
circ = QuantumCircuit(3, 3)
|
||||
circ = qiskit.QuantumCircuit(3, 3)
|
||||
circ.h(0)
|
||||
circ.cx(0, 1)
|
||||
circ.cx(1, 2)
|
||||
circ.measure([0, 1, 2], [0, 1 ,2])
|
||||
|
||||
# Construct an ideal simulator
|
||||
sim = QasmSimulator()
|
||||
|
||||
# Perform an ideal simulation
|
||||
result_ideal = qiskit.execute(circ, sim).result()
|
||||
counts_ideal = result_ideal.get_counts(0)
|
||||
print('Counts(ideal):', counts_ideal)
|
||||
# Counts(ideal): {'000': 493, '111': 531}
|
||||
|
||||
# Construct a noisy simulator backend from an IBMQ backend
|
||||
# This simulator backend will be automatically configured
|
||||
# using the device configuration and noise model
|
||||
provider = IBMQ.load_account()
|
||||
vigo_backend = provider.get_backend('ibmq_vigo')
|
||||
vigo_sim = QasmSimulator.from_backend(vigo_backend)
|
||||
|
||||
# Perform noisy simulation
|
||||
backend = Aer.get_backend('qasm_simulator')
|
||||
job = execute(circ, backend,
|
||||
coupling_map=coupling_map,
|
||||
noise_model=noise_model,
|
||||
basis_gates=basis_gates)
|
||||
result = job.result()
|
||||
result_noise = qiskit.execute(circ, vigo_sim).result()
|
||||
counts_noise = result_noise.get_counts(0)
|
||||
|
||||
print(result.get_counts(0))
|
||||
print('Counts(noise):', counts_noise)
|
||||
# Counts(noise): {'000': 492, '001': 6, '010': 8, '011': 14, '100': 3, '101': 14, '110': 18, '111': 469}
|
||||
```
|
||||
|
||||
```python
|
||||
{'000': 495, '001': 18, '010': 8, '011': 18, '100': 2, '101': 14, '110': 28, '111': 441}
|
||||
```
|
||||
|
||||
|
||||
## Contribution Guidelines
|
||||
|
||||
If you'd like to contribute to Qiskit, please take a look at our
|
||||
|
|
|
@ -42,7 +42,7 @@ class ReadoutError:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
probabilities[j] = [P(0|m), P(1|m), ..., P(2 ** N - 1|m)]
|
||||
probabilities[m] = [P(0|m), P(1|m), ..., P(2 ** N - 1|m)]
|
||||
|
||||
where ``P(j|m)`` is the probability of recording a measurement outcome
|
||||
of ``m`` as the value ``j``. Where ``j`` and ``m`` are integer
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixes bug in the :class:`qiskit.providers.aer.StatevectorSimulator` that
|
||||
Fixes bug in the :class:`~qiskit.providers.aer.StatevectorSimulator` that
|
||||
caused it to always run as CPU with double-precision without SIMD/AVX2
|
||||
support even on systems with AVX2, or when single-precision or the GPU
|
||||
method was specified in the backend options.
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
prelude: >
|
||||
This 0.7.0 release includes numerous performance improvements and
|
||||
significant enhancements to the simulator interface, and drops support
|
||||
for Python 3.5.
|
||||
The main interface changes are configurable simulator backends,
|
||||
and constructing preconfigured simulators from IBMQ backends.
|
||||
Noise model an basis gate support has also been extended for most of the
|
||||
Qiskit circuit library standard gates, including new support for 1 and 2-qubit
|
||||
rotation gates.
|
||||
Performance improvements include adding SIMD support to the density matrix
|
||||
and unitary simulation methods, reducing the used memory and improving the
|
||||
performance of circuits using statevector and density matrix snapshots, and
|
||||
adding support for Kraus instructions to the gate fusion circuit optimization
|
||||
for greatly improving the performance of noisy statevector simulations.
|
|
@ -46,10 +46,27 @@ features:
|
|||
class:`~qiskit.providers.aer.StatevectorSimulator`,
|
||||
:class:`~qiskit.providers.aer.UnitarySimulator`, and
|
||||
:class:`~qiskit.providers.aer.QasmSimulator`.
|
||||
- |
|
||||
Adds support for 1 and 2-qubit Qiskit circuit library rotation gates
|
||||
:class:`~qiskit.circuit.library.RXGate`, :class:`~qiskit.circuit.library.RYGate`,
|
||||
:class:`~qiskit.circuit.library.RZGate`, :class:`~qiskit.circuit.library.RGate`,
|
||||
:class:`~qiskit.circuit.library.RXXGate`, :class:`~qiskit.circuit.library.RYYGate`,
|
||||
:class:`~qiskit.circuit.library.RZZGate`, :class:`~qiskit.circuit.library.RZXGate`
|
||||
to the :class:`~qiskit.providers.aer.StatevectorSimulator`,
|
||||
:class:`~qiskit.providers.aer.UnitarySimulator`, and the
|
||||
``"statevector"`` and ``"density_matrix"`` methods of the
|
||||
:class:`~qiskit.providers.aer.QasmSimulator`.
|
||||
- |
|
||||
Adds support for multi-controlled rotation gates ``"mcr"``, ``"mcrx"``,
|
||||
``"mcry"``, ``"mcrz"``
|
||||
to the :class:`~qiskit.providers.aer.StatevectorSimulator`,
|
||||
:class:`~qiskit.providers.aer.UnitarySimulator`, and the
|
||||
``"statevector"`` method of the
|
||||
:class:`~qiskit.providers.aer.QasmSimulator`.
|
||||
deprecations:
|
||||
- |
|
||||
:meth:`qiskit.providers.aer.noise.NoiseModel.set_x90_single_qubit_gates` has
|
||||
been deprecated as unrolling to custom basis gates has been added to the
|
||||
qiskit transpiler. The correct way to use an X90 based noise model is to
|
||||
define noise on the Sqrt(X) "sx" or "rx" gate and one of the single-qubit
|
||||
phase gates "u1", "rx", "p" in the noise model.
|
||||
define noise on the Sqrt(X) ``"sx"`` or ``"rx"`` gate and one of the single-qubit
|
||||
phase gates ``"u1"``, ``"rx"``, or ``"p"`` in the noise model.
|
|
@ -14,6 +14,10 @@ features:
|
|||
and defaults will be configured automatically from the backend configuration, properties and
|
||||
defaults.
|
||||
|
||||
For example a noisy density matrix simulator backend can be constructed as
|
||||
``QasmSimulator(method='density_matrix', noise_model=noise_model)``, or an ideal
|
||||
matrix product state simulator as ``QasmSimulator(method='matrix_product_state')``.
|
||||
|
||||
A benefit is that a :class:`~qiskit.providers.aer.PulseSimulator` instance configured from
|
||||
a backend better serves as a drop-in replacement to the original backend, making it easier to
|
||||
swap in and out a simulator and real backend, e.g. when testing code on a simulator before
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
deprecations:
|
||||
- |
|
||||
The `variance` kwarg of Snapshot instructions has been deprecated. This
|
||||
The ``variance`` kwarg of Snapshot instructions has been deprecated. This
|
||||
function computed the sample variance in the snapshot due to noise model
|
||||
sampling, not the variance due to measurement statistics so was often
|
||||
being used incorrectly. If noise modeling variance is required single shot
|
|
@ -0,0 +1,19 @@
|
|||
---
|
||||
upgrade:
|
||||
- |
|
||||
Updates gate fusion default thresholds so that gate fusion will be applied
|
||||
to circuits with of more than 14 qubits for statevector simulations on the
|
||||
:class:`~qiskit.providers.aer.StatevectorSimulator` and
|
||||
:class:`~qiskit.providers.aer.QasmSimulator`.
|
||||
|
||||
For the ``"density_matrix"``
|
||||
method of the :class:`~qiskit.providers.aer.QasmSimulator` and for the
|
||||
:class:`~qiskit.providers.aer.UnitarySimulator` gate fusion will be applied
|
||||
to circuits with more than 7 qubits.
|
||||
|
||||
Custom qubit threshold values can be set using the ``fusion_threshold``
|
||||
backend option ie ``backend.set_options(fusion_threshold=10)``
|
||||
- |
|
||||
Changes ``fusion_threshold`` backend option to apply fusion when the
|
||||
number of qubits is above the threshold, not equal or above the threshold,
|
||||
to match the behavior of the OpenMP qubit threshold parameter.
|
|
@ -3,4 +3,4 @@ features:
|
|||
- |
|
||||
Improves general noisy statevector simulation performance by adding a Kraus
|
||||
method to the gate fusion circuit optimization that allows applying gate
|
||||
fusion to noisy statevector simulations with general Kraus noise.
|
||||
fusion to noisy statevector simulations with general Kraus noise.
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
|
||||
features:
|
||||
- |
|
||||
Adds support for general Kraus
|
||||
:class:`~qiskit.providers.aer.noise.QauntumError` gate errors in the
|
||||
:class:`~qiskit.providers.aer.noise.NoiseModel` to the
|
||||
``"matrix_product_state"`` method of the
|
||||
:class:`~qiskit.providers.aer.QasmSimulator`.
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
|
||||
features:
|
||||
- |
|
||||
Adds support for density matrix snapshot instruction
|
||||
:class:`qiskit.providers.aer.extensions.SnapshotDensityMatrix` to the
|
||||
``"matrix_product_state"`` method of the
|
||||
:class:`~qiskit.providers.aer.QasmSimulator`.
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
Changes ``"fusion_threshold"`` backend option to apply fusion when the
|
||||
number of qubits is above the threshold, not equal or above the threshold,
|
||||
to match the behaviour of the OpenMP qubit threshold parameter.
|
||||
- |
|
||||
Changes the default value of ``"fusion_threshold"`` from 20 to 14 for the
|
||||
:class:`~qiskit.providers.aer.QasmSimulator` and
|
||||
:class:`~qiskit.providers.aer.StatevectorSimulator`, and from 10 to 7 for
|
||||
the :class:`~qiskit.providers.aer.UnitarySimulator`.
|
|
@ -1,8 +0,0 @@
|
|||
---
|
||||
|
||||
features:
|
||||
- |
|
||||
Added support for ``apply_kraus``in ``matrix_product_state.hpp``. This
|
||||
enables running the ``matrix_product_state`` simulation method with all
|
||||
types of Kraus noise.
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
---
|
||||
|
||||
features:
|
||||
- |
|
||||
Adds support for ``snapshot_density_matrix`` in the ``matrix_product_state
|
||||
simulation method``.
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
Adds support for 1 and 2-qubit rotation gates ``"rx"``, ``"ry"``, ``"rz"``,
|
||||
``"r"``, ``"rxx"``, ``"ryy"``, ``"rzz"``, ``"rzx"`` to the
|
||||
:class:`~qiskit.providers.aer.StatevectorSimulator`,
|
||||
:class:`~qiskit.providers.aer.UnitarySimulator`, and the
|
||||
``"statevector"`` and ``"density_matrix"`` methods of the
|
||||
:class:`~qiskit.providers.aer.StatevectorSimulator`.
|
||||
- |
|
||||
Adds support for multi-controlled rotation gates ``"mcr"``, ``"mcrx"``,
|
||||
``"mcry"``, ``"mcrz"``
|
||||
to the :class:`~qiskit.providers.aer.StatevectorSimulator`,
|
||||
:class:`~qiskit.providers.aer.UnitarySimulator`, and the
|
||||
``"statevector"`` method of the
|
||||
:class:`~qiskit.providers.aer.StatevectorSimulator`.
|
Loading…
Reference in New Issue