qdk_chemistry.algorithms.term_grouper.vacuum_annihilating module

Vacuum-annihilating term grouper: group Pauli terms whose amplitudes cancel on the vacuum.

The flipped-qubit set of a Pauli string is the set of positions carrying \(X\) or \(Y\), i.e. the qubits whose \(|0\rangle\) and \(|1\rangle\) get exchanged. On the all-zero state,

\[c\,P\,|0\ldots0\rangle = c\,i^{n_Y}\,|b_F\rangle,\]

with \(F\) the flipped-qubit set, \(n_Y\) the number of \(Y\) factors, and \(b_F\) the bit string with exactly the qubits in \(F\) set.

class qdk_chemistry.algorithms.term_grouper.vacuum_annihilating.VacuumAnnihilatingTermGrouper[source]

Bases: TermGrouper

Group Pauli terms whose weighted amplitudes cancel on \(|0\ldots0\rangle\).

Only terms sharing a flipped-qubit set reach the same basis state \(|b_F\rangle\), so they are the only ones whose amplitudes can cancel. Each set has to satisfy \(\sum_j c_j\, P_j\, |0\ldots0\rangle = 0\) to within tolerance, otherwise grouping fails with a ValueError. A certified set is then cut wherever its running sum vanishes exactly, so every group but the last cancels on its own and the last carries the tolerated residual. Diagonal (\(I\)/\(Z\)) strings only phase the vacuum, which a consumer can correct for, so they form one group whose sum is left unconstrained.

Groups hold a single \(Y\)-count parity, which makes their members commute: two strings sharing a flipped-qubit set disagree only inside it, and the number of such positions has parity \(n_Y^{(a)} + n_Y^{(b)} \bmod 2\). No cancellation is lost, since with real coefficients the even-parity terms contribute \(\pm 1\) and the odd-parity ones \(\pm i\), so the two sub-sums are the real and imaginary parts of the total.

The motivating case is fermionic chemistry, where each excitation annihilates the all-zero reference only through the weighted sum of its Pauli strings, which is the ordering the ControlledSwapPauliSequenceMapper requires.

__init__()[source]

Initialise the VacuumAnnihilatingTermGrouper.

name()[source]

Return vacuum_annihilating as the algorithm name.

Return type:

str

class qdk_chemistry.algorithms.term_grouper.vacuum_annihilating.VacuumAnnihilatingTermGrouperSettings[source]

Bases: TermGrouperSettings

Settings for the VacuumAnnihilatingTermGrouper.

tolerance

Absolute tolerance on the vacuum amplitude of a flipped-qubit set.

__init__()[source]

Initialise the settings for VacuumAnnihilatingTermGrouper.