dense_ev
dense_ev implements expectation value measurements in Qiskit using optimal dense grouping arXiv:quant-ph/2305.xxxx. For an $m$-qubit operator that includes all Pauli strings in its decomposition, it provides a speedup of $2^m$ compared to naive evaluation of all strings, and $(3/2)^m$ compared to grouping based on qubit-wise commuting (QWC) families.
Installation
Create a virtual environment to sandbox the installation (optional):
python3 -m venv test-env && source ./test-env/bin/activate
To install,
pip install dense-ev
Install from GitHub:
pip install git+ssh://git@github.com/atlytle/dense-ev.git
To run unit tests,
from dense_ev.test_op import run_unit_tests
run_unit_tests()
Qiskit version compatibility
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.
Usage
Functionality for naive and QWC groupings is provided in Qiskit
by the PauliExpectation class. DensePauliExpectation extends the functionality
to dense optimal grouping, and may be used as a replacement for
PauliExpectation:
from dense_EV import DensePauliExpectation
# Simple expectation values:
...
ev_spec = StateFn(H).compose(psi)
expectation = DensePauliExpectation().convert(ev_spec)
...
# VQE example
...
vqe = VQE(ansatz, optimizer=spsa, quantum_instance=qi,
callback=store_intermediate_result,
expectation=DensePauliExpectation())
result = vqe.compute_minimum_eigenvalue(operator=H)
...
Metadata
Release files for dense-ev 2023.5.22
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dense_ev-2023.5.22.tar.gz | 26.1 kB | Without provenance | Details for dense_ev-2023.5.22.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dense_ev-2023.5.22-py3-none-any.whl | Python 3 | none | any | Details for dense_ev-2023.5.22-py3-none-any.whl |
Total release size: 54.2 kB
Release files / dense_ev-2023.5.22.tar.gz
| Download URL | dense_ev-2023.5.22.tar.gz |
|---|---|
| Size | 26.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e9602f486d841efa9ed5f821a35e92425f557f6dde004171516cdf2096924b08
|
|
BLAKE2b-256 checksum How to use checksums |
d191c4d70cca503acee786d07df08252536dba5991ea92fb2789f594d77b5da3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.2
|
Release files / dense_ev-2023.5.22-py3-none-any.whl
| Download URL | dense_ev-2023.5.22-py3-none-any.whl |
|---|---|
| Size | 28.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
63cf69a1ebf363b2b0e7d4fe2080cfc1d3ffcade65c95900d223f9d026092fe6
|
|
BLAKE2b-256 checksum How to use checksums |
018925a9d8b463666f62ed0c329efab2948329d5a16a8c51added8a6b78408b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.2
|
Security for dense-ev 2023.5.22
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.