Skip to content
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

Add apply_layout to PauliList #12302

Open
chriseclectic opened this issue Apr 26, 2024 · 1 comment
Open

Add apply_layout to PauliList #12302

chriseclectic opened this issue Apr 26, 2024 · 1 comment
Labels
mod: quantum info Related to the Quantum Info module (States & Operators) type: feature request New feature or request

Comments

@chriseclectic
Copy link
Member

chriseclectic commented Apr 26, 2024

What should we add?

An apply_layout method was recently added to the Pauli operator, but not to a PauliList. PauliList is a convenient input for EstimatorV2 to represent a 1D list of Pauli's to measure, so should also have an apply_layout method.

Eg to measure Z operators on each single qubit in a list of N-qubits mapped to a bigger device one should be able to do:

obs = PauliList.from_symplectic(np.eye(N), np.zeroes((N, N))).apply_layout(isa_circuit.layout)
@chriseclectic chriseclectic added the type: feature request New feature or request label Apr 26, 2024
@ShellyGarion ShellyGarion added the mod: quantum info Related to the Quantum Info module (States & Operators) label Apr 29, 2024
@garrison
Copy link
Member

garrison commented May 6, 2024

Cross-referencing #11824, as the current issue is a specific subcase of that one.

Having this proposed feature would be desirable in the circuit-knitting-toolbox for a how-to guide I am writing: Qiskit-Extensions/circuit-knitting-toolbox#573 (comment). In the meantime, we will either need to unnecessarily create a SparsePauliOp from the PauliList in order to call SparsePauliOp.apply_layout, or provide users with a utility function in CKT that can apply a TranspileLayout to a PauliList.

Our PauliList represents a list of Pauli terms restricted to one subsystem of the cut circuit. We could iterate and apply this to each Pauli individually, but it will be more efficient (and more succinct) to be able to do this without having to convert it away from a PauliList.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod: quantum info Related to the Quantum Info module (States & Operators) type: feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants