Skip to content

Commit

Permalink
Release 0.7.0 (#993)
Browse files Browse the repository at this point in the history
* Move release notes to 0.7 folder

* Update readme example to include ideal and noisy simulation
  • Loading branch information
chriseclectic authored Oct 15, 2020
1 parent d64c06d commit 65e60bf
Show file tree
Hide file tree
Showing 26 changed files with 103 additions and 74 deletions.
50 changes: 24 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()

print(result.get_counts(0))
```
result_noise = qiskit.execute(circ, vigo_sim).result()
counts_noise = result_noise.get_counts(0)

```python
{'000': 495, '001': 18, '010': 8, '011': 18, '100': 2, '101': 14, '110': 28, '111': 441}
print('Counts(noise):', counts_noise)
# Counts(noise): {'000': 492, '001': 6, '010': 8, '011': 14, '100': 3, '101': 14, '110': 18, '111': 469}
```


## Contribution Guidelines

If you'd like to contribute to Qiskit, please take a look at our
Expand Down
2 changes: 1 addition & 1 deletion qiskit/providers/aer/noise/errors/readout_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, probabilities, atol=ATOL_DEFAULT):
.. 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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
15 changes: 15 additions & 0 deletions releasenotes/notes/0.7/0.7.0-release-a6655712e304234b.yaml
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
19 changes: 19 additions & 0 deletions releasenotes/notes/0.7/fusion-threshold-33127b9b4e219640.yaml
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
9 changes: 9 additions & 0 deletions releasenotes/notes/0.7/mps-apply-kraus-3cc8de65a66385ab.yaml
Original file line number Diff line number Diff line change
@@ -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`.
Original file line number Diff line number Diff line change
@@ -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`.
11 changes: 0 additions & 11 deletions releasenotes/notes/fusion-threshold-33127b9b4e219640.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions releasenotes/notes/mps-apply-kraus-3cc8de65a66385ab.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions releasenotes/notes/mps-density-matrix-51f7d5b1ef51e746.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions releasenotes/notes/rotation-gates-7c09f4565329ca78.yaml

This file was deleted.

0 comments on commit 65e60bf

Please sign in to comment.