dense_ev implements expectation value measurements in Qiskit using optimal
dense grouping arXiv:quant-ph/2305.11847.
For an
Create a virtual environment to sandbox the installation (optional):
python3 -m venv test-env && source ./test-env/bin/activate
Install from GitHub:
```bash
pip install git+ssh://git@github.com/atlytle/dense-ev.git
A test function comparing results using abelian and dense grouping with exact results is available:
from dense_ev.test_estimator import test_random
m = 3 # n_qubits
run_unit_tests(m)
2024-01-07: Support for dense Pauli grouping
in the Aer Estimator
primitive merged to main
branch.
See usage example below.
2024-05-30: Functionality using Opflow
and other deprecated classes
has been removed. Package requirements changed from qiskit < 0.43.0
to qiskit
(v1.0). Added qiskit_aer
requirement.
The Aer implementation of Estimator
is extended to incorporate
dense Pauli grouping, and can be invoked using the keyword
argument abelian_grouping="DENSE"
. See test_estimator.py
for a more complete listing.
from dense_ev.estimator_from_aer import Estimator
...
# Dense result.
nshots = 200000
approx = False
grouping = "DENSE"
run_options = {"shots": nshots, "seed": seed}
estimator = Estimator(
run_options=run_options, abelian_grouping=grouping, approximation=approx)
result_dense = estimator.run(state, H, shots=nshots).result().values
...