Skip to content

Commit

Permalink
i guess this is a bit more accurate?
Browse files Browse the repository at this point in the history
  • Loading branch information
austingmhuang committed Sep 20, 2024
1 parent 132177b commit 7fc2137
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pennylane/spin/spin_hamiltonian.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ def spin_hamiltonian(lattice):
r"""Generates a spin Hamiltonian for a custom lattice.
Args:
lattice (Lattice): custom lattice defined with ``custom_edges`` and optional ``custom_nodes``
lattice (Lattice): custom lattice defined with custom_edges
Raises:
ValueError: if the provided Lattice does not have ``custom_edges`` defined with operators
Expand All @@ -707,7 +707,7 @@ def spin_hamiltonian(lattice):
.. code-block:: python
>>> lattice = qml.spin.Lattice(
lattice = qml.spin.Lattice(
n_cells=[2, 2],
vectors=[[1, 0], [0, 1]],
positions=[[0, 0], [1, 5]],
Expand All @@ -719,15 +719,15 @@ def spin_hamiltonian(lattice):
>>> qml.spin.spin_hamiltonian(lattice=lattice)
>>> (
0.5 * (X(0) @ X(1))
+ 0.5 * (X(2) @ X(3))
+ 0.5 * (X(4) @ X(5))
+ 0.5 * (X(6) @ X(7))
+ 0.6 * (Y(1) @ Y(2))
+ 0.6 * (Y(5) @ Y(6))
+ 0.7 * (Z(1) @ Z(4))
+ 0.7 * (Z(3) @ Z(6))
+ 0.5 * X(0)
+ 0.3 * Y(1)
+ 0.5 * (X(2) @ X(3))
+ 0.5 * (X(4) @ X(5))
+ 0.5 * (X(6) @ X(7))
+ 0.6 * (Y(1) @ Y(2))
+ 0.6 * (Y(5) @ Y(6))
+ 0.7 * (Z(1) @ Z(4))
+ 0.7 * (Z(3) @ Z(6))
+ 0.5 * X(0)
+ 0.3 * Y(1)
)
"""
Expand Down

0 comments on commit 7fc2137

Please sign in to comment.