# US 2025/0232121 A1 · Quantum circuit determining method for a text, text classifying method and related devices

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0232121 A1
- Document ID: US20250232121A1
- Status: Published application
- Kind: A1
- Application number: 18/701,416
- Filed: 2022-10-13
- Published: 2025-07-17
- Earliest claimed: 2021-10-13
- Assignees: Origin Quantum Computing Technology (Hefei) Co., Ltd
- Applicants: Origin Quantum Computing Technology (Hefei) Co., Ltd.
- Inventors: MENGHAN DOU; Xiaofei Kong; Lei Li; Yuan Fang
- Web page: https://patentgrep.com/patent/US20250232121A1

## CPC

- G06F 16/33: Querying
- G06F 40/30: Semantic analysis
- G06N 10/20: Models of quantum computing, e.g. quantum circuits or universal quantum computers
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

The present disclosure provides a quantum circuit determining method for a text, a text classifying method and related devices. The quantum circuit determining method for a text comprises obtaining parts of speech of words in a text corpus; obtaining relevancies between words according to semanteme of the text corpus; and determining qubits and parameter-containing quantum logic gates of quantum circuits according to the parts of speech and the relevancies.

## Claims

### Claim 1

A quantum circuit determining method for a text, comprising:
obtaining at least parts of speech of words in a text corpus;
obtaining relevancies between the words according to semanteme of the text corpus; and
determining qubits and parameter-containing quantum logic gates of quantum circuits according to the parts of speech and the relevancies.

### Claim 2 (depends on 1)

The method of claim 1, wherein said obtaining relevancies between the words according to semanteme of the text corpus, comprises:
obtaining a first relevance characterizing a dominant feature of the text corpus according to the semanteme of the text corpus; and
obtaining a second relevance characterizing a recessive feature of the text corpus according to the semanteme of the text corpus.

### Claim 3 (depends on 2)

The method of claim 2, wherein said determining qubits and parameter-containing quantum logic gates of quantum circuits according to the parts of speech and the relevancies, comprises:
determining partial-qubits and the parameter-containing quantum logic gates that represent words with each part of speech;
processing the partial-qubits according to the first relevance to obtain entire qubits characterizing a structure of the text corpus, as the qubits of the quantum circuits; and
determining quantum logic gates characterizing the recessive feature of the text corpus according to the second relevance.

### Claim 4 (depends on 3)

The method of claim 3, wherein said determining partial-qubits and the parameter-containing quantum logic gates that represent words with each part of speech, comprises:
determining that a noun word is characterized as one qubit and an Rx(θ) gate, an Rz(θ) gate and an Rx(θ) gate acting sequentially on the qubit; or
determining that an adjective word is characterized as two qubits and one IQP layer acting on the two qubits; or
determining that a transitive verb word is characterized as three sequentially adjacent qubits and an IQP layer acting on two groups of two adjacent qubits,
wherein: the IQP layer comprises a Hadamard gate acting on each qubit separately, and a CRz(θ) gate acting on the two qubits simultaneously.

### Claim 5 (depends on 3)

The method of claim 3, wherein said processing the partial-qubits according to the first relevance to obtain entire qubits characterizing a structure of the text corpus, as the qubits of the quantum circuits, comprises:
partially combining the partial-qubits characterizing a word with the first relevance so as to obtain entire qubits characterizing a structure of the text corpus, as the qubits of the quantum circuits.

### Claim 6 (depends on 3)

The method of claim 3, wherein said determining quantum logic gates characterizing the recessive feature of the text corpus according to the second relevance, comprises:
determining the quantum logic gates characterizing the recessive feature as a H gate and a CNOT gate according to the second relevance.

### Claim 7 (depends on 1)

The method of claim 1, wherein before said determining qubits and parameter-containing quantum logic gates of quantum circuits according to the parts of speech and the relevancies, the method further comprises:
graphically representing the text corpus according to the parts of speech of the words in the text corpus and the relevancies between the words.

### Claim 8 (depends on 7)

The method of claim 7, wherein said representing the text corpus graphically according to the parts of speech of the words in the text corpus and the relevancies between the words, comprises:
determining a structural initial graph of the text corpus according to the parts of speech of the words in the text corpus and the relevancies between the words, wherein the words with different parts of speech in the structural initial graph are placed horizontally, and the relevancies between the words are represented by a U-shaped broken line; and
simplifying the structural initial graph to obtain a structural sketch, wherein the words with different parts of speech in the structural sketch are placed in a staggered manner, and the relevancies between the words are represented by a U-shaped broken line or a straight line.

### Claim 9 (depends on 1)

A text classifying method based on quantum circuits, wherein the method comprises:
constructing, according to the method of claim 1, quantum circuits for a text to be classified;
determining initialized parameter values of parameter-containing quantum logic gates in the quantum circuits according to meanings of the words in a text corpus;
running the quantum circuits and obtaining a running result thereof; and
obtaining a predictive classification result of the text corpus according to the running result.

### Claim 10 (depends on 9)

The text classifying method of claim 9, wherein before said determining initialized parameter values of parameter-containing quantum logic gates according to meanings of the words in a text corpus, the method further comprises:
training the quantum circuits to obtain parameter values corresponding to meanings of the words and for determining the initialized parameter values.

### Claim 11 (depends on 10)

The text classifying method of claim 10, wherein said training the quantum circuits to obtain parameter values corresponding to meanings of the words and for determining the initialized parameter values, comprises:
determining initialized parameter values of parameter-containing quantum logic gates to be trained according to the meanings of the words in the text corpus, running the parameter-containing quantum logic gates to be trained and obtaining a running result thereof;
obtaining the predictive classification result of the text corpus according to the running result;
correcting the initialized parameter values according to the predictive classification result to obtain updated parameter values, and then re-executing the running the quantum circuits and obtaining a running result thereof and the obtaining the predictive classification result of the text corpus according to the running result until the predictive classification result is close to a true result; and
obtaining the updated parameter value when the predictive classification result is close to the true result, for determining parameter values of the initialized parameter values.

### Claim 12 (depends on 11)

The text classifying method of claim 11, wherein said obtaining the predictive classification result of the text corpus according to the running result, comprises:
obtaining a cost function corresponding to a real label according to the running result, and obtaining the predictive classification result of the text corpus according to the cost function, wherein the cost function is defined as follows:
C
⁡
(
Θ
)
:=
∑
L
⁡
(
P
)
T
·
log
⁡
(
L
Θ
(
P
)
)
wherein, LΘ(P) characterizes the running result, L (P) characterizes the real label, and C (Θ) characterizes the cost function.

### Claim 13 (depends on 11)

The text classifying method of claim 11, wherein said correcting the initialized parameter values according to the predictive classification result to obtain updated parameter values, comprises:
correcting the initialized parameter values according to the predictive classification result based on synchronous perturbation stochastic approximation algorithm to obtain the updated parameter value.

### Claim at position 14

14-19. (canceled)

### Claim 20

A quantum circuit determining device for a text, characterized by comprising:
a first obtaining device configured for obtaining parts of speech of the words in a text corpus;
a second obtaining device configured for obtaining relevancies between the words according to semanteme of the text corpus; and
a determining device configured for determining qubits and parameter-containing quantum logic gates of quantum circuits according to the parts of speech and the relevancies.

### Claim 21 (depends on 1)

A text classifying device, characterized by comprising:
a quantum circuit determining device configured for constructing quantum circuits for a text to be classified according to the method of claim 1; and
a predicting unit configured for: determining initialized parameter values of parameter-containing quantum logic gates in the quantum circuits according to meanings of the words in a text corpus, running the quantum circuits and obtaining a running result thereof, and obtaining a predictive classification result of the text corpus according to the running result.

### Claim 22

A text classifying device, comprising:
a processing unit configured for converting a text corpus into a target quantum circuit according to parts of speech, meanings and relevancies of the words in the text corpus;
wherein the relevancies comprise relevancies between each word and other words in the text corpus;
the processing unit is further configured for obtaining a running result of the target quantum circuit, wherein the running result comprises an output result of a qubit when the target quantum circuit is run each time; and
a predicting unit configured for obtaining a predictive classification result of the text corpus according to the running result.

### Claim 23 (depends on 22)

The text classifying device of claim 22, wherein the processing unit is further configured for:
determining a sentence syntax type corresponding to the text corpus according to the parts of speech and the relevancies of the words in the text corpus;
determining a target quantum framework according to the sentence syntax type, wherein the target quantum framework is a quantum framework corresponding to the sentence syntax type;
determining an initial parameter of a logic gate in the target quantum framework according to meanings of the words in the text corpus; and
setting a parameter of the logic gate in the target quantum framework according to the initial parameter, to complete a conversion of the target quantum circuit.

### Claim 24 (depends on 1)

A computer-readable storage medium having a computer program stored therein, wherein the computer program is configured for implementing, when executed by a processor, the method of claim 1.

### Claim 25 (depends on 1)

An electronic device, characterized by comprising a processor and a memory, the memory is configured for storing one or more programs which implement, when executed by the processor, the method of claim 1.
