qml.symmetry_generators¶
- symmetry_generators(h)[source]¶
Compute the generators {τ1,…,τk} for a Hamiltonian over the binary field Z2.
These correspond to the generator set of the Z2-symmetries present in the Hamiltonian as given in arXiv:1910.14644.
- Parameters
h (Operator) – Hamiltonian for which symmetries are to be generated to perform tapering
- Returns
list of generators of symmetries, τ’s, for the Hamiltonian
- Return type
list[Operator]
Example
>>> symbols = ["H", "H"] >>> coordinates = 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 [Z(0) @ Z(1), Z(0) @ Z(2), Z(0) @ Z(3)]