|
2 | 2 |
|
3 | 3 | <h3>New features since last release</h3>
|
4 | 4 |
|
5 |
| -* Adds a new device, `default.qubit.tf`, a pure-state qubit simulator written using TensorFlow. |
| 5 | +<h4>New and improved simulators</h4> |
| 6 | + |
| 7 | +* Added a new device, `default.qubit.tf`, a pure-state qubit simulator written using TensorFlow. |
6 | 8 | As a result, it supports classical backpropagation as a means to compute the Jacobian. This can
|
7 |
| - be faster than the parameter-shift rule for analytic quantum gradients |
| 9 | + be faster than the parameter-shift rule for computing quantum gradients |
8 | 10 | when the number of parameters to be optimized is large.
|
9 | 11 |
|
10 | 12 | `default.qubit.tf` is designed to be used with end-to-end classical backpropagation
|
|
34 | 36 | [documentation](https://pennylane.ai/en/stable/code/api/pennylane.beta.plugins.DefaultQubitTF.html)
|
35 | 37 | for more details.
|
36 | 38 |
|
37 |
| -* Contains the new template `UCCSD` implementing the Unitary Coupled-Cluster (UCCSD) ansatz |
38 |
| - to perform VQE-based quantum chemistry simulations using PennyLane-QChem. |
39 |
| - [(#654)](https://github.com/XanaduAI/pennylane/pull/654) |
40 |
| - |
| 39 | +* The [default.tensor plugin](https://github.com/XanaduAI/pennylane/blob/master/pennylane/beta/plugins/default_tensor.py) has been significantly upgraded. It now allows two different |
| 40 | + tensor network representations to be used: `"exact"` and `"mps"`. The former uses a |
| 41 | + exact factorized representation of quantum states, while the latter uses a matrix product state |
| 42 | + representation. |
| 43 | + ([#572](https://github.com/XanaduAI/pennylane/pull/572)) |
| 44 | + ([#599](https://github.com/XanaduAI/pennylane/pull/599)) |
| 45 | + |
| 46 | +<h4>New machine learning functionality and integrations</h4> |
| 47 | + |
41 | 48 | * PennyLane QNodes can now be converted into Torch layers, allowing for creation of quantum and
|
42 | 49 | hybrid models using the `torch.nn` API.
|
43 | 50 | [(#588)](https://github.com/XanaduAI/pennylane/pull/588)
|
44 | 51 |
|
45 | 52 | A PennyLane QNode can be converted into a `torch.nn` layer using the `qml.qnn.TorchLayer` class:
|
46 | 53 |
|
47 |
| - ```python |
48 |
| - @qml.qnode(dev) |
49 |
| - def qnode(inputs, weights_0, weight_1): |
50 |
| - # define the circuit |
51 |
| - # ... |
| 54 | + ```pycon |
| 55 | + >>> @qml.qnode(dev) |
| 56 | + ... def qnode(inputs, weights_0, weight_1): |
| 57 | + ... # define the circuit |
| 58 | + ... # ... |
52 | 59 |
|
53 |
| - weight_shapes = {"weights_0": 3, "weight_1": 1} |
54 |
| - qlayer = qml.qnn.TorchLayer(qnode, weight_shapes) |
| 60 | + >>> weight_shapes = {"weights_0": 3, "weight_1": 1} |
| 61 | + >>> qlayer = qml.qnn.TorchLayer(qnode, weight_shapes) |
55 | 62 | ```
|
56 |
| - |
| 63 | + |
57 | 64 | A hybrid model can then be easily constructed:
|
58 | 65 |
|
59 |
| - ```python |
60 |
| - model = torch.nn.Sequential(qlayer, torch.nn.Linear(2, 2)) |
| 66 | + ```pycon |
| 67 | + >>> model = torch.nn.Sequential(qlayer, torch.nn.Linear(2, 2)) |
61 | 68 | ```
|
62 | 69 | * Added a new "reversible" differentiation method which can be used in simulators, but not hardware.
|
| 70 | + |
63 | 71 | The reversible approach is similar to backpropagation, but trades off extra computation for
|
64 | 72 | enhanced memory efficiency. Where backpropagation caches the state tensors at each step during
|
65 |
| - a forward pass, the reversible method only caches the final pre-measurement state. Compared to |
66 |
| - the parameter-shift method, the reversible method can be faster or slower, depending on the |
67 |
| - density and location of parametrized gates in a circuit (circuits with higher density of |
68 |
| - parametrized gates near the end of the circuit will see a benefit). |
| 73 | + a simulated evolution, the reversible method only caches the final pre-measurement state. |
| 74 | + |
| 75 | + Compared to the parameter-shift method, the reversible method can be faster or slower, |
| 76 | + depending on the density and location of parametrized gates in a circuit |
| 77 | + (circuits with higher density of parametrized gates near the end of the circuit will see a benefit). |
69 | 78 | [(#670)](https://github.com/XanaduAI/pennylane/pull/670)
|
| 79 | + |
| 80 | + ```pycon |
| 81 | + >>> dev = qml.device("default.qubit", wires=2) |
| 82 | + ... @qml.qnode(dev, diff_method="reversible") |
| 83 | + ... def circuit(x): |
| 84 | + ... qml.RX(x, wires=0) |
| 85 | + ... qml.RX(x, wires=0) |
| 86 | + ... qml.CNOT(wires=[0,1]) |
| 87 | + ... return qml.expval(qml.PauliZ(0)) |
| 88 | + >>> qml.grad(circuit)(0.5) |
| 89 | + (array(-0.47942554),) |
| 90 | + ``` |
| 91 | + |
| 92 | +<h4>New templates and cost functions</h4> |
70 | 93 |
|
71 |
| -* Contains the new template `DoubleExcitationUnitary` implementing the quantum circuit to |
72 |
| - exponentiate the Coupled-Cluster double excitation operator. This template is required to |
73 |
| - build the Unitary Coupled-Cluster Singles and Doubles (UCCSD) ansatz for VQE simulations. |
| 94 | +* Added the new templates `UCCSD`, `SingleExcitationUnitary`, and`DoubleExcitationUnitary`, |
| 95 | + which together implement the Unitary Coupled-Cluster Singles and Doubles (UCCSD) ansatz |
| 96 | + to perform VQE-based quantum chemistry simulations using PennyLane-QChem. |
| 97 | + [(#622)](https://github.com/XanaduAI/pennylane/pull/622) |
74 | 98 | [(#638)](https://github.com/XanaduAI/pennylane/pull/638)
|
| 99 | + [(#654)](https://github.com/XanaduAI/pennylane/pull/654) |
75 | 100 | [(#659)](https://github.com/XanaduAI/pennylane/pull/659)
|
76 |
| - |
77 |
| -* Contains the new template `SingleExcitationUnitary` implementing the quantum circuit to |
78 |
| - exponentiate the Coupled-Cluster single excitation operator. This template is required to |
79 |
| - build the Unitary Coupled-Cluster Singles and Doubles (UCCSD) ansatz for VQE simulations. |
80 | 101 | [(#622)](https://github.com/XanaduAI/pennylane/pull/622)
|
81 |
| - [(#659)](https://github.com/XanaduAI/pennylane/pull/659) |
82 | 102 |
|
83 |
| -* Added module `pennylane.qnn.cost` with class `SquaredErrorLoss`. The module will contain classes |
84 |
| - to calculate losses and costs on circuits with trainable parameters. |
| 103 | +* Added module `pennylane.qnn.cost` with class `SquaredErrorLoss`. The module contains classes |
| 104 | + to calculate losses and cost functions on circuits with trainable parameters. |
85 | 105 | [(#642)](https://github.com/XanaduAI/pennylane/pull/642)
|
86 | 106 |
|
87 |
| -* The ``default.tensor`` plugin has been significantly upgraded. It now allows two different |
88 |
| - tensor network representations to be used: `"exact"` and `"mps"`. The former uses a |
89 |
| - exact factorized representation of quantum states, while the latter uses a matrix product state |
90 |
| - representation. |
91 |
| - ([#572](https://github.com/XanaduAI/pennylane/pull/572)) |
92 |
| - ([#599](https://github.com/XanaduAI/pennylane/pull/599)) |
93 |
| - |
94 | 107 | <h3>Improvements</h3>
|
95 | 108 |
|
96 |
| -* Adds `decomposition` method to PauliX, PauliY, PauliZ, S, T, Hadamard, and PhaseShift gates, which |
97 |
| - decomposes each of these gates into rotation gates. |
98 |
| - [(#668)](https://github.com/XanaduAI/pennylane/pull/668) |
99 |
| - |
100 |
| -* The `CircuitGraph` class now supports serializing contained circuit operations |
101 |
| - and measurement basis rotations to an OpenQASM2.0 script via the new |
102 |
| - `CircuitGraph.to_openqasm()` method. |
103 |
| - [(#623)](https://github.com/XanaduAI/pennylane/pull/623) |
104 |
| - |
105 |
| -* The QNode Torch interface now inspects QNode positional arguments. |
106 |
| - If any argument does not have the attribute `requires_grad=True`, it |
107 |
| - is automatically excluded from quantum gradient computations. |
108 |
| - [(#652)](https://github.com/XanaduAI/pennylane/pull/652) |
109 |
| - [(#660)](https://github.com/XanaduAI/pennylane/pull/660) |
110 |
| - |
111 |
| -* The QNode TF interface now inspects QNode positional arguments. |
112 |
| - If any argument is not being watched by a `tf.GradientTape()`, |
113 |
| - it is automatically excluded from quantum gradient computations. |
114 |
| - [(#655)](https://github.com/XanaduAI/pennylane/pull/655) |
115 |
| - [(#660)](https://github.com/XanaduAI/pennylane/pull/660) |
116 |
| - |
117 |
| -* QNodes have two new public methods: `QNode.set_trainable_args()` and `QNode.get_trainable_args()`. |
118 |
| - These are designed to be called by interfaces, to specify to the QNode which of its |
119 |
| - input arguments are differentiable. Arguments which are non-differentiable will not be converted |
120 |
| - to PennyLane Variable objects within the QNode. |
121 |
| - [(#660)](https://github.com/XanaduAI/pennylane/pull/660) |
122 |
| - |
123 |
| -* A significant refactor with respect to how QNodes and interfaces mark quantum function |
| 109 | +* A significant improvement with respect to how QNodes and interfaces mark quantum function |
124 | 110 | arguments as differentiable when using Autograd, designed to improve performance and make
|
125 | 111 | QNodes more intuitive.
|
126 | 112 | [(#648)](https://github.com/XanaduAI/pennylane/pull/648)
|
|
141 | 127 | The ability to pass `argnum` has been retained for backwards compatibility, and
|
142 | 128 | if present the old behaviour persists.
|
143 | 129 |
|
| 130 | +* The QNode Torch interface now inspects QNode positional arguments. |
| 131 | + If any argument does not have the attribute `requires_grad=True`, it |
| 132 | + is automatically excluded from quantum gradient computations. |
| 133 | + [(#652)](https://github.com/XanaduAI/pennylane/pull/652) |
| 134 | + [(#660)](https://github.com/XanaduAI/pennylane/pull/660) |
| 135 | + |
| 136 | +* The QNode TF interface now inspects QNode positional arguments. |
| 137 | + If any argument is not being watched by a `tf.GradientTape()`, |
| 138 | + it is automatically excluded from quantum gradient computations. |
| 139 | + [(#655)](https://github.com/XanaduAI/pennylane/pull/655) |
| 140 | + [(#660)](https://github.com/XanaduAI/pennylane/pull/660) |
| 141 | + |
| 142 | +* QNodes have two new public methods: `QNode.set_trainable_args()` and `QNode.get_trainable_args()`. |
| 143 | + These are designed to be called by interfaces, to specify to the QNode which of its |
| 144 | + input arguments are differentiable. Arguments which are non-differentiable will not be converted |
| 145 | + to PennyLane Variable objects within the QNode. |
| 146 | + [(#660)](https://github.com/XanaduAI/pennylane/pull/660) |
| 147 | + |
| 148 | +* Added `decomposition` method to PauliX, PauliY, PauliZ, S, T, Hadamard, and PhaseShift gates, which |
| 149 | + decomposes each of these gates into rotation gates. |
| 150 | + [(#668)](https://github.com/XanaduAI/pennylane/pull/668) |
| 151 | + |
| 152 | +* The `CircuitGraph` class now supports serializing contained circuit operations |
| 153 | + and measurement basis rotations to an OpenQASM2.0 script via the new |
| 154 | + `CircuitGraph.to_openqasm()` method. |
| 155 | + [(#623)](https://github.com/XanaduAI/pennylane/pull/623) |
| 156 | + |
144 | 157 | <h3>Breaking changes</h3>
|
145 | 158 |
|
146 | 159 | * Removes support for Python 3.5.
|
147 | 160 | [(#639)](https://github.com/XanaduAI/pennylane/pull/639)
|
148 | 161 |
|
149 | 162 | <h3>Documentation</h3>
|
| 163 | +* Various small typos were fixed. |
150 | 164 |
|
151 | 165 | <h3>Bug fixes</h3>
|
152 | 166 |
|
|
0 commit comments