qrunch.quantum.groupers.beast_grouper
Module containing the BEAST measurement grouper which groups into only the three X, Y, and Z groups.
Classes
Grouper designed specifically for the BEAST-VQE chemistry algorithm. |
- class BeastGrouper
Bases:
MeasurementGrouperGrouper designed specifically for the BEAST-VQE chemistry algorithm.
This grouper first tries to group into only three groups: one measured only in the X basis, one measured only in the Y basis, and one measured only in the Z basis.
If this fails it will try to group into only the seven groups necessary for analytical parameter optimization for Beast. For 5 qubits such groups could be XZXXX, XXZXX, ZXXZZ, YZYYY, YYZYY, ZYYZZ, ZZZZZ, where qubit 2 and 3 are special and need a Z basis in the X-groups or X basis in one of the Z groups. These special qubits are the qubits for the last gate being optimized, and they are extracted from the pauli string. If they can not be determined at runtime the previous gate qubits are used.
- __init__(*args, **kwargs)
- group(pauli_sums: Sequence[HermitianPauliSum], circuit: Circuit | None = None) tuple[MeasurementGroup, ...]
Group the terms in the observable into groups of Pauli string of mutually commuting strings.
- Parameters:
pauli_sums (Sequence[HermitianPauliSum]) – Pauli sums to group.
circuit (Circuit | None) – Circuit for the pauli sums to be measured on.
- Raises:
ValueError – If an invalid pauli string is given.
- Return type:
tuple[MeasurementGroup, …]