Skip to content

Commit

Permalink
moving TODO string in a more elegant place
Browse files Browse the repository at this point in the history
  • Loading branch information
PietropaoloFrisoni committed May 23, 2024
1 parent dab5f01 commit a9c5599
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pennylane_lightning/lightning_tensor/lightning_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ class LightningTensor(Device):
statistics like expectation values and variances is performed analytically.
c_dtype: Datatypes for the tensor representation. Must be one of
``np.complex64`` or ``np.complex128``.
**kwargs: keyword arguments. The following options are supported:
# TODO add when cuTensorNet MPS backend is available as a prototype
**kwargs: keyword arguments. TODO add when cuTensorNet MPS backend is available as a prototype.
"""

# pylint: disable=too-many-instance-attributes
Expand Down Expand Up @@ -105,6 +103,8 @@ def __init__(
self._method = method
self._c_dtype = c_dtype

self._interface = None

for arg in kwargs:
if arg not in self._device_options:
raise TypeError(
Expand Down
7 changes: 2 additions & 5 deletions tests/lightning_tensor/test_lightning_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,13 @@ def test_invalid_method(method):

def test_invalid_keyword_arg():
"""Test an invalid keyword argument."""
with pytest.raises(
TypeError,
match=f"Unexpected argument: fake_arg during initialization of the lightning.tensor device.",
):
with pytest.raises(TypeError):
LightningTensor(fake_arg=None)


def test_invalid_shots():
"""Test that an error is raised if finite number of shots are requestd."""
with pytest.raises(ValueError, match="lightning.tensor does not support finite shots."):
with pytest.raises(ValueError):
LightningTensor(shots=5)


Expand Down

0 comments on commit a9c5599

Please sign in to comment.