add quantum quantization article (#129)

This commit is contained in:
Andrey Vasnetsov
2023-04-01 11:51:56 +02:00
committed by GitHub
parent 45518c1b3a
commit 021c9b23dc
9 changed files with 103 additions and 0 deletions
@@ -0,0 +1,47 @@
---
title: Vector Search in constant time
short_description: Apply Quantum Computing to your search engine
description: Quantum Quantization enables vector search in constant time. This article will discuss the concept of quantum quantization for ANN vector search.
preview_dir: /articles_data/quantum-quantization/preview
social_preview_image: /articles_data/quantum-quantization/social_preview.png
small_preview_image: /articles_data/quantum-quantization/icon.svg
weight: 1
author: Prankstorm Team
author_link: https://www.youtube.com/watch?v=dQw4w9WgXcQ
date: 2023-04-01T00:48:00.000Z
---
The advent of quantum computing has revolutionized many areas of science and technology, and one of the most intriguing developments has been its potential application to artificial neural networks (ANNs). One area where quantum computing can significantly improve performance is in vector search, a critical component of many machine learning tasks. In this article, we will discuss the concept of quantum quantization for ANN vector search, focusing on the conversion of float32 to qbit vectors and the ability to perform vector search on arbitrary-sized databases in constant time.
## Quantum Quantization and Entanglement
Quantum quantization is a novel approach that leverages the power of quantum computing to speed up the search process in ANNs. By converting traditional float32 vectors into qbit vectors, we can create quantum entanglement between the qbits. Quantum entanglement is a unique phenomenon in which the states of two or more particles become interdependent, regardless of the distance between them. This property of quantum systems can be harnessed to create highly efficient vector search algorithms.
The conversion of float32 vectors to qbit vectors can be represented by the following formula:
```
qbit_vector = Q( float32_vector )
```
where Q is the quantum quantization function that transforms the float32_vector into a quantum entangled qbit_vector.
## Vector Search in Constant Time
The primary advantage of using quantum quantization for ANN vector search is the ability to search through an arbitrary-sized database in constant time.
The key to performing vector search in constant time with quantum quantization is to use a quantum algorithm called Grover's algorithm.
Grover's algorithm is a quantum search algorithm that finds the location of a marked item in an unsorted database in O(√N) time, where N is the size of the database.
This is a significant improvement over classical algorithms, which require O(N) time to solve the same problem.
However, the is one another trick, which allows to improve Grover's algorithm performanse dramatically.
This trick is called transposition and it allows to reduce the number of Grover's iterations from O(√N) to O(√D), where D - is a dimension of the vector space.
And since the dimension of the vector space is much smaller than the number of vectors, and usually is a constant, this trick allows to reduce the number of Grover's iterations from O(√N) to O(√D) = O(1).
Check out our [Quantum Quantization PR](https://github.com/qdrant/qdrant/pull/1639) on GitHub.
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
id="Layer_1"
data-name="Layer 1"
viewBox="0 0 512 512"
version="1.1"
sodipodi:docname="icon.svg"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
id="namedview11"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="true"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="1.7011719"
inkscape:cx="166.64983"
inkscape:cy="256"
inkscape:window-width="2560"
inkscape:window-height="1048"
inkscape:window-x="0"
inkscape:window-y="32"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" />
<defs
id="defs4">
<style
id="style2">.cls-1{fill:#141f38;}</style>
</defs>
<title
id="title6">atom-glyph</title>
<path
class="cls-1"
d="M332.89,256a64.11,64.11,0,1,1-64.11-64A64.05,64.05,0,0,1,332.89,256ZM503.35,391c-15.42,26.7-49.51,39.7-93.81,39.7A263.61,263.61,0,0,1,379,428.82a38.39,38.39,0,0,1-50.35,53.56C310.78,501.26,290.41,512,268.78,512c-37.94,0-72-32.93-95.49-85.23a279.84,279.84,0,0,1-45.25,4c-44.3,0-78.39-13-93.81-39.7-19.94-34.53-4.38-84.58,36.21-135a283.53,283.53,0,0,1-19.7-27.62,38.38,38.38,0,0,1-25.09-72.54c-.13-12.75,2.59-24.53,8.57-34.89,15.42-26.7,49.51-39.7,93.81-39.7a279.86,279.86,0,0,1,45.27,4C196.77,32.92,230.85,0,268.78,0s72,32.93,95.49,85.22a295.31,295.31,0,0,1,33.58-3.66A38.44,38.44,0,0,1,473.65,94c12.91,6.47,23,15.42,29.7,26.93,19.94,34.52,4.37,84.58-36.21,135C507.72,306.46,523.3,356.52,503.35,391ZM373.94,109.61a403.67,403.67,0,0,1,17.91,74.59A459.57,459.57,0,0,1,450,236.31c3.09-4,6.08-8,8.85-12,25.87-37.31,34-70.33,22.28-90.6-4.28-7.42-11-12.82-18.72-16.76a38.45,38.45,0,0,1-61.18-9.92A260,260,0,0,0,373.94,109.61Zm-6,204.07A481.44,481.44,0,0,0,371.35,256a481.52,481.52,0,0,0-3.42-57.69,546.29,546.29,0,0,0-99.15-57,546.33,546.33,0,0,0-99.15,57.05,488.28,488.28,0,0,0,0,115.36,542.85,542.85,0,0,0,47.91,31,542.51,542.51,0,0,0,51.25,26,542.37,542.37,0,0,0,51.25-26A542.77,542.77,0,0,0,367.94,313.67Zm-35.09,53.21c-10.51,6-21,11.63-31.54,16.83a408.46,408.46,0,0,0,47.25,13.91,349.6,349.6,0,0,0,13.72-48.92C352.79,354.94,343,361,332.84,366.88Zm-128.11,0c-10.16-5.85-19.95-11.94-29.42-18.18A349.52,349.52,0,0,0,189,397.62a408.5,408.5,0,0,0,47.25-13.91C225.77,378.51,215.24,372.93,204.73,366.88ZM140.57,256c0-12.22.46-24.22,1.29-36a404,404,0,0,0-37.69,36,404,404,0,0,0,37.69,36C141,280.21,140.57,268.21,140.57,256Zm64.16-110.89c10.51-6,21-11.63,31.55-16.84A408.48,408.48,0,0,0,189,114.36a349.61,349.61,0,0,0-13.72,48.92C184.78,157,194.57,151,204.73,145.11Zm128.11,0C343,151,352.79,157,362.26,163.28a349.58,349.58,0,0,0-13.72-48.92,408.72,408.72,0,0,0-47.24,13.91C311.81,133.48,322.34,139.06,332.84,145.11ZM397,256c0,12.21-.46,24.21-1.29,36a404,404,0,0,0,37.7-36,403.8,403.8,0,0,0-37.7-36C396.54,231.78,397,243.78,397,256ZM199.05,90.44a464.64,464.64,0,0,1,69.73,23,464.72,464.72,0,0,1,69.73-23c-19.61-41-45.37-64.84-69.73-64.84S218.66,49.48,199.05,90.44ZM87.57,236.31a459.65,459.65,0,0,1,58.15-52.11,403.6,403.6,0,0,1,17.91-74.59,250,250,0,0,0-35.6-2.76c-20.94,0-58.08,3.49-71.6,26.89-3.6,6.23-5.31,13.68-5.22,22.07A38.27,38.27,0,0,1,71,212.42c2.38,3.92,4.92,7.89,7.72,11.92S84.48,232.33,87.57,236.31Zm76.06,166.07a403.65,403.65,0,0,1-17.91-74.59,459.74,459.74,0,0,1-58.15-52.11c-3.09,4-6.08,8-8.85,12C52.85,325,44.73,358,56.44,378.25,70,401.64,107.1,405.14,128,405.14A249.86,249.86,0,0,0,163.63,402.38ZM310.76,464a38.19,38.19,0,0,1,11.84-46.61,479.66,479.66,0,0,1-53.81-18.83,464.68,464.68,0,0,1-69.74,23c19.61,41,45.37,64.85,69.74,64.85C282.8,486.4,297.26,478.47,310.76,464Zm148.1-176.32c-2.77-4-5.76-8-8.85-12a459.54,459.54,0,0,1-58.16,52.11,403.67,403.67,0,0,1-17.91,74.59,250,250,0,0,0,35.6,2.76c20.94,0,58.08-3.49,71.6-26.89C492.85,358,484.73,325,458.86,287.65Z"
id="path8"
style="fill:#ffffff" />
<metadata
id="metadata296">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:title>atom-glyph</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
</svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1015 KiB