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

Prepare 1.1.0 release #12371

Merged
merged 37 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
93e368c
draft 1.1.0
sbrandhsn May 8, 2024
a40f79b
fixes text/typos
sbrandhsn May 13, 2024
bcc1621
.
sbrandhsn May 13, 2024
0317ddd
.
sbrandhsn May 14, 2024
e1be420
Update releasenotes/notes/1.1/add-annotated-arg-to-power-4afe90e89fa5…
sbrandhsn May 14, 2024
040c75b
Update releasenotes/notes/1.1/prepare-1.1.0-732e167b70ab4d01.yaml
sbrandhsn May 14, 2024
d4be3cc
Update releasenotes/notes/1.1/prepare-1.1.0-732e167b70ab4d01.yaml
sbrandhsn May 14, 2024
9b8edcf
up
sbrandhsn May 14, 2024
2b5ede9
up
sbrandhsn May 14, 2024
f6e8147
Update releasenotes/notes/1.1/star-prerouting-0998b59880c20cef.yaml
sbrandhsn May 14, 2024
de1334b
Update releasenotes/notes/1.1/star-prerouting-0998b59880c20cef.yaml
sbrandhsn May 14, 2024
af706e4
Update releasenotes/notes/1.1/star-prerouting-0998b59880c20cef.yaml
sbrandhsn May 14, 2024
9d8bf2b
prelude - add platform support
sbrandhsn May 14, 2024
d2ce854
prelude update
sbrandhsn May 15, 2024
eeb4e77
Update releasenotes/notes/1.1/prepare-1.1.0-732e167b70ab4d01.yaml
sbrandhsn May 15, 2024
fa2923b
Update releasenotes/notes/1.1/added-parameter-ctrl_state-mcx-816dcd80…
sbrandhsn May 15, 2024
e6c6af8
Update releasenotes/notes/1.1/add-annotated-arg-to-power-4afe90e89fa5…
sbrandhsn May 15, 2024
23c3d50
Update releasenotes/notes/1.1/add-annotated-arg-to-power-4afe90e89fa5…
sbrandhsn May 15, 2024
617e89d
Update releasenotes/notes/1.1/add-annotated-arg-to-power-4afe90e89fa5…
sbrandhsn May 15, 2024
0bcf66b
Update releasenotes/notes/1.1/add-ctrl_state-mcp-parameter-b23562aa70…
sbrandhsn May 15, 2024
f524374
Update releasenotes/notes/1.1/prepare-1.1.0-732e167b70ab4d01.yaml
sbrandhsn May 15, 2024
98cda11
Update releasenotes/notes/1.1/prepare-1.1.0-732e167b70ab4d01.yaml
sbrandhsn May 15, 2024
eb3803f
Update releasenotes/notes/1.1/prepare-1.1.0-732e167b70ab4d01.yaml
sbrandhsn May 15, 2024
4b7cad1
comments from code review
sbrandhsn May 15, 2024
f1bc34e
Apply suggestions from code review
sbrandhsn May 15, 2024
fd5cf84
Update releasenotes/notes/1.1/abstract-commutation-analysis-3518129e9…
sbrandhsn May 15, 2024
e6a69df
Update qiskit/primitives/containers/shape.py
sbrandhsn May 15, 2024
6adc048
Update shape.py
sbrandhsn May 16, 2024
3ace3ba
Apply suggestions from code review
sbrandhsn May 16, 2024
e6a76a0
Update releasenotes/notes/1.1/prepare-1.1.0-732e167b70ab4d01.yaml
sbrandhsn May 16, 2024
fa162dc
Update releasenotes/notes/1.1/prepare-1.1.0-732e167b70ab4d01.yaml
sbrandhsn May 16, 2024
be33359
.
sbrandhsn May 16, 2024
fde8a63
.
sbrandhsn May 16, 2024
2e749fb
Move and update new fix release notes
mtreinish May 16, 2024
e873ae9
Small tweaks
mtreinish May 16, 2024
6ec3efe
Remove fix note for private API
mtreinish May 16, 2024
6199cc5
Add release notes for manual `Var` and `Store` (#12421)
jakelishman May 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# The short X.Y version
version = "1.1"
# The full version, including alpha/beta/rc tags
release = "1.1.0rc1"
release = "1.1.0"

language = "en"

Expand Down
2 changes: 1 addition & 1 deletion docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Qiskit |version| release notes
`:earliest-version:` should be set to the rc1 release for the current minor release series. For example, the stable/1.1 branch should set it to 1.1.0rc1. If on `main`, set to the prior minor version's rc1, like `1.0.0rc1`.

.. release-notes::
:earliest-version: 1.0.0rc1
:earliest-version: 1.1.0rc1
2 changes: 1 addition & 1 deletion qiskit/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.0rc1
1.1.0
2 changes: 1 addition & 1 deletion qiskit/circuit/classical/expr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
real-time variable, or a wrapper around a :class:`.Clbit` or :class:`.ClassicalRegister`.

.. autoclass:: Var
:members: var, name
:members: var, name, new

Similarly, literals used in expressions (such as integers) should be lifted to :class:`Value` nodes
with associated types.
Expand Down
16 changes: 11 additions & 5 deletions qiskit/primitives/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
* a collection parameter value sets to bind the circuit against, :math:`\theta_k`.

Running an estimator returns a :class:`~qiskit.primitives.BasePrimitiveJob` object, where calling
the method :meth:`~qiskit.primitives.BasePrimitiveJob.result` results in expectation value estimates
the method :meth:`~qiskit.primitives.BasePrimitiveJob.result` results in expectation value estimates
and metadata for each pub:

.. math::
Expand Down Expand Up @@ -95,15 +95,15 @@
# [<psi2(theta2)|H2|psi2(theta2)>] ]
job2 = estimator.run(
[
(psi1, [H1, H3], [theta1, theta3]),
(psi1, [H1, H3], [theta1, theta3]),
(psi2, H2, theta2)
],
precision=0.01
)
job_result = job2.result()
print(f"The primitive-job finished with result {job_result}")


Overview of SamplerV2
=====================

Expand Down Expand Up @@ -220,8 +220,8 @@
# <psi2(theta2)|H2|psi2(theta2)>,
# <psi1(theta3)|H3|psi1(theta3)> ]
job2 = estimator.run(
[psi1, psi2, psi1],
[H1, H2, H3],
[psi1, psi2, psi1],
[H1, H2, H3],
[theta1, theta2, theta3]
)
job_result = job2.result()
Expand Down Expand Up @@ -417,8 +417,10 @@
DataBin
PrimitiveResult
PubResult
SamplerPubResult
BasePrimitiveJob
PrimitiveJob
Shaped

Estimator V1
------------
Expand Down Expand Up @@ -464,12 +466,16 @@
DataBin,
PrimitiveResult,
PubResult,
SamplerPubResult,
EstimatorPubLike,
SamplerPubLike,
BindingsArrayLike,
ObservableLike,
ObservablesArrayLike,
Shaped,
ihincks marked this conversation as resolved.
Show resolved Hide resolved
)


from .estimator import Estimator
from .primitive_job import BasePrimitiveJob, PrimitiveJob
from .sampler import Sampler
Expand Down
1 change: 1 addition & 0 deletions qiskit/primitives/containers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
from .pub_result import PubResult
from .sampler_pub import SamplerPubLike
from .sampler_pub_result import SamplerPubResult
from .shape import Shaped
1 change: 1 addition & 0 deletions qiskit/primitives/containers/bit_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def __repr__(self):
return f"BitArray({desc})"

def __getitem__(self, indices):
"""Slices the array along an existing axis of the array."""
if isinstance(indices, tuple) and len(indices) >= self.ndim + 2:
raise ValueError(
"BitArrays cannot be sliced along the bits axis, see slice_bits() instead."
Expand Down
6 changes: 3 additions & 3 deletions qiskit/primitives/containers/shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ def __repr__(self):
return f"{type(self).__name__}(<{self.shape}>)"

@property
def shape(self):
def shape(self) -> tuple[int, ...]:
return self._shape

@property
def ndim(self):
def ndim(self) -> int:
return len(self._shape)

@property
def size(self):
def size(self) -> int:
return int(np.prod(self._shape, dtype=int))


Expand Down
39 changes: 38 additions & 1 deletion qiskit/providers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,45 @@ def get_translation_stage_plugin(self):
efficient output on ``Mybackend`` the transpiler will be able to perform these
custom steps without any manual user input.

.. _providers-guide-real-time-variables:

Real-time variables
^^^^^^^^^^^^^^^^^^^

The transpiler will automatically handle real-time typed classical variables (see
:mod:`qiskit.circuit.classical`) and treat the :class:`.Store` instruction as a built-in
"directive", similar to :class:`.Barrier`. No special handling from backends is necessary to permit
this.

If your backend is *unable* to handle classical variables and storage, we recommend that you comment
on this in your documentation, and insert a check into your :meth:`~.BackendV2.run` method (see
:ref:`providers-guide-backend-run`) to eagerly reject circuits containing them. You can examine
:attr:`.QuantumCircuit.num_vars` for the presence of variables at the top level. If you accept
:ref:`control-flow operations <circuit-control-flow-repr>`, you might need to recursively search the
internal :attr:`~.ControlFlowOp.blocks` of each for scope-local variables with
:attr:`.QuantumCircuit.num_declared_vars`.

For example, a function to check for the presence of any manual storage locations, or manual stores
to memory::

from qiskit.circuit import Store, ControlFlowOp, QuantumCircuit

def has_realtime_logic(circuit: QuantumCircuit) -> bool:
if circuit.num_vars:
return True
for instruction in circuit.data:
if isinstance(instruction.operation, Store):
return True
elif isinstance(instruction.operation, ControlFlowOp):
for block in instruction.operation.blocks:
if has_realtime_logic(block):
return True
return False

.. _providers-guide-backend-run:

Backend.run Method
--------------------
------------------

Of key importance is the :meth:`~qiskit.providers.BackendV2.run` method, which
is used to actually submit circuits to a device or simulator. The run method
Expand Down
177 changes: 0 additions & 177 deletions releasenotes/notes/1.0/primitives-v2-df871c0c6ac0b94a.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
features:
features_transpiler:
- |
Extended the commutation analysis performed by :class:`.CommutationChecker` to only operate on
hardware circuits to also work with abstract circuits, i.e. each operation in
the input quantum circuit is now checked for its matrix representation before proceeding to the
analysis. In addition, the operation is now checked for its ability to be cached in the session
commutation library. For example, this now enables computing whether :class:`.AnnotatedOperation`
commute. This enables transpiler passes that rely on :class:`.CommutationChecker` internally,
such as :class:`.CommutativeCancellation`, during earlier stages of a default transpilation pipeline
Extended the commutation analysis performed by :class:`~.CommutationChecker` to also work with
abstract circuits, i.e. each operation in the input quantum circuit is now checked for its matrix
representation before proceeding to the analysis step. Previously, the commutation analysis was only
performed on physical circuits. In addition, each operation is now checked for its ability to be
cached in the session commutation library. For example, this now enables computing
whether :class:`.AnnotatedOperation` commute. This enables transpiler passes that rely on :class:`~.CommutationChecker` internally,
such as :class:`.CommutativeCancellation`, to run during earlier stages of a default transpilation pipeline
(prior to basis translation).

Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
---
features:
features_circuits:
- |
The methods :meth:`~qiskit.circuit.QuantumCircuit.power`,
:meth:`~qiskit.circuit.Gate.power`, as well as the similar methods
The methods :meth:`.QuantumCircuit.power`,
:meth:`.Gate.power`, as well as the similar methods on subclasses
of subclasses of :class:`~qiskit.circuit.Gate`
(such as of :class:`~qiskit.circuit.library.SGate`) all have an additional
argument ``annotated``.
have a new argument ``annotated`` which is used to return an :class:`.AnnotatedOperation`
object when applying a power to a gate or circuit.
The default value of ``False`` corresponds to the existing behavior.
Furthermore, for standard gates with an explicitly defined ``power`` method,
the argument ``annotated`` has no effect, for example both
the argument ``annotated`` has no effect.
For example, both
``SGate().power(1.5, annotated=False)`` and ``SGate().power(1.5, annotated=True)``
return a ``PhaseGate``.
The difference manifests for gates without an explicitly defined
A difference in the value of ``annotated`` manifests for gates without an explicitly defined
power method. The value of ``False`` returns a
:class:`~.library.UnitaryGate`, just as before, while the value of ``True``
returns an :class:`~.AnnotatedOperation` that represents the instruction
Expand Down