Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Deprecate encoding.offset while incorporating it into encoding.qubit_op #14

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

garrison
Copy link
Member

@garrison garrison commented May 7, 2022

Summary

Currently, the encode() method results in the operator being spanned across two properties: the traceless part is stored in qubit_op, while the constant offset is stored in offset. The current separation follows the practice of to_ising() is Qiskit Optimization. However, this separation seems unnecessary. It conceptually simplifies things to store the operator entirely in qubit_op, as this PR proposes.

Details and comments

This will aid in solving #8 and with #9 (via the corresponding PR, #13).

@garrison garrison added the encoding quantum random access codes label May 7, 2022
@garrison garrison force-pushed the deprecate-explicit-offset branch from efece40 to 7c9a73a Compare May 8, 2022 00:16
@garrison garrison added the decision needed Decision needed label May 20, 2022
@garrison garrison added the needs: changelog Should be (but has not yet been) noted in the release notes label May 31, 2022
@garrison
Copy link
Member Author

There was some concern previously that storing the identity term within the operator might lead to additional quantum experiments being performed. However, I have convinced myself now that this is not the case, so I'd like to move forward with this PR.

Here's why: Any reasonable implementation of an Estimator -- including the one in BackendEstimator -- is going to call group_commuting (which was introduced in Qiskit Terra 0.21) on the observables before sending them off to hardware. Since the identity term commutes with everything, it will never lead to an additional experiment being performed. There is the corner case where there are no other operators, and in that case could cause one experiment to be performed rather than zero, but that corner case is not of interest to us in QRAO.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
decision needed Decision needed encoding quantum random access codes needs: changelog Should be (but has not yet been) noted in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant