-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add PauliLindbladMap class #14260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Add PauliLindbladMap class #14260
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…on from 'observable' to 'map'
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 14718043077Details
💛 - Coveralls |
Closing this PR as we've decided to change how we're going to organize things. A later PR will introduce |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces
qiskit.quantum_info.PauliLindbladMap
, which is a representation of the Pauli-Lindblad parameterization of maps on n-qubits with a qubit-sparse data format.This initial PR is for setting up the data format, and subsequent PRs will progressively add functionality. As the data-storage format requirements of
PauliLindbladMap
are the same as that ofSparseObservable
(storing/indexing/iterating over a list of tuples of[coeff, operator]
in qubit-sparse format), this PR consists entirely of copying/modifying components of theSparseObservable
mod.rs
file. I've attempted to copy over all of the relevant instantiation and indexing functionality (and relevant tests).Details and comments
The changes to the copied$\sum_{(c, A)} c A$ (for $c$ <-> $A$ <-> $\exp(\sum_{(c, A)} c L(A))$ , where $L(A) = A \cdot A - \cdot$ . (I.e. the data of
SparseObservable
code are primarily due to the different interpretation of what the[coeff, operator]
pairs being stored represent.SparseObservable
represents the sumcoeff
,operator
), whereasPauliLindbladMap
representsPauliLindbladMap
are the terms in a generator sum, and the object itself represents the exponential.) Below is a list of (hopefully nearly-comprehensive) changes to the copied code:pauli_bases
) have been removed as they are no longer relevant if non-Pauli symbols are not present.to_observable
method ofSparseTerm
has been renamedto_pauli_lindblad_map
from_label
,from_pauli
, andfrom_sparse_pauli_op
have not been included. These methods make sense forSparseObservable
, but would be ambiguous or not well-defined/natural forPauliLindbladMap
.PauliLindbladMap.identity
constructor method is implemented asSparseObservable.zero
, and there is noPauliLindbladMap.zero
map.PauliLindbladMap.identity
should build the identity map, which means a map with zero generator terms. Data-wise this is equivalent to whatSparseObservable.zero
(it builds an empty list, which is interpreted as the zero operator).PauliLindbladMap.zero
, if it were to exist, should represent the zero map, which can't actually be directly represented in the parameterization given byPauliLindbladMap
(and is not particularly useful in any case).f64
(forSparseObservable
they are of typeComplex64
).__repr__
has been changed to precede the operator parts in the string with anL
, e.g.L(Z_1 X_0)
.SparseObservable
, but I think it was necessary to make things self-consistent.Other notes for reviewers
coeffs
torates
forPauliLindbladMap
, but at some point I decidedcoeffs
was an acceptable name. I can still make this change if it makes sense.SparseTerm
class (both the rust/python variants) could be renamed toQubitSparsePauli
, butSparseTerm
here represents both a qubit-sparse Pauli and a coefficient, whereasQubitSparsePauli
would be just the operator.pauli_fidelity
method for calculating the maps fidelity for a given Pauli.sample
method would be (it will need to return a list of qubit-sparse Paulis in whatever format we decide on).QubitSparsePauli
as a new class, and then rewriteSparseTerm
to contain a coefficient and aQubitSparsePauli
, and re-implement the attributes to just return the contents ofQubitSparsePauli
PauliLindbladMap
references thecanonicalize
method, which I haven't yet copied over. I'd like to do this in a subsequent PR but didn't want to delete the reference to this method so that I don't forget to put it back in later.