Classiq / classiq-library

The Classiq Library is the largest collection of quantum algorithms and applications. It is the best way to explore quantum computing software. We welcome community contributions to our Library 🙌
https://platform.classiq.io
MIT License
344 stars 307 forks source link

Quantum algorithm: simplified QVAR algorithm #50

Closed JiwonI788 closed 3 months ago

JiwonI788 commented 5 months ago

QVAR algorithm is a quantum algorithm to calculate the variance of dataset. This algorithm is introduced in the paper https://arxiv.org/pdf/2403.14655.pdf by researchers from Universite of Pisa. This paper is also introducing about the QODA(Quantum Outlier Detection Algorithm) and HFQS(Hybrid Quantum Feature Selection) by utilizing the QVAR algorithm, which can be used in the field of AI(Artificial Interlligence).

QVAR algorithm use 3n+s+1 qubits to get the varianve of dataset length $N(=2^n)$ , where s = $O(log 1/\epsilon )$ is decided in the QAE algorithm to measure the result.

In this issue, I developed the simplified circuit of QVAR with one less set of auxiliary qubits(2n+s+1) than the form of the original QVAR algorithm introduced in the paper(3n+s+1), i.e., with a smaller width. This simplified version remain still logarithmic along with the original QVAR algorithm, so there is no asymptotic advatage, but implementing it in fewer qubits is meaningful for practical applications.

In this algorithm,

  1. The dataset will be encoded into quantum state by normalization and amplitude encoding.
  2. The variance of the encoded dataset will be given through the QVAR algorithm.
  3. Measure the auxiliary qubits.(Or Measure the variance by QAE(Quantum Amplitude Estimation) like as the paper.)
  4. Get the variance by product appropriate coefficient, decided by the length and norm of dataset.

The example will be added under the directory classiq-library/community/basic_examples/qvar.

TomerGoldfriend commented 5 months ago

Thank you @JiwonI788, I am assigning you to this issue :-). You can follow the contribution guidelines to open a pull request. If you have any questions or comments, you can ask them here in the issue, or in our slack community, and the Classiq team will be happy to assist.

JiwonI788 commented 4 months ago

Thank you @TomerGoldfriend ! Now I am thinking of submitting the code after I implement the QAE algorithm, though it will take some time. If there is a better way to proceed, please let me know.

TomerGoldfriend commented 4 months ago

Great @JiwonI788 . Everything is good, feel free to proceed in any pace that suits you. If you have any technical questions about the git flow or the implementation, feel free to reach out through our slack community.

TomerGoldfriend commented 3 months ago

Hi @JiwonI788 any update on this? let us know if you have any questions.

amir-naveh commented 3 months ago

@TomerGoldfriend , @JiwonI788 - closed this as it seems its not moving forward. Feel free to reopen if relevant. Thanks!