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

Tiny fixes to some demos #1305

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions demonstrations/tutorial_qaoa_intro.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
# :align: center
# :width: 70%
#
# In PennyLane, this is implemented using the :func:`~.pennylane.templates.ApproxTimeEvolution`
# In PennyLane, this is implemented using the :func:`~.pennylane.ApproxTimeEvolution`
# template. For example, let's say we have the following Hamiltonian:

import pennylane as qml
Expand Down Expand Up @@ -284,9 +284,9 @@ def circuit(params, **kwargs):
# :align: center
# :width: 90%
#
# While it is possible to use :func:`~.pennylane.templates.ApproxTimeEvolution`, the QAOA module allows you to
# build the cost and mixer layers directly using the functions :func:`~.pennylane.qaoa.cost_layer` and
# :func:`~.pennylane.qaoa.mixer_layer`, which take as input the respective Hamiltonian and variational parameters:
# While it is possible to use :func:`~.pennylane.ApproxTimeEvolution`, the QAOA module allows you to
# build the cost and mixer layers directly using the functions :func:`~.pennylane.qaoa.layers.cost_layer` and
# :func:`~.pennylane.qaoa.layers.mixer_layer`, which take as input the respective Hamiltonian and variational parameters:


def qaoa_layer(gamma, alpha):
Expand Down Expand Up @@ -424,7 +424,7 @@ def probability_circuit(gamma, alpha):
# favour :math:`|10\rangle,` making it the only true ground state.
#
# It is easy to introduce constraints of this form in PennyLane.
# We can use the :func:`~.pennylane.qaoa.edge_driver` cost
# We can use the :func:`~.pennylane.qaoa.cost.edge_driver` cost
# Hamiltonian to "reward" cases in which the first and last vertices of the graph
# are :math:`0:`

Expand Down
6 changes: 3 additions & 3 deletions demonstrations/tutorial_vqe.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
# tutorial :doc:`tutorial_givens_rotations`.
#
# Implementing the circuit above using PennyLane is straightforward. First, we use the
# :func:`hf_state` function to generate the vector representing the Hartree-Fock state.
# :func:`~.pennylane.qchem.hf_state` function to generate the vector representing the Hartree-Fock state.

electrons = 2
hf = qml.qchem.hf_state(electrons, qubits)
Expand All @@ -144,7 +144,7 @@
# the qubit register. Then, we just act with the :class:`~.pennylane.DoubleExcitation` operation
# on the four qubits. The next step is to compute the expectation value
# of the molecular Hamiltonian in the trial state prepared by the circuit.
# We do this using the :func:`~.expval` function. The decorator syntax allows us to
# We do this using the :func:`~.pennylane.expval` function. The decorator syntax allows us to
# run the cost function as an executable QNode with the gate parameter :math:`\theta:`

@qml.qnode(dev, interface="jax")
Expand Down Expand Up @@ -265,7 +265,7 @@ def cost_fn(param):
# molecular Hamiltonian in the trial state.
#
# The VQE algorithm can be used to simulate other chemical phenomena.
# In the tutorial :doc:`tutorial_vqe_bond_dissociation`, we use VQE to explore the
# In the tutorial :doc:`tutorial_chemical_reactions`, we use VQE to explore the
# potential energy surface of molecules to simulate chemical reactions.
# Another interesting application is to probe the lowest-lying states of molecules
# in specific sectors of the Hilbert space. For example, see the tutorial
Expand Down
Loading