Skip to content

Commit

Permalink
Importing the default.tensor in PL from the lightning.tensor devi…
Browse files Browse the repository at this point in the history
…ce in PL lightning (#5699)

**Context:** This PR moves part of the `lightning.tensor` device from
PennyLane lightning to PennyLane. Such a device was introduced
originally in the following pull requests:
[1](PennyLaneAI/pennylane-lightning#671) and
[2](PennyLaneAI/pennylane-lightning#686). Due to
requirements change, it has been decided to create an additional
`default.tensor` device and move it to the PennyLane repository.
Specifically, we move the `quimb` interface and the corresponding Python
implementation of `lightning.tensor` into `default.tensor`. For
reference, the PR removing such a component from `lightning.tensor` is
[here](PennyLaneAI/pennylane-lightning#737).

*Please note that the full documentation for such a device will be added
in a following PR*

**Description of the Change:** As above.

**Benefits:** Having two separate devices simplifies the distinction
between the C++ and the Python components. The relationship between
`lightning.tensor` and `default.tensor` will be similar to that between
`lightning.qubit` and `default.qubit`.

**Possible Drawbacks:** None with the existing code, since this is a new
quantum device.

**Related GitHub Issues:** None.

**Related Shortcut Stories:**
[sc-63256]
[sc-62979]

---------

Co-authored-by: albi3ro <[email protected]>
  • Loading branch information
PietropaoloFrisoni and albi3ro authored May 23, 2024
1 parent d173cd0 commit 058603a
Show file tree
Hide file tree
Showing 9 changed files with 1,759 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/interface-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ jobs:
install_pennylane_lightning_master: false
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: external
additional_pip_packages: pyzx pennylane-catalyst matplotlib stim
additional_pip_packages: pyzx pennylane-catalyst matplotlib stim quimb
requirements_file: ${{ strategy.job-index == 0 && 'external.txt' || '' }}
disable_new_opmath: ${{ inputs.disable_new_opmath }}

Expand Down
2 changes: 1 addition & 1 deletion doc/introduction/circuits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ instantiated using the :func:`device <pennylane.device>` loader.
dev = qml.device('default.qubit', wires=2, shots=1000)
PennyLane offers some basic devices such as the ``'default.qubit'``, ``'default.mixed'``, ``lightning.qubit``,
``'default.gaussian'``, and ``'default.clifford'`` simulators; additional devices can be installed as plugins
``'default.gaussian'``, ``'default.clifford'``, and ``'default.tensor'`` simulators; additional devices can be installed as plugins
(see `available plugins <https://pennylane.ai/plugins.html>`_ for more details). Note that the
choice of a device significantly determines the speed of your computation, as well as
the available options that can be passed to the device loader.
Expand Down
3 changes: 3 additions & 0 deletions doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

<h3>New features since last release</h3>

* The `default.tensor` device is introduced to perform tensor network simulation of a quantum circuit.
[(#5699)](https://github.com/PennyLaneAI/pennylane/pull/5699)

<h3>Improvements 🛠</h3>

* The sorting order of parameter-shift terms is now guaranteed to resolve ties in the absolute value with the sign of the shifts.
Expand Down
1 change: 1 addition & 0 deletions pennylane/devices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,5 @@ def execute(self, circuits, execution_config = qml.devices.DefaultExecutionConfi
from .default_clifford import DefaultClifford
from .null_qubit import NullQubit
from .default_qutrit_mixed import DefaultQutritMixed
from .default_tensor import DefaultTensor
from .._device import Device as LegacyDevice
Loading

0 comments on commit 058603a

Please sign in to comment.