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

Quantum Fisher Information Matrix #657

Closed
DiegoGM91 opened this issue Oct 11, 2022 · 7 comments · Fixed by #1487
Closed

Quantum Fisher Information Matrix #657

DiegoGM91 opened this issue Oct 11, 2022 · 7 comments · Fixed by #1487
Assignees
Labels
enhancement New feature or request quantum_info module PRs and issues related to the quantum information module
Milestone

Comments

@DiegoGM91
Copy link
Contributor

I think it would be useful to incorporate the computation of the Quantum Fisher Information Matrix (QFIM) in qibo. The QFIM is defined for parametrized (i.e. variational) quantum circuits, and it quantifies the distance traveled in Hilbert space for small variations of the variational parameters. Its rank is equal to the number of orthogonal directions that the circuit can have access to in Hilbert space.

Here is a lovely review about the QFIM: https://arxiv.org/abs/2103.15191

I already have a code that computes the QFIM, from a previous project, so I can try to give it a go.

But maybe a discussion with @scarrazza and @stavros11 would be useful for me before that.

@DiegoGM91 DiegoGM91 added the enhancement New feature or request label Oct 11, 2022
@renatomello
Copy link
Contributor

renatomello commented Oct 13, 2022

Adding to this, I think Qibo could have a module like Qiskit's quantum_info with several useful measures (e.g. fidelities and norms), and operators (e.g. Clifford and Pauli groups), and the QFIM would fit in the module IMO.

@scarrazza
Copy link
Member

We have discussed this issue yesterday and we fully agree, Diego will have a go for QFIM.

@renatomello
Copy link
Contributor

I (with @stavros11 major help) already have a few things up and running w.r.t. Pauli basis and operators. It could be added to the module. Also, I could have a go for the measures.

@scarrazza
Copy link
Member

Great, @renatomello could you please coordinate this effort with @DiegoGM91 and @stavros11?

@renatomello
Copy link
Contributor

Great, @renatomello could you please coordinate this effort with @DiegoGM91 and @stavros11?

Sure

@stavros11
Copy link
Member

stavros11 commented Oct 13, 2022

We were discussing earlier with @DiegoGM91 and apparently the Fisher Information Matrix is calculated using the parameter shift rule. Given that this is a very useful tool for people working with variational circuits, I believe it would make sense to first implement this in qibo and then base the Fisher Information on top of it. @MatteoRobbiati already implemented the parameter shift in #654, but this is only an example that is not part of the main code. We should consider moving parts of this example to qibo core.

The main points during our discussion today:

  • We should think of what would be a good API for the parameter shift from the user perspective. For example it could be a circuit method, but we are not sure as it also requires a loss. @DiegoGM91 may give a try to sketch something for this.
  • Fisher Information requires second order parameter shift and is not clear if we can have a flexible enough implementation that accommodates different orders.
  • The implementation should be backend dependent and act differently on hardware and simulation. For example in simulation we can use tricks like caching to potentially speed up the calculation. Such tricks are not possible on hardware. The front API should be unique, though, so that the same code runs with all backends (like circuit.execute).

@renatomello renatomello linked a pull request Oct 14, 2024 that will close this issue
4 tasks
@renatomello renatomello self-assigned this Oct 16, 2024
@renatomello renatomello added the quantum_info module PRs and issues related to the quantum information module label Oct 16, 2024
@renatomello renatomello added this to the Qibo 0.2.13 milestone Oct 16, 2024
@renatomello
Copy link
Contributor

@DiegoGM91 if it still interests you, this was finally implemented and recently merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request quantum_info module PRs and issues related to the quantum information module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants