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

Update the Quantum Kernel tutorial to add use-case of FidelityStatevectorKernel #658

Open
Jay-Patel-257 opened this issue Jun 9, 2023 · 4 comments
Assignees
Labels
type: feature request 💡 New feature or request

Comments

@Jay-Patel-257
Copy link

What should we add?

FidelityStatevectorKernel is recently introduced and I think adding its implementation to the 03_quantum_kernel.ipynb would be a good way to highlight it.

I'll be happy to do that!

@Jay-Patel-257 Jay-Patel-257 added the type: feature request 💡 New feature or request label Jun 9, 2023
@adekusar-drl
Copy link
Collaborator

I think it is a good idea. Before you move on to the actual code, can you please briefly summarize how exactly you'd like to extend the tutorial?

@Jay-Patel-257
Copy link
Author

Jay-Patel-257 commented Jun 9, 2023

Sure!

Before the introduction of FidelityStatevectorKernel, the method to use statevector simulations to calculate the kernel matrix was like this: Use simulator_statevector as a backend in the Sampler options for the FidelityQuantumKernel. But now with FidelityStatevectorKernel this simulation becomes intrinsic property of the kernel and together with option to cache the statevector, it becomes more efficient. The goal would be to highlight this and to show how to implement the Kernel.

This can be added in the section 2.2 Defining the quantum kernel and following sections of the tutorial. The implementation can also be added in the sections 3.2 and 4.2 but that would be redundant. I wanted to find a dedicated use-case for FidelityStatevectorKernel but currently I don't have one. If you have any ideas, do let me know!

@adekusar-drl
Copy link
Collaborator

Use simulator_statevector as a backend in the Sampler options for the FidelityQuantumKernel.

This does not help much. The goal of FidelityStatevectorKernel is to reduce the number of operations from $O(N^2)$ to $O(N)$. And whatever simulator is used by FidelityQuantumKernel it is still $O(N^2)$.

This can be added in the section 2.2 Defining the quantum kernel and following sections of the tutorial. The implementation can also be added in the sections 3.2 and 4.2 but that would be redundant. I wanted to find a dedicated use-case for FidelityStatevectorKernel but currently I don't have one. If you have any ideas, do let me know!

I'd add a section 2.6 describing the pros and cons of using FidelityStatevectorKernel and a simple example. The use case - performance, apparently FidelityStatevectorKernel is faster. I think this should be enough.

@Jay-Patel-257
Copy link
Author

Thanks for the info about the complexity! I agree with your suggestion. I'll do it accordingly!

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

2 participants