qiskit-machine-learning icon indicating copy to clipboard operation
qiskit-machine-learning copied to clipboard

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

Open Jay-Patel-257 opened this issue 1 year ago • 4 comments

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 avatar Jun 09 '23 09:06 Jay-Patel-257

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?

adekusar-drl avatar Jun 09 '23 13:06 adekusar-drl

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!

Jay-Patel-257 avatar Jun 09 '23 16:06 Jay-Patel-257

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.

adekusar-drl avatar Jun 09 '23 17:06 adekusar-drl

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

Jay-Patel-257 avatar Jun 09 '23 17:06 Jay-Patel-257