Add together identical terms in the Hamiltonian.
The Hamiltonian terms with identical Pauli words are added together and eliminated if the overall coefficient is smaller than a cutoff value.
h (Hamiltonian) – PennyLane Hamiltonian
cutoff (float) – cutoff value for discarding the negligible terms
Simplified PennyLane Hamiltonian
- Return type
>>> c = np.array([0.5, 0.5]) >>> h = qml.Hamiltonian(c, [qml.PauliX(0) @ qml.PauliY(1), qml.PauliX(0) @ qml.PauliY(1)]) >>> print(simplify(h)) (1.0) [X0 Y1]
- What is PennyLane?
- Quantum circuits
- Gradients and training
- Quantum operators
- Inspecting circuits
- Compiling circuits
- Quantum Chemistry
- Quantum Datasets
- QNode returns