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

lie_closure_dense typo in docstring #6858

Merged
merged 10 commits into from
Jan 21, 2025
Next Next commit
typo fix
  • Loading branch information
isaacdevlugt committed Jan 20, 2025
commit f683d2a14083a4314bff6bfd23fea507f8de4126
6 changes: 4 additions & 2 deletions doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@

<h3>Documentation 📝</h3>

* Updated documentation for vibrational Hamiltonians
* Updated documentation for vibrational Hamiltonians.
isaacdevlugt marked this conversation as resolved.
Show resolved Hide resolved
[(#6717)](https://github.com/PennyLaneAI/pennylane/pull/6717)

* Fixed a typo in the code example for `qml.labs.dla.lie_closure_dense`.
isaacdevlugt marked this conversation as resolved.
Show resolved Hide resolved

<h3>Bug fixes 🐛</h3>

<h3>Contributors ✍️</h3>

This release contains contributions from (in alphabetical order):
Diksha Dhawan
Diksha Dhawan
4 changes: 3 additions & 1 deletion pennylane/labs/dla/lie_closure_dense.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ def lie_closure_dense(

Compute the Lie closure of the isotropic Heisenberg model with generators :math:`\{X_i X_{i+1} + Y_i Y_{i+1} + Z_i Z_{i+1}\}_{i=0}^{n-1}`.

>>> from pennylane import X, Y, Z
>>> from pennylane.labs.dla import lie_closure_dense
>>> n = 5
>>> gens = [X(i) @ X(i+1) + Y(i) @ Y(i+1) + Z(i) @ Z(i+1) for i in range(n-1)]
>>> g = lie_closure_mat(gens, n)
>>> g = lie_closure_dense(gens, n)

The result is a ``numpy`` array. We can turn the matrices back into PennyLane operators by employing :func:`~batched_pauli_decompose`.

Expand Down