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

V0.18.0 release notes #1656

Merged
merged 45 commits into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
36ddeb1
version bump
antalszava Sep 15, 2021
15bd218
group entries
antalszava Sep 15, 2021
7d8bd57
update the descriptions
antalszava Sep 15, 2021
4735988
torch example
antalszava Sep 16, 2021
c06e82e
merge rc
antalszava Sep 16, 2021
8177644
contributors
antalszava Sep 16, 2021
f0a0b42
Update .github/CHANGELOG.md
antalszava Sep 16, 2021
e6317d8
Update .github/CHANGELOG.md
antalszava Sep 16, 2021
8721f7b
Update .github/CHANGELOG.md
antalszava Sep 16, 2021
3e577d7
Update .github/CHANGELOG.md
antalszava Sep 16, 2021
8e45751
Update .github/CHANGELOG.md
antalszava Sep 16, 2021
015c565
Update .github/CHANGELOG.md
antalszava Sep 16, 2021
45b39ba
Update .github/CHANGELOG.md
antalszava Sep 16, 2021
057d135
Update .github/CHANGELOG.md
antalszava Sep 16, 2021
72c09e8
Update .github/CHANGELOG.md
antalszava Sep 16, 2021
57c533b
format lines
antalszava Sep 16, 2021
e8578ca
num
antalszava Sep 16, 2021
26a92ca
Update .github/CHANGELOG.md
antalszava Sep 20, 2021
f36c39e
move q transforms
antalszava Sep 20, 2021
9020602
trainable coeffs
antalszava Sep 20, 2021
208272d
SISWAP adjust
antalszava Sep 20, 2021
9e1975e
Merge branch 'v0.18.0-rc0' into v0.18.0_release_notes
trbromley Sep 20, 2021
4ba2ef1
Add link to changelog
trbromley Sep 20, 2021
83488d6
Fix merge
trbromley Sep 20, 2021
9de740a
SISWAP move to improvements
antalszava Sep 20, 2021
b149de4
Merge branch 'v0.18.0_release_notes' of github.com:PennyLaneAI/pennyl…
antalszava Sep 20, 2021
9ef129d
drawer example
antalszava Sep 20, 2021
de6f2c2
remove item on separate requirements file
antalszava Sep 20, 2021
d3eff25
Update .github/CHANGELOG.md
antalszava Sep 20, 2021
cd87c7d
QFT move
antalszava Sep 20, 2021
8a6c761
further suggestions
antalszava Sep 20, 2021
46cae89
NumPy
antalszava Sep 20, 2021
7c98c9a
draw example
antalszava Sep 20, 2021
71a4fd4
no grad call for finite_diff qml.gradients
antalszava Sep 20, 2021
0bc6db0
no grad call for param_shift
antalszava Sep 20, 2021
140ece6
lightning
antalszava Sep 21, 2021
6f2c00b
Update .github/CHANGELOG.md
antalszava Sep 21, 2021
6080ef4
Hamiltonian + its plot
antalszava Sep 21, 2021
12291ba
Hamiltonian param shift move
antalszava Sep 21, 2021
8edd7aa
bug fix phrasing
antalszava Sep 21, 2021
c3d2236
contributors list
antalszava Sep 21, 2021
2b5ffa6
Lightning adjoint plot & description
antalszava Sep 21, 2021
90cc245
Hamiltonian plot width
antalszava Sep 21, 2021
9b8d354
align mid
antalszava Sep 21, 2021
2ca8fa1
Revert "align mid"
antalszava Sep 21, 2021
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
199 changes: 117 additions & 82 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
# Release 0.18.0-dev (development release)
# Release 0.18.0 (current release)

<h3>New features since last release</h3>

<h4>New PyTorch native device</h4>
antalszava marked this conversation as resolved.
Show resolved Hide resolved

* A new pytorch device, `qml.device('default.qubit.torch', wires=wires)`, supports
backpropogation with the torch interface.
antalszava marked this conversation as resolved.
Show resolved Hide resolved
[(#1225)](https://github.com/PennyLaneAI/pennylane/pull/1360)
antalszava marked this conversation as resolved.
Show resolved Hide resolved
[(#1598)](https://github.com/PennyLaneAI/pennylane/pull/1598)
antalszava marked this conversation as resolved.
Show resolved Hide resolved

```python
x = torch.tensor(0.43316321, dtype=torch.float64, requires_grad=True)
y = torch.tensor(0.2162158, dtype=torch.float64, requires_grad=True)
z = torch.tensor(0.75110998, dtype=torch.float64, requires_grad=True)

p = torch.tensor([x, y, z], requires_grad=True)
dev = qml.device("default.qubit.torch", wires=1)
antalszava marked this conversation as resolved.
Show resolved Hide resolved

@qml.qnode(dev, interface="torch", diff_method="backprop")
def circuit(x):
qml.Rot(x[0], x[1], x[2], wires=0)
return qml.expval(qml.PauliZ(0))

res = circuit(p)
res.backward()
```
```pycon
>>> res = circuit(p)
>>> res.backward()
>>> print(p.grad)
tensor([-9.1798e-17, -2.1454e-01, -1.0511e-16], dtype=torch.float64)
```

<h4>Batch gradient transforms</h4>
antalszava marked this conversation as resolved.
Show resolved Hide resolved

* Custom gradient transforms can now be created using the new
`@qml.gradients.gradient_transform` decorator on a batch-tape transform.
[(#1589)](https://github.com/PennyLaneAI/pennylane/pull/1589)

Quantum gradient transforms are a specific case of `qml.batch_transform`.
To create a quantum gradient transform, simply write a function that accepts a tape,
and returns a batch of tapes to be independently executed on a quantum device, alongside
a post-processing function that processes the tape results into the gradient.

Furthermore, a smart default expansion function is provided, which automatically expands tape
operations which are not differentiable prior to applying the quantum gradient.
All gradient transforms in `qml.gradients` are now decorated with this decorator.

Supported gradient transforms must be of the following form:

Expand Down Expand Up @@ -49,10 +74,8 @@
tensor(-0.87758256, requires_grad=True)
```

* A new pytorch device, `qml.device('default.qubit.torch', wires=wires)`, supports
backpropogation with the torch interface.
[(#1225)](https://github.com/PennyLaneAI/pennylane/pull/1360)
[(#1598)](https://github.com/PennyLaneAI/pennylane/pull/1598)
Refer to the page of [quantum gradient transforms](https://pennylane.readthedocs.io/en/stable/code/qml_gradients.html)
for more details.

* The ability to define *batch* transforms has been added via the new
`@qml.batch_transform` decorator.
Expand Down Expand Up @@ -129,19 +152,64 @@
1.2629730888100839
```

* Added a new `SISWAP` operation and a `SQISW` alias with support to the `default_qubit` device.
[#1563](https://github.com/PennyLaneAI/pennylane/pull/1563)
* Vector-Jacobian product transforms have been added to the `qml.gradients` package.
[(#1494)](https://github.com/PennyLaneAI/pennylane/pull/1494)

The new transforms include:

- `qml.gradients.vjp`
- `qml.gradients.batch_vjp`

* Support for differentiable execution of batches of circuits has been
added, via the beta `pennylane.interfaces.batch` module.
[(#1501)](https://github.com/PennyLaneAI/pennylane/pull/1501)
[(#1508)](https://github.com/PennyLaneAI/pennylane/pull/1508)
[(#1542)](https://github.com/PennyLaneAI/pennylane/pull/1542)
[(#1549)](https://github.com/PennyLaneAI/pennylane/pull/1549)
[(#1608)](https://github.com/PennyLaneAI/pennylane/pull/1608)
[(#1618)](https://github.com/PennyLaneAI/pennylane/pull/1618)
[(#1637)](https://github.com/PennyLaneAI/pennylane/pull/1637)

For example:
antalszava marked this conversation as resolved.
Show resolved Hide resolved

```python
from pennylane.interfaces.batch import execute

def cost_fn(x):
with qml.tape.JacobianTape() as tape1:
qml.RX(x[0], wires=[0])
qml.RY(x[1], wires=[1])
qml.CNOT(wires=[0, 1])
qml.var(qml.PauliZ(0) @ qml.PauliX(1))

with qml.tape.JacobianTape() as tape2:
qml.RX(x[0], wires=0)
qml.RY(x[0], wires=1)
qml.CNOT(wires=[0, 1])
qml.probs(wires=1)

result = execute(
[tape1, tape2], dev,
gradient_fn=qml.gradients.param_shift,
interface="autograd"
)
return result[0] + result[1][0, 0]

res = qml.grad(cost_fn)(params)
```

<h4>RotosolveOptimizer for general parametrized circuits</h4>
antalszava marked this conversation as resolved.
Show resolved Hide resolved

* The `RotosolveOptimizer` now can tackle general parametrized circuits, and is no longer
restricted to single-qubit Pauli rotations.
[(#1489)](https://github.com/PennyLaneAI/pennylane/pull/1489)

This includes:

- layers of gates controlled by the same parameter,
- controlled variants of parametrized gates, and
- Hamiltonian time evolution.

Note that the eigenvalue spectrum of the gate generator needs to be known to
use `RotosolveOptimizer` for a general gate, and it
is required to produce equidistant frequencies.
Expand All @@ -150,6 +218,7 @@

Consider a circuit with a mixture of Pauli rotation gates, controlled Pauli rotations, and
single-parameter layers of Pauli rotations:

```python
dev = qml.device('default.qubit', wires=3, shots=None)

Expand All @@ -164,6 +233,7 @@

return qml.expval(qml.PauliZ(0) @ qml.PauliZ(1) @ qml.PauliZ(2))
```

This cost function has one frequency for each of the first `RX` rotation angles,
three frequencies for the layer of `RX` gates that depend on `layer_par`, and two
frequencies for each of the `CRY` gate parameters. Rotosolve can then be used to minimize
Expand Down Expand Up @@ -209,19 +279,9 @@
Minimization substeps: [-1. -1. -1. -1. -1. -1. -1.]
```

For usage details please consider the docstring.

* The `frobenius_inner_product` function has been moved to the `qml.math`
module, and is now differentiable using all autodiff frameworks.
[(#1388)](https://github.com/PennyLaneAI/pennylane/pull/1388)
For usage details please consider the [docstring of the optimizer](https://pennylane.readthedocs.io/en/stable/code/api/pennylane.RotosolveOptimizer.html?highlight=rotosolveoptimizer#pennylane.RotosolveOptimizer).

* Vector-Jacobian product transforms have been added to the `qml.gradients` package.
[(#1494)](https://github.com/PennyLaneAI/pennylane/pull/1494)

The new transforms include:

- `qml.gradients.vjp`
- `qml.gradients.batch_vjp`
<h4>Faster and improved Hamiltonian computations</h4>
antalszava marked this conversation as resolved.
Show resolved Hide resolved

* The Hamiltonian can now store grouping information, which can be accessed by a device to
antalszava marked this conversation as resolved.
Show resolved Hide resolved
speed up computations of the expectation value of a Hamiltonian.
Expand Down Expand Up @@ -265,46 +325,19 @@
(array([-0.12777055, 0.0166009 ]), array(0.0917819))
```

* Support for differentiable execution of batches of circuits has been
added, via the beta `pennylane.interfaces.batch` module.
[(#1501)](https://github.com/PennyLaneAI/pennylane/pull/1501)
[(#1508)](https://github.com/PennyLaneAI/pennylane/pull/1508)
[(#1542)](https://github.com/PennyLaneAI/pennylane/pull/1542)
[(#1549)](https://github.com/PennyLaneAI/pennylane/pull/1549)
[(#1608)](https://github.com/PennyLaneAI/pennylane/pull/1608)
[(#1618)](https://github.com/PennyLaneAI/pennylane/pull/1618)
[(#1637)](https://github.com/PennyLaneAI/pennylane/pull/1637)

For example:

```python
from pennylane.interfaces.batch import execute

def cost_fn(x):
with qml.tape.JacobianTape() as tape1:
qml.RX(x[0], wires=[0])
qml.RY(x[1], wires=[1])
qml.CNOT(wires=[0, 1])
qml.var(qml.PauliZ(0) @ qml.PauliX(1))
<h4>New operation</h4>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels weird to have this as a separate category with only a single new operation 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. It doesn't really fit any of the other categories, so I've added it into Improvements. An alternative to that would be creating a general catch-all category that we can use for each release: e.g., "Further new features" or so.


with qml.tape.JacobianTape() as tape2:
qml.RX(x[0], wires=0)
qml.RY(x[0], wires=1)
qml.CNOT(wires=[0, 1])
qml.probs(wires=1)

result = execute(
[tape1, tape2], dev,
gradient_fn=qml.gradients.param_shift,
interface="autograd"
)
return result[0] + result[1][0, 0]
* Added a new `SISWAP` operation and a `SQISW` alias with support to the
`default_qubit` device.
[#1563](https://github.com/PennyLaneAI/pennylane/pull/1563)
antalszava marked this conversation as resolved.
Show resolved Hide resolved

res = qml.grad(cost_fn)(params)
```

<h3>Improvements</h3>

* The `frobenius_inner_product` function has been moved to the `qml.math`
module, and is now differentiable using all autodiff frameworks.
[(#1388)](https://github.com/PennyLaneAI/pennylane/pull/1388)

* A warning is raised to inform the user that specifying a list of shots is
only supported for `QubitDevice` based devices.
[(#1659)](https://github.com/PennyLaneAI/pennylane/pull/1659)
josh146 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -346,13 +379,13 @@
selected or deselected during local execution of tests.
[(#1633)](https://github.com/PennyLaneAI/pennylane/pull/1633)

* Hamiltonians are now natively supported on the `default.qubit` device if `shots=None`.
* Hamiltonians are now natively supported on the `default.qubit` device if `shots=None`.
This makes VQE workflows a lot faster in some cases.
antalszava marked this conversation as resolved.
Show resolved Hide resolved
[(#1551)](https://github.com/PennyLaneAI/pennylane/pull/1551)
[(#1596)](https://github.com/PennyLaneAI/pennylane/pull/1596)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this one I would probably move to the 'Faster Hamiltonian' section of 'New Features'. I wonder if @soranjh has any benchmark plots we could include in order to show-off the speed improvement

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I have some data. Please let me prepare a clean figure.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
How does it look? Please let me know if any correction needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome @soranjh 💪

Only suggestion is minor - might be good to modify the title to say

Time per 1 VQE step for H2 on default.qubit

to avoid readers thinking this speedup occurs for hardware devices/finite-shots

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Another version

Copy link
Contributor

@soranjh soranjh Sep 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
(edited the font size)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the latest plot in fa6df8f as part of #1671.


* A gradient recipe for Hamiltonian coefficients has been added. This makes it possible
to compute parameter-shift gradients of these coefficients on devices that natively
* A gradient recipe for Hamiltonian coefficients has been added. This makes it possible
to compute parameter-shift gradients of these coefficients on devices that natively
support Hamiltonians.
[(#1551)](https://github.com/PennyLaneAI/pennylane/pull/1551)
antalszava marked this conversation as resolved.
Show resolved Hide resolved

Expand All @@ -362,8 +395,8 @@
* The `MultiControlledX` class now inherits from `Operation` instead of `ControlledQubitUnitary` which makes the `MultiControlledX` gate a non-parameterized gate.
[(#1557)](https://github.com/PennyLaneAI/pennylane/pull/1557)

* The `utils.sparse_hamiltonian` function can now deal with non-integer
wire labels, and it throws an error for the edge case of observables that are
* The `utils.sparse_hamiltonian` function can now deal with non-integer
wire labels, and it throws an error for the edge case of observables that are
created from multi-qubit operations.
[(#1550)](https://github.com/PennyLaneAI/pennylane/pull/1550)

Expand Down Expand Up @@ -424,10 +457,10 @@ and requirements-ci.txt (unpinned). This latter would be used by the CI.

antalszava marked this conversation as resolved.
Show resolved Hide resolved
* The QFT operation is moved to template
[(#1548)](https://github.com/PennyLaneAI/pennylane/pull/1548)
antalszava marked this conversation as resolved.
Show resolved Hide resolved
* The `qml.ResetError` is now supported for `default.mixed` device.

* The `qml.ResetError` is now supported for `default.mixed` device.
[(#1541)](https://github.com/PennyLaneAI/pennylane/pull/1541)

* `QNode.diff_method` will now reflect which method was selected from `diff_method="best"`.
[(#1568)](https://github.com/PennyLaneAI/pennylane/pull/1568)

antalszava marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -457,13 +490,13 @@ and requirements-ci.txt (unpinned). This latter would be used by the CI.
Temporary backward compatibility has been added to support the use of `_stepsize` for one
antalszava marked this conversation as resolved.
Show resolved Hide resolved
release cycle. `update_stepsize` method is deprecated.
[(#1625)](https://github.com/PennyLaneAI/pennylane/pull/1625)


<h3>Bug fixes</h3>

* Fix bug with norm and Jax tracers (jit) when using `QubiStateVector`.
[(#1649)](https://github.com/PennyLaneAI/pennylane/pull/1649)
antalszava marked this conversation as resolved.
Show resolved Hide resolved

* Fix bug in edge case of single-qubit `zyz_decomposition` when only
off-diagonal elements are present.
[(#1643)](https://github.com/PennyLaneAI/pennylane/pull/1643)
Expand Down Expand Up @@ -494,9 +527,9 @@ and requirements-ci.txt (unpinned). This latter would be used by the CI.
* The `qml.Identity` operation is placed under the sections Qubit observables and CV observables.
[(#1576)](https://github.com/PennyLaneAI/pennylane/pull/1576)

* Updated the documentation of `qml.grouping`, `qml.kernels` and `qml.qaoa` modules to present
* Updated the documentation of `qml.grouping`, `qml.kernels` and `qml.qaoa` modules to present
the list of functions first followed by the technical details of the module.
[(#1581)](https://github.com/PennyLaneAI/pennylane/pull/1581)
[(#1581)](https://github.com/PennyLaneAI/pennylane/pull/1581)

* Recategorized Qubit operations into new and existing categories so that code for each
operation is easier to locate.
Expand All @@ -506,12 +539,14 @@ and requirements-ci.txt (unpinned). This latter would be used by the CI.

This release contains contributions from (in alphabetical order):

Vishnu Ajith, Akash Narayanan B, Thomas Bromley, Olivia Di Matteo, Sahaj Dhamija, Tanya Garg, Josh Izaac,
Prateek Jain, Ankit Khandelwal, Christina Lee, Ian McLean, Johannes Jakob Meyer, Romain Moyard, Esteban Payares,
Pratul Saini, Maria Schuld, Arshpreet Singh, Ingrid Strandberg, Slimane Thabet, Antal Száva, David Wierichs,
Vincent Wong.
Vishnu Ajith, Akash Narayanan B, Thomas Bromley, Olivia Di Matteo, Sahaj
Dhamija, Tanya Garg, Anthony Hayes, Theodor Isacsson, Josh Izaac, Prateek Jain,
Ankit Khandelwal, Nathan Killoran, Christina Lee, Ian McLean, Johannes Jakob
Meyer, Romain Moyard, Lee James O'Riordan, Esteban Payares, Pratul Saini, Maria
Schuld, Arshpreet Singh, Ingrid Strandberg, Antal Száva, Slimane Thabet, David
Wierichs, Vincent Wong.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A massive contributor list 💯

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that Jay is missing from this list, I recall him doing code review for bugs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! Thanks for that.


# Release 0.17.0 (current release)
# Release 0.17.0

<h3>New features since the last release</h3>

Expand Down Expand Up @@ -1066,7 +1101,7 @@ Vincent Wong.
* Fixed a bug in the initialization of `QubitUnitary` where the size of
the matrix was not checked against the number of wires.
[(#1439)](https://github.com/PennyLaneAI/pennylane/pull/1439)

<h3>Documentation</h3>

* Improved Contribution Guide and Pull Requests Guide.
Expand Down
2 changes: 1 addition & 1 deletion pennylane/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.18.0-dev"
__version__ = "0.18.0"