qml.devices.default_gaussian.partitions

partitions(s, include_singles=True)[source]

Partitions a sequence into all groupings of pairs and singles of elements.

Parameters
  • s (sequence) – the sequence to partition

  • include_singles (bool) – if False, only partitions into pairs is returned.

Returns

returns a nested tuple, containing all partitions of the sequence.

Return type

tuple

Contents

Using PennyLane

Release news

Development

API

Internals