CN116432760A - Quantum data classification method and device, electronic equipment and storage medium - Google Patents

Quantum data classification method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116432760A
CN116432760A CN202111649248.7A CN202111649248A CN116432760A CN 116432760 A CN116432760 A CN 116432760A CN 202111649248 A CN202111649248 A CN 202111649248A CN 116432760 A CN116432760 A CN 116432760A
Authority
CN
China
Prior art keywords
data
classified
quantum
training data
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111649248.7A
Other languages
Chinese (zh)
Inventor
袁野为
李叶
窦猛汉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Benyuan Quantum Computing Technology Hefei Co ltd
Original Assignee
Benyuan Quantum Computing Technology Hefei Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Benyuan Quantum Computing Technology Hefei Co ltd filed Critical Benyuan Quantum Computing Technology Hefei Co ltd
Priority to CN202111649248.7A priority Critical patent/CN116432760A/en
Publication of CN116432760A publication Critical patent/CN116432760A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Complex Calculations (AREA)

Abstract

The application discloses a quantum data classification method, a quantum data classification device, electronic equipment and a storage medium. The method comprises the following steps: acquiring training data and data to be classified, processing the training data and the data to be classified according to a preset mode, constructing a first preset quantum circuit for data classification according to the processed training data and the data to be classified, operating the first preset quantum circuit, measuring control bits of the first preset quantum circuit, and classifying the data to be classified according to the measurement results of the control bits. By adopting the technology, the data can be classified by the quantum technology, the data processing speed is improved, the parallel acceleration advantage of quantum computing is exerted, and the blank of the related technology is supplemented.

Description

Quantum data classification method and device, electronic equipment and storage medium
Technical Field
The invention belongs to the field of quantum computing, and particularly relates to a quantum data classification method, a quantum data classification device, electronic equipment and a storage medium.
Background
The quantum computer is a kind of physical device which performs high-speed mathematical and logical operation, stores and processes quantum information according to the law of quantum mechanics. When a device processes and calculates quantum information and operates on a quantum algorithm, the device is a quantum computer. Quantum computers are a key technology under investigation because of their ability to handle mathematical problems more efficiently than ordinary computers, for example, to accelerate the time to crack RSA keys from hundreds of years to hours.
The construction of the classification model in the classical algorithm requires a large amount of data to be learned, the model is updated by continuously learning training data so as to achieve the aim of classifying the data, and the data processing speed is slower and more operation resources are wasted due to the huge data amount.
Disclosure of Invention
The invention aims to provide a quantum data classification method, a quantum data classification device, electronic equipment and a storage medium, which are used for solving the defects in the prior art, can realize data classification through a quantum technology, improve the data processing speed, exert the advantage of parallel acceleration of quantum computing, and supplement the blank of the related technology.
In a first aspect, an embodiment of the present application provides a method for classifying quantum data, including:
acquiring training data and data to be classified, processing the training data and the data to be classified according to a preset mode, and constructing a first preset quantum circuit for data classification according to the processed training data and the processed data to be classified;
and running the first preset quantum circuit, measuring control bits of the first preset quantum circuit, and classifying the data to be classified according to the measurement results of the control bits.
Optionally, the processing the training data and the data to be classified according to the preset mode includes:
and adding auxiliary features to the training data and the data to be classified one by one, wherein the auxiliary features are used for enabling the square sum of the training data to be equal to the square sum of the data to be classified.
Optionally, the method further comprises:
normalizing the training data and the data to be classified after the auxiliary features are added.
Optionally, the constructing a first preset quantum circuit for data classification according to the processed training data and the data to be classified includes:
amplitude coding is carried out on the training data after processing and the data to be classified;
generating a data module to be classified according to the data to be classified after the amplitude encoding;
generating a training data module according to the HIL line and the training data after the amplitude coding;
and constructing the first preset quantum circuit according to the data module to be classified and the training data module.
Optionally, the classifying the data to be classified according to the measurement result of the control bit includes:
if the probability that the control bit is in the 1 state is more than one half, judging that the data to be classified is in the +1 type;
and if the probability that the control bit is in the 1 state is less than one half, judging that the data to be classified is of the type-1.
Optionally, before running the first preset quantum wire, the method further includes:
acquiring a preset number of training data, and traversing the similarity of every two training data in the training data based on a second preset quantum circuit;
and generating a kernel matrix K according to the similarity of every two data in the training data, and encoding the kernel matrix K to the HIL line.
Optionally, after the generating the kernel matrix K, the method further includes:
obtaining vector quantum states from a kernel matrix K
Figure BDA0003444508150000021
And a constant b, said k, said +.>
Figure BDA0003444508150000022
The following relation is satisfied with the constant b:
Figure BDA0003444508150000023
where k is the kernel matrix, γ is the probability threshold set,
Figure BDA0003444508150000024
is a classification label corresponding to training data, and the classification label is +1 or-1.
In a second aspect, an embodiment of the present application provides a device for classifying quantum data, including:
the acquisition unit is used for acquiring training data and data to be classified, processing the training data and the data to be classified according to a preset mode, and constructing a first preset quantum circuit for data classification according to the processed training data and the processed data to be classified;
the classifying unit is used for operating the first preset quantum circuit, measuring the control bit of the first preset quantum circuit, and classifying the data to be classified according to the measurement result of the control bit.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, the programs including instructions for performing steps in the method described in the first aspect of the embodiment of the present application.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, where the computer program causes a computer to perform some or all of the steps described in the method according to the first aspect of the embodiments of the present application.
In a fifth aspect, embodiments of the present application provide a computer program product, wherein the computer program product comprises a non-transitory computer readable storage medium storing a computer program, the computer program being operable to cause a computer to perform some or all of the steps described in the method according to the first aspect of the embodiments of the present application. The computer program product may be a software installation package.
In a sixth aspect, embodiments of the present application provide a quantum computer operating system, where the quantum computer operating system implements a sorting process of quantum data according to some or all of the steps described in the method according to the first aspect of the embodiments of the present application.
It can be seen that in the embodiment of the present application, training data and data to be classified are obtained, the training data and the data to be classified are processed according to a preset manner, a first preset quantum circuit for data classification is constructed according to the processed training data and the data to be classified, the first preset quantum circuit is operated, control bits of the first preset quantum circuit are measured, and the data to be classified is classified according to measurement results of the control bits. By adopting the quantum computing technology, the data classification is realized through the quantum technology, the data processing speed is improved, the parallel acceleration advantage of quantum computing is exerted, and the blank of the related technology is supplemented.
Drawings
Fig. 1 is a schematic diagram of a method flow of a quantum data classification method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a classification circuit of quantum data according to an embodiment of the present application;
FIG. 3-a is a schematic diagram of a classification circuit of another quantum data provided in an embodiment of the present application;
FIG. 3-b is a schematic diagram of a classification circuit of another quantum data provided in an embodiment of the present application;
FIG. 3-c is a schematic diagram of a classification circuit of another quantum data provided in an embodiment of the present application;
fig. 4 is a schematic diagram of a quantum data sorting apparatus according to an embodiment of the present application;
fig. 5 is a hardware structural block diagram of a computer terminal according to a quantum data classification method provided in an embodiment of the present application.
Detailed Description
The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the invention.
The embodiment of the application provides a quantum data classification method, a quantum data classification device, electronic equipment and a storage medium to solve the defects in the prior art, and can realize data classification through quantum technology.
It should be noted that, the quantum program referred to in the embodiments of the present application is a program written in a classical language to characterize qubits and their evolution, where qubits, quantum logic gates, and the like related to quantum computing are all represented by corresponding classical codes.
Quantum circuits, which are one embodiment of quantum programs, also weigh sub-logic circuits, are the most commonly used general quantum computing models, representing circuits that operate on qubits under an abstract concept, the composition of which includes qubits, circuits (timelines), and various quantum logic gates, and finally the results often need to be read out by quantum measurement operations. The quantum circuit may be presented in a sequence of quantum logic gates arranged in a certain execution timing sequence.
Unlike conventional circuits that are connected by metal lines to pass voltage or current signals, in quantum circuits, the circuits can be seen as being connected by time, i.e., the state of the qubit naturally evolves over time, as indicated by the hamiltonian operator, during which the circuit is operated until the quantum logic gate is encountered.
A quantum program is generally corresponding to a total quantum circuit, where the quantum program refers to the total quantum circuit, and the total number of qubits in the total quantum circuit is the same as the total number of qubits in the quantum program. It can be understood that: one quantum program may consist of a quantum circuit, a measurement operation for the quantum bits in the quantum circuit, a register to hold the measurement results, and a control flow node (jump instruction), and one quantum circuit may contain several tens to hundreds or even thousands of quantum logic gate operations. The execution process of the quantum program is a process of executing all quantum logic gates according to a certain time sequence. Note that the timing is the time sequence in which a single quantum logic gate is executed.
It should be noted that in classical computation, the most basic unit is a bit, and the most basic control mode is a logic gate, and the purpose of the control circuit can be achieved by a combination of logic gates. Similarly, the way in which the qubits are handled is a quantum logic gate. Quantum logic gates are used, which are the basis for forming quantum lines, and include single-bit quantum logic gates (or single-quantum logic gates, abbreviated as "single gates"), such as Hadamard gates (H gate, ada Ma Men), bery-X gates (X gate), bery-Y gates (Y gate), bery-Z gates (Z gate), RX gates, RY gates, RZ gates, and the like; two-bit quantum logic gates (or double quantum logic gates, simply "double gates"), such as CNOT gates, CR gates, SWAP gates, ISWAP gates, and the like; multi-bit quantum logic gates (or multi-quantum logic gates, simply "multi-gates"), such as Toffoli gates, and the like. Quantum logic gates are typically represented using unitary matrices, which are not only in matrix form, but also an operation and transformation. The effect of a general quantum logic gate on a quantum state is calculated by multiplying the unitary matrix by the matrix corresponding to the right vector of the quantum state. For example, the quantum state right vector |0>The corresponding vector is
Figure BDA0003444508150000051
Quantum state right vector |1>The corresponding vector is +.>
Figure BDA0003444508150000052
Quantum states, i.e., the logical states of a qubit. In the quantum algorithm (or weighing subroutine), for the quantum states of a group of quantum bits contained in the quantum circuit, a binary expression mode is adopted, for example, the group of quantum bits are q1, q2 and q3, the 1 st, 2 nd and 3 rd quantum bits are represented, the q3q2q1 are ordered from high order to low order in the binary expression mode, the quantum states corresponding to the group of quantum bits share the number of times of the total number of 2 quantum bits, namely 8 eigenstates (determined states): the bits of each quantum state correspond to the quantum bits in accordance with each other, i 000>, i001 >, i010 >, i011 >, i100 >, i101 >, i110 >, i111 >, e.g., the state of i 001> with the higher to lower bits corresponding to q3q2q1, and the symbol of i > is dirac.
Described in terms of a single qubit, the logic state ψ of a single qubit may be at |0>State, |1>State, |0>State sum |1>The superimposed state (uncertainty state) of the states can be expressed in particular as ψ=a|0>+b|1>Where a and b are complex numbers representing the amplitude (probability amplitude) of the quantum states, the square of the modulus of the amplitude represents the probability, |a| 2 、|b| 2 Respectively indicate that the logic state is |0>State, |1>Probability of state, |a| 2 +|b| 2 =1. In short, a quantum state is an superposition of eigenstates, when the probability of the other states is 0, i.e. in a uniquely defined eigenstate.
The application provides a quantum data classification method, which aims to solve the defects in the prior art and can realize data classification through quantum technology.
Referring to fig. 1, a schematic flow chart of a method for classifying quantum data according to an embodiment of the present application includes:
101. acquiring training data and data to be classified, processing the training data and the data to be classified according to a preset mode, and constructing a first preset quantum circuit for data classification according to the processed training data and the processed data to be classified;
in this embodiment, training data and data to be classified are obtained, and the training data and the data to be classified are subjected to dimension lifting and normalization recoding, so that a training data module is constructed according to a preset HHT line and the training data, a data module to be classified is constructed according to the data to be classified, and a first preset quantum line for data classification is constructed according to the training data module and the data module to be classified.
Specifically, the training data and the data to be classified are up-scaled to reduce the influence of the feature loss caused by normalization, and if the training data and the data to be classified are eight sets of two-dimensional data and are (1, 2), (3, 4), (1, 3),(2, 3), (2, 4), (1, 4), (2, 2), (2, 1), taking the data with the maximum square sum as the reference, adding 0 as an auxiliary feature, maintaining (3, 4) as (3,4,0), restraining other data with the same square sum, and adding corresponding auxiliary feature to enable the square sum of other data to be equal to the square sum of (3, 4), namely
Figure BDA0003444508150000061
(3,4,0),
Figure BDA0003444508150000062
Figure BDA0003444508150000063
Normalizing according to the square sum of the values after rooting to obtain
Figure BDA0003444508150000064
Figure BDA0003444508150000065
Fig. 2 may be a schematic structural diagram of the first preset quantum wire, for example. As shown in fig. 2, the first large block controlled by the real control is a data module to be classified, the second large block controlled by the virtual control is a training data module, and the data module to be classified and the training data module are overlapped according to two H gates on the control bit ctrl|0> and the control bit ctrl|0>, so as to construct a first preset sub-line.
Specifically, the slash before each line in FIG. 2 is used to indicate that the line may be more than one line (one qubit), the following U 0 、U i HIL is a modular representation, which may consist of a plurality of lines, a first transverse line for representing control bits, and a second transverse line for representing training data and data to be classified, wherein U 0 Process for amplitude encoding data to be classified, U i Representing the process of amplitude encoding training data. More specifically, the method comprises the steps of,
Figure BDA0003444508150000071
j >representing the quantum state of the training data so that the training data feature values are normalized to the unitary matrix U i And (3) upper part. Similarly, U 0 |0>=|ψ 0 >,|ψ 0 >Representing the quantum state of the data to be classified, U i And U 0 A form of quantum amplitude encoding may be used. In practice, a unitary operation U can be controlled i Operation U is controlled by performing state j (shown in FIG. 3-b) of the index bit j Obtain->
Figure BDA0003444508150000072
Is a superposition of training data sets of the state of superposition.
The b and alpha (alpha) states of the third line are output to U by HIL line i A fourth and a fifth auxiliary control bit for representing the HIL line, wherein the fourth qubit |0>The states correspond to Ancilla in FIG. 3-a, since the HHT line requires Ancilla to be |1>The state is judged to be successful, so Ancilla in FIG. 3-a is |0 in FIG. 2>Corresponding measurement operations are added on-line.
Further, one possible way of implementing the HHL line is shown in fig. 3-a, where Phase estimate is a Phase estimation module, phase is a Phase rotation module, uncompute is an inverse Phase estimation module, amplitude Amplification is an amplitude amplification module, and FT is a quantum fourier transform. Wherein the core matrix K is used for encoding to input, and as the initial state of the quantum bit, clock and Ancila are auxiliary control bits, corresponding to hhl-clock|0 of FIG. 2 respectively>And the fourth bit qubit |0>HHT circuit is used for classifying labels corresponding to training data according to kernel matrix K
Figure BDA0003444508150000073
Obtain->
Figure BDA0003444508150000074
And b, wherein->
Figure BDA0003444508150000075
And b is the line H shown in FIG. 2HL module outputs to U i The quantum state of the module, k, is obtained by a circuit as shown in fig. 3-c, specifically, fig. 3-c includes an H gate for preparing each two training data to q-1 and q-2 qubits respectively, a controlled SWAP gate for exchanging the quantum states of q-1 and q-2 and measuring the quantum state of q-0 by the measuring operation M, and a certain amount of training data is obtained, wherein the H gate is used for placing the prepared quantum states in the superposition state, the controlled SWAP gate is used for measuring the quantum state of q-0 by the measuring operation M, the circuit is measured to be |0>The probability of the state is->
Figure BDA0003444508150000081
Wherein |ψ i >To prepare a quantum state up to q-1, |ψ j >To prepare a quantum state onto q-2, ||<ψ ik > 2 Can represent |psi i >And |psi k >And the inner product of (c) indicates the difference between the two. If there are n data, a kernel matrix K of n rows and n columns is formed, wherein the diagonal of the kernel matrix K is the inner product of each data and itself, namely:
Figure BDA0003444508150000082
after the kernel matrix K is obtained, the HIL circuit is used for classifying labels corresponding to training data according to the kernel matrix K
Figure BDA0003444508150000083
Obtain->
Figure BDA0003444508150000084
And b, said k, said ∈ ->
Figure BDA0003444508150000085
Said->
Figure BDA0003444508150000086
The following relation is satisfied with b:
Figure BDA0003444508150000087
where K is the kernel matrix, gamma is the probability threshold set,
Figure BDA0003444508150000088
is the classification label +1, -1 corresponding to the training data.
Further, build U i I.e. a unitary operation for coding training data, fig. 3-b is an exemplary possible way of coding training data, where U j Unitary operation corresponding to specific training data, U i Is U (U) j D is the total amount of training data. Taking a training data set with 7 training data as an example, 1-7 binary is 001, 010, 011, 100, 101, 110, 111 respectively, the corresponding virtual control is used to make the target qubit effective when 0 state, the real control is used to make the target qubit effective when 1 state, the virtual control, the real control are respectively used to make only the first training data quantum state effective, the virtual control, the real control and the virtual control are respectively used to make only the second training data quantum state working, and so on until the real control, the real control and the real control are respectively used to make only the seventh training data quantum state working, so as to obtain a j=1-7 superposition training data set U 1 、……、U 7 。U 0 In order to perform the process of amplitude encoding on the data to be classified, the normalized data to be classified is amplitude encoded at the corresponding position of fig. 2.
The quantum state obtained by the data module to be classified is |phi 2 >The quantum state obtained by the training data module is |phi 1 >For example, N 1 For normalizing the data, N 2 For normalizing the data to be classified, alpha j Is that
Figure BDA0003444508150000091
D is the number of training data, |ψ j >Is the j training data, the obtained |phi 2 >And |phi 1 >The method comprises the following steps:
Figure BDA0003444508150000092
Figure BDA0003444508150000093
102. and running the first preset quantum circuit, measuring control bits of the first preset quantum circuit, and classifying the data to be classified according to the measurement results of the control bits.
Specifically, the constructed first preset quantum circuit is operated, and the control bit ctrl|0 is controlled>The measurement is carried out to obtain |1>The probability of (2) is
Figure BDA0003444508150000094
If the probability value is less than 1/2, the classification result is +1, otherwise, -1, +1, and-1 may represent tag values. In practical applications, the classification method of the embodiment may be used for image recognition classification, for example, cat is +1 class, dog is-1 class; predicting stock activity: high activity stocks are of +1 class, low activity stocks are of-1 class, etc.
In this embodiment, training data and data to be classified are obtained, the training data and the data to be classified are processed according to a preset mode, a first preset quantum circuit for data classification is constructed according to the processed training data and the data to be classified, the first preset quantum circuit is operated, control bits of the first preset quantum circuit are measured, and the data to be classified is classified according to measurement results of the control bits. By adopting the quantum computing technology, the data classification is realized through the quantum technology, the data processing speed is improved, the parallel acceleration advantage of quantum computing is exerted, and the blank of the related technology is supplemented.
The foregoing describes the present invention from a method perspective, and the following further describes the present invention from a device perspective, with particular reference to fig. 4, including:
an obtaining unit 401, configured to obtain training data and data to be classified, process the training data and the data to be classified according to a preset manner, and construct a first preset quantum circuit for data classification according to the processed training data and the data to be classified;
and the classification unit 402 is configured to operate the first preset quantum circuit, measure a control bit of the first preset quantum circuit, and classify the data to be classified according to a measurement result of the control bit.
It can be seen that, the obtaining unit 401 is configured to obtain training data and data to be classified, process the training data and the data to be classified according to a preset manner, construct a first preset quantum circuit for data classification according to the processed training data and the data to be classified, and the classifying unit 402 is configured to operate the first preset quantum circuit, measure a control bit of the first preset quantum circuit, classify the data to be classified according to a measurement result of the control bit, implement data classification by using a quantum technology, improve a data processing speed, so as to exert a parallel acceleration advantage of quantum computation, and supplement a blank of a related technology.
The following describes the operation of the computer terminal in detail by taking it as an example. Fig. 5 is a hardware block diagram of a computer terminal according to a method for classifying quantum data according to an embodiment of the present invention. As shown in fig. 5, the computer terminal may include one or more (only one is shown in fig. 5) processors 501 (the processor 501 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 502 for storing data, and optionally, a transmission device 503 for communication functions and an input-output device 504. It will be appreciated by those skilled in the art that the configuration shown in fig. 5 is merely illustrative and is not intended to limit the configuration of the computer terminal described above. For example, the computer terminal may also include more or fewer components than shown in FIG. 5, or have a different configuration than shown in FIG. 5.
The memory 502 may be used to store software programs and modules of application software, such as program instructions/modules corresponding to the method of classifying quantum data in the embodiments of the present application, and the processor 501 executes the software programs and modules stored in the memory 502, thereby performing various functional applications and data processing, that is, implementing the method described above. Memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 502 may further include memory located remotely from processor 501, which may be connected to the computer terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 503 is for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission means 503 comprises a network adapter (Network Interface Controller, NIC) that can be connected to other network devices via a base station to communicate with the internet. In one example, the transmission device 503 may be a Radio Frequency (RF) module, which is used to communicate with the internet wirelessly. The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program for electronic data exchange, and the computer program makes a computer execute part or all of the steps of any one of the above method embodiments, and the computer includes an electronic device.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any one of the methods described in the method embodiments above. The computer program product may be a software installation package, said computer comprising an electronic device.
The embodiment of the application also provides a quantum computer, which comprises a quantum computer operating system, wherein the quantum computer operating system realizes the classification processing of the quantum data according to part or all of the steps of any one of the methods described in the embodiment of the method.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, such as the above-described division of units, merely a division of logic functions, and there may be additional manners of dividing in actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, or may be in electrical or other forms.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units described above, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a memory, including several instructions for causing a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the above-mentioned method of the various embodiments of the present application. And the aforementioned memory includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the above embodiments may be implemented by a program that instructs associated hardware, and the program may be stored in a computer readable memory, which may include: flash disk, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
The foregoing has outlined rather broadly the more detailed description of embodiments of the present application, wherein specific examples are provided herein to illustrate the principles and embodiments of the present application, the above examples being provided solely to assist in the understanding of the methods of the present application and the core ideas thereof; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A method of classifying quantum data, comprising:
acquiring training data and data to be classified, processing the training data and the data to be classified according to a preset mode, and constructing a first preset quantum circuit for data classification according to the processed training data and the processed data to be classified;
and running the first preset quantum circuit, measuring control bits of the first preset quantum circuit, and classifying the data to be classified according to the measurement results of the control bits.
2. The method of claim 1, wherein processing training data and data to be classified in a predetermined manner comprises:
and adding auxiliary features to the training data and the data to be classified one by one, wherein the auxiliary features are used for enabling the square sum of the training data to be equal to the square sum of the data to be classified.
3. The method according to claim 2, wherein the method further comprises:
normalizing the training data and the data to be classified after the auxiliary features are added.
4. A method according to claim 3, wherein constructing a first preset quantum wire for data classification from the processed training data and the data to be classified comprises:
amplitude coding is carried out on the training data after processing and the data to be classified;
generating a data module to be classified according to the data to be classified after the amplitude encoding;
generating a training data module according to the HIL line and the training data after the amplitude coding;
and constructing the first preset quantum circuit according to the data module to be classified and the training data module.
5. The method of claim 1, wherein classifying the data to be classified according to the measurement result of the control bit comprises:
if the probability that the control bit is in the 1 state is more than one half, judging that the data to be classified is in the +1 type;
and if the probability that the control bit is in the 1 state is less than one half, judging that the data to be classified is of the type-1.
6. The method of claim 4, wherein prior to running the first predetermined quantum wire, the method further comprises:
acquiring a preset number of training data, and traversing the similarity of every two training data in the training data based on a second preset quantum circuit;
and generating a kernel matrix K according to the similarity of every two data in the training data, and encoding the kernel matrix K to the HIL line.
7. The method of claim 6, wherein after the generating the kernel matrix K, the method further comprises:
obtaining vector quantum states from a kernel matrix KAnd a constant b, said k, said +.>
Figure FDA0003444508140000022
The following relation is satisfied with the constant b:
Figure FDA0003444508140000023
where k is the kernel matrix, γ is the probability threshold set,
Figure FDA0003444508140000024
is a classification label corresponding to training data, and the classification label is +1 or-1.
8. A quantum data sorting apparatus, comprising:
the acquisition unit is used for acquiring training data and data to be classified, processing the training data and the data to be classified according to a preset mode, and constructing a first preset quantum circuit for data classification according to the processed training data and the processed data to be classified;
the classifying unit is used for operating the first preset quantum circuit, measuring the control bit of the first preset quantum circuit, and classifying the data to be classified according to the measurement result of the control bit.
9. An electronic device comprising a processor, a memory, a communication interface, and one or more programs stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-7.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program, which is executed by a processor to implement the method of any of claims 1-7.
CN202111649248.7A 2021-12-30 2021-12-30 Quantum data classification method and device, electronic equipment and storage medium Pending CN116432760A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111649248.7A CN116432760A (en) 2021-12-30 2021-12-30 Quantum data classification method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111649248.7A CN116432760A (en) 2021-12-30 2021-12-30 Quantum data classification method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116432760A true CN116432760A (en) 2023-07-14

Family

ID=87078393

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111649248.7A Pending CN116432760A (en) 2021-12-30 2021-12-30 Quantum data classification method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116432760A (en)

Similar Documents

Publication Publication Date Title
CN114821217B (en) Image recognition method and device based on quantum classical hybrid neural network
CN114792378B (en) Quantum image recognition method and device
US20240095563A1 (en) Quantum convolution operator
CN114358295B (en) Machine learning framework-based classification method and related device
CN115293254A (en) Quantum multilayer perceptron-based classification method and related equipment
CN114764619B (en) Convolution operation method and device based on quantum circuit
CN113222153A (en) Quantum state simulation method and device, storage medium and electronic device
CN113222151B (en) Quantum state transformation method and device
CN114819163B (en) Training method and device for quantum generation countermeasure network, medium and electronic device
CN115879562B (en) Quantum program initial mapping determination method and device and quantum computer
CN116432760A (en) Quantum data classification method and device, electronic equipment and storage medium
CN115409185A (en) Construction method and device of quantum line corresponding to linear function
CN114862079A (en) Risk value estimation method, device, medium, and electronic device based on quantum line
CN115983392A (en) Method, device, medium and electronic device for determining quantum program mapping relation
CN114819170A (en) Method, apparatus, medium, and electronic apparatus for estimating options based on quantum line
CN116415958B (en) Abnormal data detection method and device based on quantum technology and storage medium
CN115700730B (en) Image restoration method and device and quantum computer operating system
CN115879558B (en) Method and device for comparing sizes of multiple quantum states
CN116049506B (en) Quantum calculation-based numerical value searching method, device, equipment and storage medium
CN116167407B (en) Quantum circulation neural network-based data prediction method and related equipment
CN115730668B (en) Quantum circuit cutting method and device and quantum computer operating system
CN115908943B (en) Image classification method, device, electronic equipment and computer readable storage medium
CN115879560B (en) Equivalent relation judging method and device for quantum data and classical data
CN115907016B (en) Quantum-based method for calculating search target range value and related device
CN114372584B (en) Transfer learning method based on machine learning framework and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination