|View source on GitHub|
Remove qubits from given operator.
openfermion.transforms.taper_off_qubits( operator, stabilizers, manual_input=False, fixed_positions=None, output_tapered_positions=False )
Qubits are removed by eliminating an equivalent number of stabilizer conditions. Which qubits that are can either be determined automatically or their positions can be set manually.
Qubits can be disregarded from the Hamiltonian when the effect of all its terms on them is rendered trivial. This algorithm employs a stabilizers like \(\pm X \otimes p\) to fix the action of every Pauli string on the first qubit to \(Z\) or the identity. A string \(X \otimes h\) would for instance be multiplied with the stabilizer to obtain \(1 \otimes (\pm h\cdot p)\) while a string \(Z \otimes h^\prime\) would pass without correction. The first qubit can subsequently be removed as it must be in the computational basis in Hamiltonian eigenstates. For stabilizers acting as \(Y\) (\(Z\)) on selected qubits, the algorithm would fix the action of every Hamiltonian string to \(Z\) (\(X\)). Updating also the list of remaining stabilizer generators, the algorithm is run iteratively.
Operator with fewer qubits.
(optional) List of removed qubit positions. For the qubits to be gone in the qubit count, the remaining qubits have been moved up to those indices.