-
PennyLane QNodes can now be converted into Keras layers, allowing for creation of quantum and hybrid models using the Keras API. (#529)
n_qubits = 2 dev = qml.device("default.qubit", wires=n_qubits) @qml.qnode(dev) def qnode(inputs, weights_0, weight_1): qml.RX(inputs, wires=0) qml.Rot(*weights_0, wires=0) qml.RY(weight_1, wires=1) qml.CNOT(wires=[0, 1]) return qml.expval(qml.PauliZ(0)), qml.expval(qml.PauliZ(1))
The above QNode can be converted into a Keras layer using the
KerasLayer
class:from pennylane.qnn import KerasLayer weight_shapes = {"weights_0": 3, "weight_1": 1} qlayer = qml.qnn.KerasLayer(qnode, weight_shapes, output_dim=2)
A hybrid model can then be easily constructed:
model = tf.keras.models.Sequential([qlayer, tf.keras.layers.Dense(2)])
-
Added the
SimplifiedTwoDesign
template, which implements the circuit design ofCerezo et al. (2020) <https://arxiv.org/abs/2001.00550>
_. (#556) -
Added the
BasicEntanglerLayers
template, which is a simple layer architecture of rotations and CNOT nearest-neighbour entanglers. (#555) -
PennyLane now offers a broadcasting function to easily construct templates:
qml.broadcast()
takes single quantum operations or other templates and applies them to wires in a specific pattern. (#515) (#522) (#526)For example, we can use broadcast to repeat a custom template across multiple wires:
from pennylane.templates import template @template def mytemplate(pars, wires): qml.Hadamard(wires=wires) qml.RY(pars, wires=wires) dev = qml.device('default.qubit', wires=3) @qml.qnode(dev) def circuit(pars): qml.broadcast(mytemplate, pattern="single", wires=[0,1,2], parameters=pars) return qml.expval(qml.PauliZ(0))
Executing this circuit:
>>> circuit([1, 1, 0.1]) -0.841470984807896 >>> print(circuit.draw()) 0: ──H──RY(1.0)──┤ ⟨Z⟩ 1: ──H──RY(1.0)──┤ 2: ──H──RY(0.1)──┤
For other available patterns, see the broadcast function documentation.
-
Added the
qml.qnodes.PassthruQNode
class for simulated QNodes that appear as white boxes to an external autodifferentiation (AD) framework, and hence can be directly differentiated by it. Note that the simulator device executing the PassthruQNode has to be compatible with the external AD framework. (#488)Currently the only such device supported by PennyLane is
default.tensor.tf
, compatible with the'tf'
inteface using TensorFlow 2:from pennylane.qnodes import PassthruQNode dev = qml.device('default.tensor.tf', wires=2) def circuit(params): qml.RX(params[0], wires=0) qml.RX(params[1], wires=1) qml.CNOT(wires=[0, 1]) return qml.expval(qml.PauliZ(0)) qnode = PassthruQNode(circuit, dev) params = tf.Variable([0.3, 0.1]) with tf.GradientTape() as tape: tape.watch(params) res = qnode(params) grad = tape.gradient(res, params)
-
Added a step size keyword argument to the
qnode
decorator,QNode
andJacobianQNode
classes to enable setting the step size when using finite difference methods. (#530) -
The decomposition for the
CRY
gate now uses the simpler formRY @ CNOT @ RY @ CNOT
(#547) -
The circuit drawer now displays inverted operations, as well as wires where probabilities are returned from the device: (#540)
>>> @qml.qnode(dev) ... def circuit(theta): ... qml.RX(theta, wires=0) ... qml.CNOT(wires=[0, 1]) ... qml.S(wires=1).inv() ... return qml.probs(wires=[0, 1]) >>> circuit(0.2) array([0.99003329, 0. , 0. , 0.00996671]) >>> print(circuit.draw()) 0: ──RX(0.2)──╭C───────╭┤ Probs 1: ───────────╰X──S⁻¹──╰┤ Probs
-
The underlying queuing system was refactored, removing the
qml._current_context
property that held the currently activeQNode
orOperationRecorder
. Now, all objects that expose a queue for operations inherit fromQueuingContext
and register their queue globally. (#548)
-
Fixed a bug in the
StronglyEntanglingLayers
template, allowing it to work correctly when applied to a single wire. (544) -
Fixed a bug when inverting operations with decompositions; operations marked as inverted are now correctly inverted when the fallback decomposition is called. (#543)
-
The
QNode.print_applied()
method now correctly displays wires whereqml.prob()
is being returned. #542
This release contains contributions from (in alphabetical order):
Ville Bergholm, Thomas Bromley, Johannes Jakob Meyer, Maria Schuld, Antal Száva.
- Beginning of support for Python 3.8, with the test suite now being run in a Python 3.8 environment. (#501)
- Present templates as a gallery of thumbnails showing the basic circuit architecture. (#499)
-
Fixed a bug where multiplying a QNode parameter by 0 caused a divide by zero error when calculating the parameter shift formula. (#512)
-
Fixed a bug where the shape of differentiable QNode arguments was being cached on the first construction, leading to indexing errors if the QNode was re-evaluated if the argument changed shape. (#505)
This release contains contributions from (in alphabetical order):
Ville Bergholm, Josh Izaac, Maria Schuld, Antal Száva.
-
Added a quantum chemistry package,
pennylane.qchem
, which supports integration with OpenFermion, Psi4, PySCF, and OpenBabel. (#453)Features include:
- Generate the qubit Hamiltonians directly starting with the atomic structure of the molecule.
- Calculate the mean-field (Hartree-Fock) electronic structure of molecules.
- Allow to define an active space based on the number of active electrons and active orbitals.
- Perform the fermionic-to-qubit transformation of the electronic Hamiltonian by using different functions implemented in OpenFermion.
- Convert OpenFermion's QubitOperator to a Pennylane
Hamiltonian
class. - Perform a Variational Quantum Eigensolver (VQE) computation with this Hamiltonian in PennyLane.
Check out the quantum chemistry quickstart, as well the quantum chemistry and VQE tutorials.
-
PennyLane now has some functions and classes for creating and solving VQE problems. (#467)
-
qml.Hamiltonian
: a lightweight class for representing qubit Hamiltonians -
qml.VQECost
: a class for quickly constructing a differentiable cost function given a circuit ansatz, Hamiltonian, and one or more devices>>> H = qml.vqe.Hamiltonian(coeffs, obs) >>> cost = qml.VQECost(ansatz, hamiltonian, dev, interface="torch") >>> params = torch.rand([4, 3]) >>> cost(params) tensor(0.0245, dtype=torch.float64)
-
-
Added a circuit drawing feature that provides a text-based representation of a QNode instance. It can be invoked via
qnode.draw()
. The user can specify to display variable names instead of variable values and choose either an ASCII or Unicode charset. (#446)Consider the following circuit as an example:
@qml.qnode(dev) def qfunc(a, w): qml.Hadamard(0) qml.CRX(a, wires=[0, 1]) qml.Rot(w[0], w[1], w[2], wires=[1]) qml.CRX(-a, wires=[0, 1]) return qml.expval(qml.PauliZ(0) @ qml.PauliZ(1))
We can draw the circuit after it has been executed:
>>> result = qfunc(2.3, [1.2, 3.2, 0.7]) >>> print(qfunc.draw()) 0: ──H──╭C────────────────────────────╭C─────────╭┤ ⟨Z ⊗ Z⟩ 1: ─────╰RX(2.3)──Rot(1.2, 3.2, 0.7)──╰RX(-2.3)──╰┤ ⟨Z ⊗ Z⟩ >>> print(qfunc.draw(charset="ascii")) 0: --H--+C----------------------------+C---------+| <Z @ Z> 1: -----+RX(2.3)--Rot(1.2, 3.2, 0.7)--+RX(-2.3)--+| <Z @ Z> >>> print(qfunc.draw(show_variable_names=True)) 0: ──H──╭C─────────────────────────────╭C─────────╭┤ ⟨Z ⊗ Z⟩ 1: ─────╰RX(a)──Rot(w[0], w[1], w[2])──╰RX(-1*a)──╰┤ ⟨Z ⊗ Z⟩
-
Added
QAOAEmbedding
and its parameter initialization as a new trainable template. (#442) -
Added the
qml.probs()
measurement function, allowing QNodes to differentiate variational circuit probabilities on simulators and hardware. (#432)@qml.qnode(dev) def circuit(x): qml.Hadamard(wires=0) qml.RY(x, wires=0) qml.RX(x, wires=1) qml.CNOT(wires=[0, 1]) return qml.probs(wires=[0])
Executing this circuit gives the marginal probability of wire 1:
>>> circuit(0.2) [0.40066533 0.59933467]
QNodes that return probabilities fully support autodifferentiation.
-
Added the convenience load functions
qml.from_pyquil
,qml.from_quil
andqml.from_quil_file
that convert pyQuil objects and Quil code to PennyLane templates. This feature requires version 0.8 or above of the PennyLane-Forest plugin. (#459) -
Added a
qml.inv
method that inverts templates and sequences of Operations. Added a@qml.template
decorator that makes templates return the queued Operations. (#462)For example, using this function to invert a template inside a QNode:
@qml.template def ansatz(weights, wires): for idx, wire in enumerate(wires): qml.RX(weights[idx], wires=[wire]) for idx in range(len(wires) - 1): qml.CNOT(wires=[wires[idx], wires[idx + 1]]) dev = qml.device('default.qubit', wires=2) @qml.qnode(dev) def circuit(weights): qml.inv(ansatz(weights, wires=[0, 1])) return qml.expval(qml.PauliZ(0) @ qml.PauliZ(1))
-
Added the
QNodeCollection
container class, that allows independent QNodes to be stored and evaluated simultaneously. Experimental support for asynchronous evaluation of contained QNodes is provided with theparallel=True
keyword argument. (#466) -
Added a high level
qml.map
function, that maps a quantum circuit template over a list of observables or devices, returning aQNodeCollection
. (#466)For example:
>>> def my_template(params, wires, **kwargs): >>> qml.RX(params[0], wires=wires[0]) >>> qml.RX(params[1], wires=wires[1]) >>> qml.CNOT(wires=wires) >>> obs_list = [qml.PauliX(0) @ qml.PauliZ(1), qml.PauliZ(0) @ qml.PauliX(1)] >>> dev = qml.device("default.qubit", wires=2) >>> qnodes = qml.map(my_template, obs_list, dev, measure="expval") >>> qnodes([0.54, 0.12]) array([-0.06154835 0.99280864])
-
Added high level
qml.sum
,qml.dot
,qml.apply
functions that act on QNode collections. (#466)qml.apply
allows vectorized functions to act over the entire QNode collection:>>> qnodes = qml.map(my_template, obs_list, dev, measure="expval") >>> cost = qml.apply(np.sin, qnodes) >>> cost([0.54, 0.12]) array([-0.0615095 0.83756375])
qml.sum
andqml.dot
take the sum of a QNode collection, and a dot product of tensors/arrays/QNode collections, respectively.
- Deprecated the old-style
QNode
such that only the new-styleQNode
and its syntax can be used, moved all related files from thepennylane/beta
folder topennylane
. (#440)
-
Added the
Tensor.prune()
method and theTensor.non_identity_obs
property for extracting non-identity instances from the observables making up aTensor
instance. (#498) -
Renamed the
expt.tensornet
andexpt.tensornet.tf
devices todefault.tensor
anddefault.tensor.tf
. (#495) -
Added a serialization method to the
CircuitGraph
class that is used to create a unique hash for each quantum circuit graph. (#470) -
Added the
Observable.eigvals
method to return the eigenvalues of observables. (#449) -
Added the
Observable.diagonalizing_gates
method to return the gates that diagonalize an observable in the computational basis. (#454) -
Added the
Operator.matrix
method to return the matrix representation of an operator in the computational basis. (#454) -
Added a
QubitDevice
class which implements common functionalities of plugin devices such that plugin devices can rely on these implementations. The newQubitDevice
also includes a newexecute
method, which allows for more convenient plugin design. In addition,QubitDevice
also unifies the way samples are generated on qubit-based devices. (#452) (#473) -
Improved documentation of
AmplitudeEmbedding
andBasisEmbedding
templates. (#441) (#439) -
Codeblocks in the documentation now have a 'copy' button for easily copying examples. (#437)
- Update the developers plugin guide to use QubitDevice. (#483)
- Fixed a bug in
CVQNode._pd_analytic
, where non-descendant observables were not Heisenberg-transformed before evaluating the partial derivatives when using the order-2 parameter-shift method, resulting in an erroneous Jacobian for some circuits. (#433)
This release contains contributions from (in alphabetical order):
Juan Miguel Arrazola, Ville Bergholm, Alain Delgado Gran, Olivia Di Matteo, Theodor Isacsson, Josh Izaac, Soran Jahangiri, Nathan Killoran, Johannes Jakob Meyer, Zeyue Niu, Maria Schuld, Antal Száva.
-
Custom padding constant in
AmplitudeEmbedding
is supported (see 'Breaking changes'.) (#419) -
StronglyEntanglingLayer
andRandomLayer
now work with a single wire. (#409) (#413) -
Added support for applying the inverse of an
Operation
within a circuit. (#377) -
Added an
OperationRecorder()
context manager, that allows templates and quantum functions to be executed while recording events. The recorder can be used with and without QNodes as a debugging utility. (#388) -
Operations can now specify a decomposition that is used when the desired operation is not supported on the target device. (#396)
-
The ability to load circuits from external frameworks as templates has been added via the new
qml.load()
function. This feature requires plugin support --- this initial release provides support for Qiskit circuits and QASM files whenpennylane-qiskit
is installed, via the functionsqml.from_qiskit
andqml.from_qasm
. (#418) -
An experimental tensor network device has been added (#416) (#395) (#394) (#380)
-
An experimental tensor network device which uses TensorFlow for backpropagation has been added (#427)
-
Custom padding constant in
AmplitudeEmbedding
is supported (see 'Breaking changes'.) (#419)
-
The
pad
parameter inAmplitudeEmbedding()
is now eitherNone
(no automatic padding), or a number that is used as the padding constant. (#419) -
Initialization functions now return a single array of weights per function. Utilities for multi-weight templates
Interferometer()
andCVNeuralNetLayers()
are provided. (#412) -
The single layer templates
RandomLayer()
,CVNeuralNetLayer()
andStronglyEntanglingLayer()
have been turned into private functions_random_layer()
,_cv_neural_net_layer()
and_strongly_entangling_layer()
. Recommended use is now via the correspondingLayers()
templates. (#413)
-
Added extensive input checks in templates. (#419)
-
Templates integration tests are rewritten - now cover keyword/positional argument passing, interfaces and combinations of templates. (#409) (#419)
-
State vector preparation operations in the
default.qubit
plugin can now be applied to subsets of wires, and are restricted to being the first operation in a circuit. (#346) -
The
QNode
class is split into a hierarchy of simpler classes. (#354) (#398) (#415) (#417) (#425) -
Added the gates U1, U2 and U3 parametrizing arbitrary unitaries on 1, 2 and 3 qubits and the Toffoli gate to the set of qubit operations. (#396)
-
Changes have been made to accomodate the movement of the main function in
pytest._internal
topytest._internal.main
in pip 19.3. (#404) -
Added the templates
BasisStatePreparation
andMottonenStatePreparation
that use gates to prepare a basis state and an arbitrary state respectively. (#336) -
Added decompositions for
BasisState
andQubitStateVector
based on state preparation templates. (#414) -
Replaces the pseudo-inverse in the quantum natural gradient optimizer (which can be numerically unstable) with
np.linalg.solve
. (#428)
This release contains contributions from (in alphabetical order):
Ville Bergholm, Josh Izaac, Nathan Killoran, Angus Lowe, Johannes Jakob Meyer, Oluwatobi Ogunbayo, Maria Schuld, Antal Száva.
- Added a
print_applied
method to QNodes, allowing the operation and observable queue to be printed as last constructed. (#378)
-
A new
Operator
base class is introduced, which is inherited by both theObservable
class and theOperation
class. (#355) -
Removed deprecated
@abstractproperty
decorators in_device.py
. (#374) -
The
CircuitGraph
class is updated to deal withOperation
instances directly. (#344) -
Comprehensive gradient tests have been added for the interfaces. (#381)
-
The new restructured documentation has been polished and updated. (#387) (#375) (#372) (#370) (#369) (#367) (#364)
-
Added all modules, classes, and functions to the API section in the documentation. (#373)
- Replaces the existing
np.linalg.norm
normalization with hand-coded normalization, allowingAmplitudeEmbedding
to be used with differentiable parameters. AmplitudeEmbedding tests have been added and improved. (#376)
This release contains contributions from (in alphabetical order):
Ville Bergholm, Josh Izaac, Nathan Killoran, Maria Schuld, Antal Száva
-
The devices
default.qubit
anddefault.gaussian
have a new initialization parameteranalytic
that indicates if expectation values and variances should be calculated analytically and not be estimated from data. (#317) -
Added C-SWAP gate to the set of qubit operations (#330)
-
The TensorFlow interface has been renamed from
"tfe"
to"tf"
, and now supports TensorFlow 2.0. (#337) -
Added the S and T gates to the set of qubit operations. (#343)
-
Tensor observables are now supported within the
expval
,var
, andsample
functions, by using the@
operator. (#267)
- The argument
n
specifying the number of samples in the methodDevice.sample
was removed. Instead, the method will always returnDevice.shots
many samples. (#317)
-
The number of shots / random samples used to estimate expectation values and variances,
Device.shots
, can now be changed after device creation. (#317) -
Unified import shortcuts to be under qml in qnode.py and test_operation.py (#329)
-
The quantum natural gradient now uses
scipy.linalg.pinvh
which is more efficient for symmetric matrices than the previously usedscipy.linalg.pinv
. (#331) -
The deprecated
qml.expval.Observable
syntax has been removed. (#267) -
Remainder of the unittest-style tests were ported to pytest. (#310)
-
The
do_queue
argument for operations now only takes effect within QNodes. Outside of QNodes, operations can now be instantiated without needing to specifydo_queue
. (#359)
-
The docs are rewritten and restructured to contain a code introduction section as well as an API section. (#314)
-
Added Ising model example to the tutorials (#319)
-
Added tutorial for QAOA on MaxCut problem (#328)
-
Added QGAN flow chart figure to its tutorial (#333)
-
Added missing figures for gallery thumbnails of state-preparation and QGAN tutorials (#326)
-
Fixed typos in the state preparation tutorial (#321)
-
Fixed bug in VQE tutorial 3D plots (#327)
- Fixed typo in measurement type error message in qnode.py (#341)
This release contains contributions from (in alphabetical order):
Shahnawaz Ahmed, Ville Bergholm, Aroosa Ijaz, Josh Izaac, Nathan Killoran, Angus Lowe, Johannes Jakob Meyer, Maria Schuld, Antal Száva, Roeland Wiersema.
-
Adds a new optimizer,
qml.QNGOptimizer
, which optimizes QNodes using quantum natural gradient descent. See https://arxiv.org/abs/1909.02108 for more details. (#295) (#311) -
Adds a new QNode method,
QNode.metric_tensor()
, which returns the block-diagonal approximation to the Fubini-Study metric tensor evaluated on the attached device. (#295) -
Sampling support: QNodes can now return a specified number of samples from a given observable via the top-level
pennylane.sample()
function. To support this on plugin devices, there is a newDevice.sample
method.Calculating gradients of QNodes that involve sampling is not possible. (#256)
-
default.qubit
has been updated to provide support for sampling. (#256) -
Added controlled rotation gates to PennyLane operations and
default.qubit
plugin. (#251)
-
The method
Device.supported
was removed, and replaced with the methodsDevice.supports_observable
andDevice.supports_operation
. Both methods can be called with string arguments (dev.supports_observable('PauliX')
) and class arguments (dev.supports_observable(qml.PauliX)
). (#276) -
The following CV observables were renamed to comply with the new Operation/Observable scheme:
MeanPhoton
toNumberOperator
,Homodyne
toQuadOperator
andNumberState
toFockStateProjector
. (#254)
-
The
AmplitudeEmbedding
function now provides options to normalize and pad features to ensure a valid state vector is prepared. (#275) -
Operations can now optionally specify generators, either as existing PennyLane operations, or by providing a NumPy array. (#295) (#313)
-
Adds a
Device.parameters
property, so that devices can view a dictionary mapping free parameters to operation parameters. This will allow plugin devices to take advantage of parametric compilation. (#283) -
Introduces two enumerations:
Any
andAll
, representing any number of wires and all wires in the system respectively. They can be imported frompennylane.operation
, and can be used when defining theOperation.num_wires
class attribute of operations. (#277)As part of this change:
-
All
is equivalent to the integer 0, for backwards compatibility with the existing test suite -
Any
is equivalent to the integer -1 to allow numeric comparison operators to continue working -
An additional validation is now added to the
Operation
class, which will alert the user that an operation withnum_wires = All
is being incorrectly.
-
-
The one-qubit rotations in
pennylane.plugins.default_qubit
no longer depend on Scipy'sexpm
. Instead they are calculated with Euler's formula. (#292) -
Creates an
ObservableReturnTypes
enumeration class containingSample
,Variance
andExpectation
. These new values can be assigned to thereturn_type
attribute of anObservable
. (#290) -
Changed the signature of the
RandomLayer
andRandomLayers
templates to have a fixed seed by default. (#258) -
setup.py
has been cleaned up, removing the non-working shebang, and removing unused imports. (#262)
-
A documentation refactor to simplify the tutorials and include Sphinx-Gallery. (#291)
-
Examples and tutorials previously split across the
examples/
anddoc/tutorials/
directories, in a mixture of ReST and Jupyter notebooks, have been rewritten as Python scripts with ReST comments in a single location, theexamples/
folder. -
Sphinx-Gallery is used to automatically build and run the tutorials. Rendered output is displayed in the Sphinx documentation.
-
Links are provided at the top of every tutorial page for downloading the tutorial as an executable python script, downloading the tutorial as a Jupyter notebook, or viewing the notebook on GitHub.
-
The tutorials table of contents have been moved to a single quick start page.
-
-
Fixed a typo in
QubitStateVector
. (#296) -
Fixed a typo in the
default_gaussian.gaussian_state
function. (#293) -
Fixed a typo in the gradient recipe within the
RX
,RY
,RZ
operation docstrings. (#248) -
Fixed a broken link in the tutorial documentation, as a result of the
qml.expval.Observable
deprecation. (#246)
- Fixed a bug where a
PolyXP
observable would fail if applied to subsets of wires ondefault.gaussian
. (#277)
This release contains contributions from (in alphabetical order):
Simon Cross, Aroosa Ijaz, Josh Izaac, Nathan Killoran, Johannes Jakob Meyer, Rohit Midha, Nicolás Quesada, Maria Schuld, Antal Száva, Roeland Wiersema.
-
pennylane.expval()
is now a top-level function, and is no longer a package of classes. For now, the existingpennylane.expval.Observable
interface continues to work, but will raise a deprecation warning. (#232) -
Variance support: QNodes can now return the variance of observables, via the top-level
pennylane.var()
function. To support this on plugin devices, there is a newDevice.var
method.The following observables support analytic gradients of variances:
-
All qubit observables (requiring 3 circuit evaluations for involutory observables such as
Identity
,X
,Y
,Z
; and 5 circuit evals for non-involutary observables, currently onlyqml.Hermitian
) -
First-order CV observables (requiring 5 circuit evaluations)
Second-order CV observables support numerical variance gradients.
-
-
pennylane.about()
function added, providing details on current PennyLane version, installed plugins, Python, platform, and NumPy versions (#186) -
Removed the logic that allowed
wires
to be passed as a positional argument in quantum operations. This allows us to raise more useful error messages for the user if incorrect syntax is used. (#188) -
Adds support for multi-qubit expectation values of the
pennylane.Hermitian()
observable (#192) -
Adds support for multi-qubit expectation values in
default.qubit
. (#202) -
Organize templates into submodules (#195). This included the following improvements:
-
Distinguish embedding templates from layer templates.
-
New random initialization functions supporting the templates available in the new submodule
pennylane.init
. -
Added a random circuit template (
RandomLayers()
), in which rotations and 2-qubit gates are randomly distributed over the wires -
Add various embedding strategies
-
- The
Device
methodsexpectations
,pre_expval
, andpost_expval
have been renamed toobservables
,pre_measure
, andpost_measure
respectively. (#232)
-
default.qubit
plugin now usesnp.tensordot
when applying quantum operations and evaluating expectations, resulting in significant speedup (#239), (#241) -
PennyLane now allows division of quantum operation parameters by a constant (#179)
-
Portions of the test suite are in the process of being ported to pytest. Note: this is still a work in progress.
Ported tests include:
test_ops.py
test_about.py
test_classical_gradients.py
test_observables.py
test_measure.py
test_init.py
test_templates*.py
test_ops.py
test_variable.py
test_qnode.py
(partial)
-
Fixed a bug in
Device.supported
, which would incorrectly mark an operation as supported if it shared a name with an observable (#203) -
Fixed a bug in
Operation.wires
, by explicitly casting the type of each wire to an integer (#206) -
Removed code in PennyLane which configured the logger, as this would clash with users' configurations (#208)
-
Fixed a bug in
default.qubit
, in whichQubitStateVector
operations were accidentally being cast tonp.float
instead ofnp.complex
. (#211)
This release contains contributions from:
Shahnawaz Ahmed, riveSunder, Aroosa Ijaz, Josh Izaac, Nathan Killoran, Maria Schuld.
- Fixed a bug where the interfaces submodule was not correctly being packaged via setup.py
- PennyLane now includes a new
interfaces
submodule, which enables QNode integration with additional machine learning libraries. - Adds support for an experimental PyTorch interface for QNodes
- Adds support for an experimental TensorFlow eager execution interface for QNodes
- Adds a PyTorch+GPU+QPU tutorial to the documentation
- Documentation now includes links and tutorials including the new PennyLane-Forest plugin.
-
Printing a QNode object, via
print(qnode)
or in an interactive terminal, now displays more useful information regarding the QNode, including the device it runs on, the number of wires, it's interface, and the quantum function it uses:>>> print(qnode) <QNode: device='default.qubit', func=circuit, wires=2, interface=PyTorch>
This release contains contributions from:
Josh Izaac and Nathan Killoran.
- Added the
Identity
expectation value for both CV and qubit models (#135) - Added the
templates.py
submodule, containing some commonly used QML models to be used as ansatz in QNodes (#133) - Added the
qml.Interferometer
CV operation (#152) - Wires are now supported as free QNode parameters (#151)
- Added ability to update stepsizes of the optimizers (#159)
- Removed use of hardcoded values in the optimizers, made them parameters (see #131 and #132)
- Created the new
PlaceholderExpectation
, to be used when both CV and qubit expval modules contain expectations with the same name - Provide the plugins a way to view the operation queue before applying operations. This allows for on-the-fly modifications of the queue, allowing hardware-based plugins to support the full range of qubit expectation values. (#143)
- QNode return values now support any form of sequence, such as lists, sets, etc. (#144)
- CV analytic gradient calculation is now more robust, allowing for operations which may not themselves be differentiated, but have a
well defined
_heisenberg_rep
method, and so may succeed operations that are analytically differentiable (#152)
- Fixed a bug where the variational classifier example was not batching when learning parity (see #128 and #129)
- Fixed an inconsistency where some initial state operations were documented as accepting complex parameters - all operations now accept real values (#146)
This release contains contributions from:
Christian Gogolin, Josh Izaac, Nathan Killoran, and Maria Schuld.
Initial public release.
This release contains contributions from:Ville Bergholm, Josh Izaac, Maria Schuld, Christian Gogolin, and Nathan Killoran.