Remove qubits from given operator.

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 :math:\pm X \otimes p to fix the action of every Pauli string on the first qubit to :math:Z or the identity. A string :math:X \otimes h would for instance be multiplied with the stabilizer to obtain :math:1 \otimes (\pm h\cdot p) while a string :math: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 :math:Y (:math:Z) on selected qubits, the algorithm would fix the action of every Hamiltonian string to :math:Z (:math:X). Updating also the list of remaining stabilizer generators, the algorithm is run iteratively.

operator (QubitOperator): Operator of which qubits will be removed. stabilizers (QubitOperator): Stabilizer generators for the tapering. Can also be passed as a list of QubitOperator. manual_input (Boolean): Option to pass the list of fixed qubits positions manually. Set to False by default. fixed_positions (list): (optional) List of fixed qubit positions. Passing a list is only effective if manual_input is True. output_tapered_positions (Boolean): Option to output the positions of qubits that have been removed.

skimmed_operator (QubitOperator): Operator with fewer qubits. removed_positions (list): (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.