From a91b5e5fd4fe3cbfbb0dd3a4111295142902ccbc Mon Sep 17 00:00:00 2001 From: Catalina Albornoz Date: Thu, 16 Jan 2025 18:33:59 -0500 Subject: [PATCH 1/4] Update tutorial_vqe.py fixed link to hf_state --- demonstrations/tutorial_vqe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demonstrations/tutorial_vqe.py b/demonstrations/tutorial_vqe.py index 5795b87464..dda379d527 100644 --- a/demonstrations/tutorial_vqe.py +++ b/demonstrations/tutorial_vqe.py @@ -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:`~.qchem.hf_state` function to generate the vector representing the Hartree-Fock state. electrons = 2 hf = qml.qchem.hf_state(electrons, qubits) From 463b3778157fd3dc975198d3ee9b3c02312d4da0 Mon Sep 17 00:00:00 2001 From: Catalina Albornoz Date: Thu, 16 Jan 2025 19:03:12 -0500 Subject: [PATCH 2/4] Update demonstrations/tutorial_vqe.py --- demonstrations/tutorial_vqe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demonstrations/tutorial_vqe.py b/demonstrations/tutorial_vqe.py index dda379d527..84e0e61d02 100644 --- a/demonstrations/tutorial_vqe.py +++ b/demonstrations/tutorial_vqe.py @@ -133,7 +133,7 @@ # tutorial :doc:`tutorial_givens_rotations`. # # Implementing the circuit above using PennyLane is straightforward. First, we use the -# :func:`~.qchem.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) From cbe4f2022cf45d71cd87dd1f8c23037c0b4c980c Mon Sep 17 00:00:00 2001 From: CatalinaAlbornoz Date: Thu, 16 Jan 2025 19:30:36 -0500 Subject: [PATCH 3/4] Made tiny link fixes to the vqe demo --- demonstrations/tutorial_vqe.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demonstrations/tutorial_vqe.py b/demonstrations/tutorial_vqe.py index 84e0e61d02..50203b7785 100644 --- a/demonstrations/tutorial_vqe.py +++ b/demonstrations/tutorial_vqe.py @@ -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") @@ -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 From abf4c563de454a4d6fe065aa608ae1a9fda17778 Mon Sep 17 00:00:00 2001 From: CatalinaAlbornoz Date: Thu, 16 Jan 2025 21:16:34 -0500 Subject: [PATCH 4/4] Added tiny fixes to intro to qaoa demo --- demonstrations/tutorial_qaoa_intro.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/demonstrations/tutorial_qaoa_intro.py b/demonstrations/tutorial_qaoa_intro.py index 7caed2f250..befd317d91 100644 --- a/demonstrations/tutorial_qaoa_intro.py +++ b/demonstrations/tutorial_qaoa_intro.py @@ -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 @@ -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): @@ -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:`