
One of the biggest practical challenges in quantum computing is efficiently extracting meaningful results from quantum systems—especially on noisy quantum hardware (NISQ). Measuring observables naïvely wastes valuable quantum runtime. In this post, we explain how observable grouping significantly reduces resource consumption by identifying and measuring compatible observables simultaneously. We also showcase how our Python library, Divi, leverages various tools to automate and simplify observable grouping, enabling quantum researchers to easily harness these optimization techniques without deep technical overhead.
The Measurement Problem in Quantum Computing
The (utilitarian) bane of quantum computing (or rather, quantum mechanics) is extracting useful information out of quantum systems. In the context of quantum computing, that is the extraction of the measurement result histogram after executing a quantum circuit for some repetitions, which in layman terms is referred to commonly as measuring the quantum state for some number of shots. The procedure is simple: apply quantum operations to an initial state, then measure the quantum system against some observable representing some basis, which typically is the Pauli-Z basis.
One could then use the measurement results to compute the expectation value of the observable. Should one require a measurement in a different basis, one applies the corresponding diagonalizing operation before the measurement. If you are interested in the measurement against some Hamiltonian consisting of multiple Pauli terms, the process is repeated for each term, and the sub-results summed up in the end.
However, such a naive approach fails to produce reliable results at scale, especially when carried out on NISQ devices, which, depending on your research team’s budget or your patience waiting in the job queue, might not be accessible for a sufficient period of time. In addition, even if you have managed to acquire a good amount of credits for a quantum service, this approach might unnecessarily use up more credits than you would prefer.

The main problem is avoidable redundancy. With this approach, oftentimes the collection of observables can be grouped together to vastly reduce the number of separate terms, significantly reducing the total number of circuits.
Optimizing Resource Use Through Observable Grouping
To optimize the measurement process in quantum computing, various techniques can be used to reduce the total number of observables required to compute an expectation value. In short, it’s often possible to reuse the same result histogram to calculate the expectation values of multiple observables simultaneously. This technique is known as observable grouping, and it significantly reduces the number of quantum circuit executions by combining compatible observables that can be measured together.
Two observables are considered compatible if they commute, meaning their order of measurement does not affect the outcome. Mathematically, observables A and B are compatible if [A, B] = AB - BA = 0. In practical terms, this means they share a common set of eigenvectors, so measuring one does not disturb the state required for measuring the other. As a result, they can be measured simultaneously in a shared eigenbasis.
The observable grouping process generally involves the following steps:
- Identifying Compatible Observables: Identify commuting subsets of observables by analyzing their Pauli strings. A simple approach looks for observables acting on disjoint qubits, while more advanced methods convert the Hamiltonian into a graph and apply techniques like Minimum Clique Cover or Graph Colouring. These reduce measurement groups more effectively but can incur significant classical overhead for large Hamiltonians, so should be used selectively.
- Grouping Observables: Once compatible subsets are identified, group them together so that each group can be measured in a single circuit run.
- Measurement: Apply a suitable basis transformation, if needed, so that all observables in the group are diagonal in the measurement basis. Then perform the measurement.
- Post-Processing: Extracting the expectation values of the individual observables from the measurement results. This may require some classical post-processing to separate the contributions of each observable in the group.
By reducing the number of circuit executions, observable grouping minimizes the impact of noise and errors inherent in NISQ devices and speeds up the overall computation, as mentioned before.
But the story does not end here: this is an active area of research, with tweaks done here and there to exploit structures for a specific application and specific mathematical properties. There are other creative approaches fueled by deep mathematical theory and quantum phenomena that can bring the savings in quantum resources even lower. Other approaches, like Classical Shadows, employ a “measure now, ask later” methodology where one carries out a set of mathematically-related randomized measurements to take different “snapshots” of the quantum state, which can be post-processed later to compute the expectation values of different observables.
How Divi Simplifies Observable Grouping
Several open-source implementations support observable grouping in practice. Most notably, PennyLane offers a circuit transformation function that splits a quantum circuit measuring a Hamiltonian into multiple subcircuits, each corresponding to a measurement group (as described in step 2 above). It also provides a post-processing function to compute the final expectation value. Users need to run the circuits and feed the results back in the expected format and PennyLane can reconstruct the expectation value.
PennyLane supports two grouping strategies:
- Wires: a greedy algorithm that assigns observables to unused qubits.
- Qubit-wise commutativity: a more sophisticated method using a graph-based approach to identify compatible observables.
Alternatively, Qiskit offers a plugin that leverages its internal graph utilities to generate commuting observable groups.
While existing tools like PennyLane and Qiskit provide the core functionality for observable grouping, they remain relatively low-level and require users to assemble the entire workflow themselves. PennyLane, for example, offers the transformation and post-processing functions, but you’re responsible for building and managing the full measurement pipeline. Qiskit’s grouping utility, meanwhile, lives in a separate plugin designed primarily for circuit cutting, which can make it awkward and unintuitive to integrate directly into workflows focused on expectation value estimation.
Divi addresses this complexity by offering a high-level, user-friendly API that wraps around these lower-level tools. Rather than reinventing the wheel, Divi leverages mature, well-tested libraries like PennyLane, but automates and orchestrates the entire pipeline. From grouping observables to formatting execution requests and handling post-processing, Divi handles it all behind the scenes.
All the user needs to do is select a grouping strategy. Divi automatically tracks the Hamiltonian structure, generates the measurement groups, converts them into an intermediate format, dispatches them for execution, and processes the results, seamlessly integrating with the broader Qoro service stack.
The result is a streamlined experience that drastically lowers the barrier to using advanced optimization techniques, making resource-efficient quantum computing accessible without deep technical expertise or manual setup.
Observable Grouping in Action: Performance Gains
With just a few lines of Python, Divi lets you run grouped quantum measurements effortlessly:
qaoa_problem = QAOA(
problem=qubo_array,
n_layers=2,
optimizer=Optimizers.NELDER_MEAD,
grouping_strategy="qwc",
qoro_service=QoroService(API_KEY),
)
qaoa_problem.run()
qaoa_problem.compute_final_solution()
That’s all it takes—Divi handles the heavy lifting behind the scenes: observable grouping, circuit transformation, and post-processing. This example is a full QAOA problem, defined as a QUBO. A user can select their parameters, enter their QUBO formulated problem, and Divi takes care of the rest.
In the figure below, we compare no grouping, to wire grouping, to QWC grouping. The savings are significant, so much that with QWC it is too small a value (1) to be seen in the plot. The savings further scale with with the number of iterations, using a highly reduced total number of circuits per iteration, leading to significant savings overall.

Another example is in quantum chemistry. Here, more complicated observables are generated, so the savings are not as extreme as in the QUBO case, but still, they are significant enough to warrant the use of grouping the observables. Again, the total amount of code is reduced to a very small amount. Divi handles generating all of the circuits needed to run this complex simulation. Through the Qoro service, circuits are executed automatically on a diverse set of backends, all of the complicated hardware decisions automated away.
vqe_problem = VQE(
symbols=["H", "H", "H", "H", "H", "H"],
bond_length=0.5,
grouping_strategy="qwc",
ansatz=VQEAnsatze.HARTREE_FOCK,
optimizer=Optimizers.MONTE_CARLO,
qoro_service=QoroService(API_KEY),
)
vqe_problem.run()
Below, we see that there is again a significant savings for the various molecules we tested.

Divi in Beta: Simplifying Quantum Programming at Scale
Divi is currently in its beta testing phase, and we’re excited to see how developers and researchers put it to work.
At its core, Divi is built to lower the barrier to advanced quantum programming—reducing the need to deeply understand every optimization technique or manage the infrastructure required to run complex quantum workloads across diverse hardware backends. Backed by Qoro’s platform, Divi handles orchestration, optimization, and execution intelligently and transparently—so you can focus on your algorithm, not the plumbing behind it.
Whether you’re exploring hybrid algorithms like QAOA or running VQE on simulators or real quantum devices, Divi ensures you’re using quantum resources efficiently—with less code, less overhead, and much more control.
We’re continuing to evolve the platform and would love feedback from the community. If you’re interested in trying Divi, reach out to join the beta program and help shape the future of resource-aware quantum programming.
References
[1] Vladyslav Verteletskyi, Tzu-Ching Yen, Artur F. Izmaylov; Measurement optimization in the variational quantum eigensolver using a minimum clique cover. J. Chem. Phys. 31 March 2020; 152 (12): 124114. https://doi.org/10.1063/1.5141458
[2] https://docs.pennylane.ai/en/stable/code/api/pennylane.transforms.split_non_commuting.html
[3] https://docs.quantum.ibm.com/api/qiskit-addon-cutting/utils-observable-grouping
[4] https://qamuy.qunasys.com/docs/en/input/observable_grouping.html