taper_hf(generators, paulixops, paulix_sector, num_electrons, num_wires)[source]

Transform a Hartree-Fock state with a Clifford operator and then taper qubits.

The fermionic operators defining the molecule’s Hartree-Fock (HF) state are first mapped onto a qubit operator using the Jordan-Wigner encoding. This operator is then transformed using the Clifford operators \(U\) obtained from the \(\mathbb{Z}_2\) symmetries of the molecular Hamiltonian resulting in a qubit operator that acts non-trivially only on a subset of qubits. A new, tapered HF state is built on this reduced subset of qubits by placing the qubits which are acted on by a Pauli-X or Pauli-Y operators in state \(|1\rangle\) and leaving the rest in state \(|0\rangle\).

  • generators (list[Operator]) – list of generators of symmetries, taus, for the Hamiltonian

  • paulixops (list[Operation]) – list of single-qubit Pauli-X operators

  • paulix_sector (list[int]) – list of eigenvalues of Pauli-X operators

  • num_electrons (int) – number of active electrons in the system

  • num_wires (int) – number of wires in the system for generating the Hartree-Fock bitstring


tapered Hartree-Fock state

Return type



>>> symbols = ['He', 'H']
>>> geometry = np.array([[0.0, 0.0, 0.0], [0.0, 0.0, 1.4588684632]])
>>> mol = qml.qchem.Molecule(symbols, geometry, charge=1)
>>> H, n_qubits = qml.qchem.molecular_hamiltonian(symbols, geometry, charge=1)
>>> n_elec = mol.n_electrons
>>> generators = qml.qchem.symmetry_generators(H)
>>> paulixops = qml.qchem.paulix_ops(generators, 4)
>>> paulix_sector = qml.qchem.optimal_sector(H, generators, n_elec)
>>> taper_hf(generators, paulixops, paulix_sector, n_elec, n_qubits)
tensor([1, 1], requires_grad=True)