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

Light Cone Transpiler Pass #12792

Open
MarcDrudis opened this issue Jul 19, 2024 · 4 comments
Open

Light Cone Transpiler Pass #12792

MarcDrudis opened this issue Jul 19, 2024 · 4 comments
Labels
type: feature request New feature or request

Comments

@MarcDrudis
Copy link
Contributor

What should we add?

I think it would be a good idea to add a Transpiler pass that computes the light cone of an observable. For those who are not familiar, a light cone is the set of gates in a circuit that affect the measurement of a subset of the qubits. For example, if you have a shallow EfficientSU2 ansatz with pairwise entanglement on 127 qubits and you are trying to measure an expectation value on a single qubit you can typically reduce the circuit to a 20 qubit circuit (just making up the number, in practice it depends). I use it a lot in my research and I know of other researchers that do it as well. We all typically have a naive implementation of it, but it would be a powerful tool to have one that handles edge cases directly implemented into Qiskit.

I can take care of this issue as I already have code that does it. Before tacking this problem, however, it would be wise to first implement the proposal in #12790 to allow for computation of light cones also in parameterized circuits.

@MarcDrudis MarcDrudis added the type: feature request New feature or request label Jul 19, 2024
@spiccinelli
Copy link

I would be interested in participating and happy to help 😄

@Cryoris
Copy link
Contributor

Cryoris commented Jul 19, 2024

This sounds like a nice addition. Though the main motivation might come from classically simulating the circuit, this could be useful when compiling circuits for hardware as we could simplify the compilation problem. Reducing the circuit size could also potentially allow for better routing, but also requires some care (e.g. regarding the user-provided initial layout).

If we'd select the "active" qubits by the presence of the measurement we might need to take special care of mid-circuit measurements. For example, we might only care about the final measurements and could allow removing mid-circuit measurements if they are part of a control-flow that doesn't affect the target measurements. But we can discuss these details at a later stage.

@alexanderivrii
Copy link
Contributor

I think Andrew Eddins (@aeddins-ibm) already has a pass that does exactly this.

@aeddins-ibm
Copy link
Contributor

Hi @alexanderivrii, thanks for pointing that out. @Cryoris reached out to me separately to coordinate, and I believe we are on the same page that my rough-draft code may be used as a starting point if that turns out to be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants