Skip to content

Commit

Permalink
conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
SamFerracin committed Aug 9, 2024
2 parents 97d33a9 + e86fb92 commit 5b241fd
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = '0.27.0'
release = '0.28.0'

# -- General configuration ---------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion qiskit_ibm_runtime/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.27.0
0.28.0
6 changes: 3 additions & 3 deletions qiskit_ibm_runtime/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class Batch(Session):
if a job's results do not meet your expectations, you can cancel the remaining jobs, or
simply re-submit that individual job and avoid re-running the entire workload.
All jobs need to be provided at the outset. To submit iterative jobs, use the ``session``
mode instead.
Batch mode can shorten processing time if all jobs are provided at the outset.
If you want to submit iterative jobs, use ``session`` mode instead.
You can open a Qiskit Runtime batch by using this ``Batch`` class, then submit jobs
to one or more primitives.
Expand Down Expand Up @@ -71,7 +71,7 @@ class Batch(Session):
print(f"Counts for the first PUB: {pub_result.data.cr.get_counts()}")
For more details, check the "`Run jobs in a batch
<https://docs.quantum.ibm.com/guides/run-jobs-batch>`_" tutorial.
<https://docs.quantum.ibm.com/guides/run-jobs-batch>`_" page.
"""

def __init__(
Expand Down
56 changes: 46 additions & 10 deletions qiskit_ibm_runtime/utils/noise_learner_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@
from qiskit.circuit import QuantumCircuit
from qiskit.quantum_info import PauliList

from ..utils.deprecation import issue_deprecation_msg


class PauliLindbladError:
r"""A Pauli error channel generated by a Pauli Lindblad dissipator.
r"""A Pauli error channel generated by a Pauli Lindblad dissipators.
This operator represents an N-qubit quantum error channel
:math:`E(ρ) = e^{\sum_j r_j D_{P_j}}(ρ)` generated by Pauli Lindblad dissipators
:math:`D_P(ρ) = P ρ P - ρ`, where :math:`P_j` are N-qubit :class:`~.Pauli` operators.
:math:`E(\rho) = e^{\sum_j r_j D_{P_j}}(\rho)` generated by Pauli Lindblad dissipators
:math:`D_P(\rho) = P \rho P - \rho`, where :math:`P_j` are N-qubit :class:`~.Pauli`
operators.
The list of Pauli generator terms are stored as a :class:`~.PauliList` and can be
accessed via the :attr:`generators` attribute. The array of dissipator rates
:math:`r_j` can be accessed via the :attr:`rates` attribute.
accessed via the :attr:`~generators` attribute. The array of dissipator rates
:math:`r_j` can be accessed via the :attr:`~rates` attribute.
The equivalent Pauli error channel can be constructed as a composition
of single-Pauli channel terms
Expand All @@ -41,24 +44,31 @@ class PauliLindbladError:
E = e^{\sum_j r_j D_{P_j}} = \prod_j e^{r_j D_{P_j}}
= prod_j \left( (1 - p_j) S_I + p_j S_{P_j} \right)
where :math:`p_j = \frac12 - \frac12 e^{-2 r_j}`.
where :math:`p_j = \frac12 - \frac12 e^{-2 r_j}` [1].
Args:
generators: A list of the Pauli Lindblad generators for the error channel.
rates: A list of the rates for the Pauli-Lindblad ``generators``.
Raises:
ValueError: If ``generators`` and ``rates`` have different lengths.
References:
1. E. van den Berg, Z. Minev, A. Kandala, K. Temme, *Probabilistic error
cancellation with sparse Pauli–Lindblad models on noisy quantum processors*,
Nature Physics volume 19, pages1116–1121 (2023).
`arXiv:2201.09866 [quant-ph] <https://arxiv.org/abs/2201.09866>`_
"""

def __init__(self, generators: PauliList, rates: Sequence[float]) -> None:
self._generators = generators
self._rates = np.asarray(rates, dtype=float)

if len(generators) != len(self._rates):
msg = f"``generators`` has length {len(generators)} "
msg += f"but ``rates`` has length {len(self.rates)}."
raise ValueError(msg)
if (len(generators),) != self._rates.shape:
raise ValueError(
f"``generators`` has length {len(generators)} "
f"but ``rates`` has shape {self._rates.shape}."
)

@property
def generators(self) -> PauliList:
Expand Down Expand Up @@ -128,6 +138,32 @@ def error(self) -> PauliLindbladError:
"""
return self._error

@property
def generators(self) -> PauliList:
r"""
(DEPRECATED) The Pauli Lindblad generators of the error channel in this :class:`.~LayerError`.
"""
issue_deprecation_msg(
"The ``generators`` property is deprecated",
"0.27.0",
"Instead, you can access the generators through the ``error`` property.",
1,
)
return self.error.generators

@property
def rates(self) -> NDArray[np.float64]:
r"""
(DEPRECATED) The Lindblad generator rates of the error channel in this :class:`.~LayerError`.
"""
issue_deprecation_msg(
"The ``rates`` property is deprecated",
"0.27.0",
"Instead, you can access the rates through the ``error`` property.",
1,
)
return self.error.rates

@property
def num_qubits(self) -> int:
r"""
Expand Down
13 changes: 13 additions & 0 deletions release-notes/0.27.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
0.27.0 (2024-08-08)
===================

New Features
------------

- Added ``PauliLindbladError`` and ``LayerError`` classes to represent layers noise processes. (`1844 <https://github.com/Qiskit/qiskit-ibm-runtime/pull/1844>`__)


Bug Fixes
---------

- Fixed an issue with using the aer simulator and local service mode with sessions. (`1838 <https://github.com/Qiskit/qiskit-ibm-runtime/pull/1838>`__)
1 change: 0 additions & 1 deletion release-notes/unreleased/1838.bug.rst

This file was deleted.

0 comments on commit 5b241fd

Please sign in to comment.