Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
atlytle committed May 28, 2024
2 parents 11ca1a1 + 95a69e3 commit 647e509
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ run_unit_tests()
Note that **dense_ev** specifies `qiskit < 0.43.0`, as the `Opflow` and
`QuantumInstance` packages have been deprecated as of `Qiskit 0.43.0`.
We plan to update the code to function with the new `primitives` as this
migration continues and more documentation becomes available.
migration continues and more documentation becomes available.
**Update 2024-01-07**: Support for dense Pauli grouping
in the Aer `Estimator` primitive merged to `main` branch.
See usage example below.

## Usage
Functionality for naive and QWC groupings is provided in Qiskit
Expand Down Expand Up @@ -63,3 +66,25 @@ result = vqe.compute_minimum_eigenvalue(operator=H)

```

### Estimator support
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 comparing no and abelian grouping.
```python
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

...

```
3 changes: 3 additions & 0 deletions src/dense_ev/estimator_from_aer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.
#
# Modifications copyright (C) 2023 University of Illinois at Urbana-Champaign
# Author: Andrew Lytle

"""
Estimator class.
Expand Down

0 comments on commit 647e509

Please sign in to comment.