qml.symmetry_generators

symmetry_generators(h)[source]

Compute the generators \(\{\tau_1, \ldots, \tau_k\}\) for a Hamiltonian over the binary field \(\mathbb{Z}_2\).

These correspond to the generator set of the \(\mathbb{Z}_2\)-symmetries present in the Hamiltonian as given in arXiv:1910.14644.

Parameters

h (Hamiltonian) – Hamiltonian for which symmetries are to be generated to perform tapering

Returns

list of generators of symmetries, taus, for the Hamiltonian

Return type

list[Hamiltonian]

Example

>>> symbols = ["H", "H"]
>>> geometry = np.array([[0.0, 0.0, 0.0], [0.0, 0.0, 1.0]])
>>> H, qubits = qml.qchem.molecular_hamiltonian(symbols, coordinates)
>>> t = symmetry_generators(H)
>>> t
[<Hamiltonian: terms=1, wires=[0, 1]>,
 <Hamiltonian: terms=1, wires=[0, 2]>,
 <Hamiltonian: terms=1, wires=[0, 3]>]
>>> print(t[0])
(1.0) [Z0 Z1]

Contents

Using PennyLane

Development

API