Skip to content

Commit

Permalink
Removing the draw function
Browse files Browse the repository at this point in the history
  • Loading branch information
PietropaoloFrisoni committed Apr 25, 2024
1 parent f8facd7 commit 2d5977a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
8 changes: 0 additions & 8 deletions pennylane_lightning/lightning_tensor/quimb/_mps.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,6 @@ def state_to_array(self, digits: int = 5) -> np.ndarray:
"""Contract the MPS into a dense array and round the values."""
return self._circuitMPS.to_dense().round(digits)

def draw_state(self) -> None:
"""Draw the MPS."""
self._circuitMPS.psi.draw(
color=[f"I{q}" for q in range(len(self._wires))],
show_tags=False,
show_inds=True,
)

def _reset_state(self) -> None:
"""Reset the MPS."""
self._circuitMPS = qtn.CircuitMPS(psi0=self._initial_mps())
Expand Down
15 changes: 15 additions & 0 deletions tests/lightning_tensor/test_quimb_mps.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,18 @@ def test_not_implemented_meas(self, backend, method):

with pytest.raises(NotImplementedError):
dev.execute(tape)

def test_not_implemented_shots(self, backend, method):
"""Tests that this interface does not support measurements with finite shots."""

ops = [qml.Identity(0)]
measurements = [qml.expval(qml.PauliZ(0))]
tape = qml.tape.QuantumScript(ops, measurements)
tape._shots = 5

dev = LightningTensor(
wires=tape.wires, backend=backend, method=method, c_dtype=np.complex64
)

with pytest.raises(NotImplementedError):
dev.execute(tape)

0 comments on commit 2d5977a

Please sign in to comment.