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

Merge v0.32 with master #4532

Merged
merged 19 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion doc/code/qml_measurements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ qml.measurements
:no-heading:
:include-all-objects:
:inheritance-diagram:
:skip: MeasurementShapeError, MeasurementValueError, ObservableReturnTypes
:skip: MeasurementShapeError, ObservableReturnTypes
2 changes: 1 addition & 1 deletion doc/code/qml_qchem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ number observables.
.. automodapi:: pennylane.qchem
:no-heading:
:include-all-objects:
:skip: taper, symmetry_generators, paulix_ops, import_operator, import_state
:skip: taper, symmetry_generators, paulix_ops, import_operator

Differentiable Hartree-Fock
---------------------------
Expand Down
4 changes: 2 additions & 2 deletions doc/development/guide/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ To enable logging support in your PennyLane work-flow simply run the following l
qml.logging.enable_logging()


This will ensure all levels of the execution pipeline logs function entries, and
outputs to handlers pointing to the standard output. Note, since Python's logging framework configuration functions overwrite previous logger configurations, it is expected that :func:`~pennylane.logging.enable_logging()` is called only when not using external logging configurations.
This will ensure all levels of the execution pipeline log function entries and
outputs. These are logged to handlers pointing to the standard output. Note, since Python's logging framework configuration functions overwrite previous logger configurations, it is expected that :func:`~pennylane.logging.enable_logging()` is called only when not using external logging configurations.

If you are defining custom logging configurations, you can extend the logging configuration options as defined in the section `Customizing the logging configuration <logging-config>`_, or avoid calling :func:`~pennylane.logging.enable_logging()` in favour of tour custom configuration options.

Expand Down
8 changes: 4 additions & 4 deletions doc/introduction/chemistry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ where:
The :func:`~.molecular_hamiltonian` function can also be used to construct the molecular Hamiltonian
with an external backend that uses the
`OpenFermion-PySCF <https://github.com/quantumlib/OpenFermion-PySCF>`_ plugin interfaced with the
electronic structure package `PySCF <https://github.com/sunqm/pyscf>`_, which requires separate
electronic structure package `PySCF <https://github.com/pyscf/pyscf>`_, which requires separate
installation. This backend is non-differentiable and can be selected by setting
``method='pyscf'`` in :func:`~.molecular_hamiltonian`.

Expand Down Expand Up @@ -67,8 +67,8 @@ If the electronic Hamiltonian is built independently using
`OpenFermion <https://github.com/quantumlib/OpenFermion>`_ tools, it can be readily converted
to a PennyLane observable using the :func:`~.pennylane.import_operator` function. There is also
capability to import wavefunctions (states) that have been pre-computed by traditional quantum chemistry methods
from `PySCF <https://github.com/sunqm/pyscf>`_, which could be used to for example to provide a better
starting point to a quantum algorithm. State import can be accomplished using the :func:`~pennylane.import_state`
from `PySCF <https://github.com/pyscf/pyscf>`_, which could be used to for example to provide a better
starting point to a quantum algorithm. State import can be accomplished using the :func:`~pennylane.qchem.import_state`
utility function.


Expand Down Expand Up @@ -264,7 +264,7 @@ Utility functions
~pennylane.qchem.givens_decomposition
~pennylane.qchem.hf_state
~pennylane.import_operator
~pennylane.import_state
~pennylane.qchem.import_state
~pennylane.qchem.mol_data
~pennylane.qchem.read_structure

Expand Down
2 changes: 1 addition & 1 deletion doc/introduction/data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ These download the desired datasets or load them from local storage if previousl

To specify the dataset to be loaded, the data category (``data_name``) must be
specified, alongside category-specific keyword arguments. For the full list
of available datasets, please see the `datasets website <https://pennylane.ai/qml/datasets.html>`_.
of available datasets, please see the `datasets website <https://pennylane.ai/datasets>`_.
The :func:`~pennylane.data.load` function returns a ``list`` with the desired data.

>>> H2datasets = qml.data.load("qchem", molname="H2", basis="STO-3G", bondlength=1.1)
Expand Down
20 changes: 20 additions & 0 deletions doc/introduction/measurements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,26 @@ Note that we can also specify an outcome when defining a conditional operation:
>>> qnode_conditional_op_on_zero(*pars)
tensor([0.88660045, 0.11339955], requires_grad=True)

Wires can be reused as normal after making mid-circuit measurements. Moreover, a measured wire can also be
reset to the :math:`|0 \rangle` state by setting the ``reset`` keyword argument of :func:`~.pennylane.measure`
to ``True``.

.. code-block:: python3

dev = qml.device("default.qubit", wires=3)

@qml.qnode(dev)
def func():
qml.PauliX(1)
m_0 = qml.measure(1, reset=True)
qml.PauliX(1)
return qml.probs(wires=[1])

Executing this QNode:

>>> func()
tensor([0., 1.], requires_grad=True)

The deferred measurement principle provides a natural method to simulate the
application of mid-circuit measurements and conditional operations in a
differentiable and device-independent way. Performing true mid-circuit
Expand Down
Loading
Loading