qml.taper¶
- taper(h, generators, paulixops, paulix_sector)[source]¶
Transform a Hamiltonian with a Clifford operator and then taper qubits.
The Hamiltonian is transformed as \(H' = U^{\dagger} H U\) where \(U\) is a Clifford operator. The transformed Hamiltonian acts trivially on some qubits which are then replaced with the eigenvalues of their corresponding Pauli-X operator. The list of these eigenvalues is defined as the Pauli sector.
- Parameters
- Returns
the tapered Hamiltonian
- Return type
(Operator)
Example
>>> symbols = ["H", "H"] >>> geometry = np.array([[0.0, 0.0, -0.69440367], [0.0, 0.0, 0.69440367]]) >>> H, qubits = qml.qchem.molecular_hamiltonian(symbols, geometry) >>> generators = qml.qchem.symmetry_generators(H) >>> paulixops = paulix_ops(generators, 4) >>> paulix_sector = [1, -1, -1] >>> H_tapered = taper(H, generators, paulixops, paulix_sector) >>> H_tapered ( (-0.3210343973331179-2.0816681711721685e-17j) * I(0) + (0.7959678504583807+0j) * Z(0) + (0.18092702760702645+0j) * X(0) )
code/api/pennylane.taper
Download Python script
Download Notebook
View on GitHub