Qiskit / benchpress

Apache License 2.0
19 stars 13 forks source link

Adding Hamiltonians from HamLib to benchpress #49

Closed sbrandhsn closed 1 month ago

sbrandhsn commented 1 month ago

Fixes #22

This PR includes a set of Hamiltonians from HamLib (paper: https://ieeexplore.ieee.org/document/10313872, data: https://portal.nersc.gov/cfs/m888/dcamps/hamlib/) at benchpress/hamiltonian/hamlib/100_representative.json. The representative set includes 35 Hamiltonians each from the chemistry and condensed matter physics categories and 15 Hamiltonians each from the binary optimization and discrete optimization categories. The file benchpress/hamiltonian/hamlib/100_representative.json contains a list of dictionaries with keys ham_category, ham_primary_type, ham_problem, ham_instance, ham_qubits, ham_terms, ham_hamlib_hamiltonian_terms, ham_hamlib_hamiltonian_coefficients where ham_hamlib_hamiltonian_terms and ham_hamlib_hamiltonian_coefficients includes the Pauli terms and coefficients of the Hamiltonian and the remaining values yield information on the characteristics of that Hamiltonian.

The equivalency of SDK output is checked at benchpress/utilities/validation/hamiltonian.py for small-scale Hamiltonians. A QASM dump of the Hamiltonians can be generated by Qiskit via dump_hamiltonians_to_qasm in benchpress/utilities/io/hamiltonians.py. Note that the QASM files are not an input to the investigated SDKs when running benchpress - the Hamiltonian is passed directly to the SDKs when possible. The function at dump_hamiltonians_to_qasm is a convenience function for users that want to work directly with QASM files.

Qiskit needs 1h 20min for device_transpile on my machine.

CLAassistant commented 1 month ago

CLA assistant check
All committers have signed the CLA.