Skip to content

Commit

Permalink
Add import_state docs to the website (#4461)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chiffafox authored Aug 14, 2023
1 parent 396ca66 commit 1725ceb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
18 changes: 14 additions & 4 deletions doc/introduction/chemistry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ 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
installation. This backend is non-differentiable and can be selected by setting
``method='pyscf'`` in :func:`~.molecular_hamiltonian`. Additionally, 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.
``method='pyscf'`` in :func:`~.molecular_hamiltonian`.

Furthermore, the net charge,
the `spin multiplicity <https://en.wikipedia.org/wiki/Multiplicity_(chemistry)>`_, the
Expand All @@ -63,6 +60,18 @@ specified for each backend.
active_orbitals=2
)
Importing the Hamiltonian and ansatz state
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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`
utility function.


Importing molecular structure data
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

Expand Down
5 changes: 4 additions & 1 deletion doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ array([False, False])
```

The currently supported objects are RCISD, UCISD, RCCSD, and UCCSD which correspond to
restricted (R) and unrestricted (U) configuration interaction (CI )and coupled cluster (CC)
restricted (R) and unrestricted (U) configuration interaction (CI) and coupled cluster (CC)
calculations with single and double (SD) excitations.

<h3>Improvements 🛠</h3>
Expand Down Expand Up @@ -287,6 +287,9 @@ array([False, False])
some aspects of its use.
[(#4391)](https://github.com/PennyLaneAI/pennylane/pull/4391)

* `qml.import_state` is now accounted for in `doc/introduction/chemistry.rst`, adding the documentation for the function.
[(#4461)](https://github.com/PennyLaneAI/pennylane/pull/4461)

<h3>Bug fixes 🐛</h3>

* Allow sparse matrix calculation of `SProd`s containing a `Tensor`. When using
Expand Down
9 changes: 8 additions & 1 deletion pennylane/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@
import pennylane.resource
import pennylane.qchem
from pennylane.fermi import FermiC, FermiA, jordan_wigner
from pennylane.qchem import taper, symmetry_generators, paulix_ops, taper_operation, import_operator
from pennylane.qchem import (
taper,
symmetry_generators,
paulix_ops,
taper_operation,
import_operator,
import_state,
)
from pennylane._device import Device, DeviceError
from pennylane._grad import grad, jacobian
from pennylane._qubit_device import QubitDevice
Expand Down

0 comments on commit 1725ceb

Please sign in to comment.