Книжная полка Сохранить
Размер шрифта:
А
А
А
|  Шрифт:
Arial
Times
|  Интервал:
Стандартный
Средний
Большой
|  Цвет сайта:
Ц
Ц
Ц
Ц
Ц

Программные продукты и системы, 2024, том 37, № 1

международный научно-практический журнал
Бесплатно
Новинка
Основная коллекция
Артикул: 829100.0001.99
Программные продукты и системы : международный научно-практический журнал. - Тверь : НИИ Центрпрограммсистем, 2024. - Т. 37, № 1. - 134 с. - ISSN 0236-235X. - Текст : электронный. - URL: https://znanium.ru/catalog/product/2144532 (дата обращения: 30.04.2024)
Фрагмент текстового слоя документа размещен для индексирующих роботов. Для полноценной работы с документом, пожалуйста, перейдите в ридер.
Научно-исследовательский институт

«Центрпрограммсистем»

Программные

продукты и системы

НАУЧНЫЙ ЖУРНАЛ

2024, том 37, № 1

(год издания тридцать седьмой)

Главный редактор

Г.И. САВИН, академик РАН

SOFTWARE & SYSTEMS

Research Journal

2024, vol. 37, no. 1

Editor-in-Chief 

G.I. SAVIN, Academician of the Russian Academy of Sciences

Research Institute CENTERPROGRAMSYSTEM
 ПРОГРАММНЫЕ ПРОДУКТЫ И СИСТЕМЫ
Научный журнал 

2024. Т. 37. № 1
DOI: 10.15827/0236-235X.142

Главный редактор 

Г.И. САВИН, академик РАН

Научные редакторы номера:

Н.А. СЕМЕНОВ, д.т.н., профессор

А.Н. СОТНИКОВ, д.ф.-м.н., профессор

Издатель НИИ «Центрпрограммсистем»

(г. Тверь, Россия)

Учредитель В.П. Куприянов

Журнал зарегистрирован в Роскомнадзоре

3 марта 2020 г.

Регистрационное свидетельство ПИ № ФС 77-77843

Подписной индекс в каталоге

Урал-Пресс 70799

ISSN 0236-235X (печатн.)
ISSN 2311-2735 (онлайн)

РЕДАКЦИОННАЯ КОЛЛЕГИЯ

Семенов Н.А. – заместитель главного редактора, д.т.н., профессор Тверского государственного технического 
университета (г. Тверь, Россия)
Сотников А.Н. – заместитель главного редактора, д.ф.-м.н., профессор, заместитель директора 
Межведомственного суперкомпьютерного центра РАН (г. Москва, Россия)
Афанасьев А.П. – д.ф.-м.н., профессор Московского физико-технического института (технического университета), 
заведующий Центром распределенных вычислений Института проблем передачи информации РАН (г. Москва, Россия)
Баламетов А.Б. – д.т.н., профессор Азербайджанского научно-исследовательского и проектно-изыскательского института 
энергетики (г. Баку, Азербайджан)
Борисов В.В. – д.т.н., профессор филиала Национального исследовательского университета «МЭИ» 
в г. Смоленске (г. Смоленск, Россия)
Голенков В.В. – д.т.н., профессор Белорусского государственного университета информатики и радиоэлектроники 
(г. Минск, Беларусь)
Елизаров А.М. – д.ф.-м.н., профессор Института математики и механики им. Н.И. Лобачевского Казанского федерального 
университета (г. Казань, Россия)
Еремеев А.П. – д.т.н., профессор Национального исследовательского университета «МЭИ» (г. Москва, Россия)
Кузнецов О.П. – д.т.н., профессор Института проблем управления РАН (г. Москва, Россия)
Мамросенко К.А. – к.т.н., доцент Московского авиационного института (национального исследовательского университета), 
руководитель Центра визуализации и спутниковых информационных технологий НИИСИ РАН (г. Москва, Россия)
Палюх Б.В. – д.т.н., профессор Тверского государственного технического университета (г. Тверь, Россия)
Сулейманов Д.Ш. – академик АН Республики Татарстан, д.т.н., профессор Казанского государственного технического 
университета (г. Казань, Республика Татарстан, Россия)
Татарникова Т.М. – д.т.н., доцент, профессор Санкт-Петербургского государственного 
электротехнического университета «ЛЭТИ» им. В.И. Ульянова (Ленина) (г. Санкт-Петербург, Россия)
Ульянов С.В. – д.ф.-м.н., профессор, ведущий научный сотрудник Объединенного института ядерных исследований 
(г. Дубна, Россия)
Хорошевский В.Ф. – д.т.н., профессор Московского физико-технического института (технического университета) 
(г. Москва, Россия)
Шабанов Б.М. – д.т.н., чл.-корр. РАН, директор Межведомственного суперкомпьютерного центра РАН (г. Москва, Россия)
Язенин А.В. – д.ф.-м.н., профессор Тверского государственного университета (г. Тверь, Россия)

АССОЦИИРОВАННЫЕ ЧЛЕНЫ РЕДАКЦИИ

Национальный исследовательский университет «МЭИ», г. Москва, Россия
Технологический институт Южного федерального университета, г. Таганрог, Россия
Тверской государственный технический университет, г. Тверь, Россия

АДРЕС ИЗДАТЕЛЯ И РЕДАКЦИИ 
Россия, 170024, 
г. Тверь, просп. Николая Корыткова, д. 3а
Телефон (482-2) 39-91-49
Факс (482-2) 39-91-00
E-mail: red@cps.tver.ru
Сайт: www.swsys.ru

Дата выхода в свет 16.03.2024 г.
Отпечатано ИПП «Фактор и К»

Россия, 170100, г. Тверь, ул. Крылова, д. 26

Выпускается один раз в квартал

Год издания тридцать седьмой

Формат 6084 1/8. Объем 132 стр.

Заказ № 4. Тираж 1000 экз. Цена 550,00 руб.
 SOFTWARE & SYSTEMS 
Research journal
2024, vol. 37, no. 1
DOI: 10.15827/0236-235X.142

Editor-in-chief 
G.I. SAVIN, Academician of RAS

Science editors of the issue:

N.A. Semenov, Dr.Sc. (Engineering), Professor
A.N. Sotnikov, Dr.Sc. (Physics and Mathematics), Professor

Publisher Research Institute 

CENTERPROGRAMSYSTEM (Tver, Russian Federation)

Founder V.P. Kupriyanov

The journal is registered with the Federal Service 

for Supervision of Communications, Information Technology 

and Mass Communications (Roskomnadzor) 

March 3rd, 2020

Registration certificate ПИ № ФС 77-77843

ISSN 0236-235X (print)
ISSN 2311-2735 (online)

EDITORIAL BOARD

Semenov N.A. – Deputy Editor-in-Chief, Dr.Sc. (Engineering), Professor of the Tver State Technical University
(Tver, Russian Federation)
Sotnikov A.N. – Deputy Editor-in-Chief, Dr.Sc. (Physics and Mathematics), Professor, Deputy Director
of the Joint Supercomputer Center of the Russian Academy of Sciences (Moscow, Russian Federation)
Afanasiev A.P. – Dr.Sc. (Physics and Mathematics), Professor of the Moscow Institute of Physics and Technology, 
Head of Centre for Distributed Computing of Institute for Information Transmission Problems 
(Moscow, Russian Federation)
Balametov A.B. – Dr.Sc. (Engineering), Professor of the Azerbaijan Scientific-Research & Design-Prospecting Power Engineering 
Institute (Baku, Azerbaijan)
Borisov V.V. – Dr.Sc. (Engineering), Professor of the MPEI Branch in Smolensk (Smolensk, Russian Federation)
Golenkov V.V. – Dr.Sc. (Engineering), Professor of the Belarusian State University of Informatics and Radioelectronics 
(Minsk, Republic of Belarus)
Elizarov A.M. – Dr.Sc. (Physics and Mathematics), Professor of the N.I. Lobachevsky Institute of Mathematics 
and Mechanics of the Kazan Federal University (Kazan, Russian Federation)
Eremeev A.P. – Dr.Sc. (Engineering), Professor of the National Research University Moscow Power Engineering 
Institute (Moscow, Russian Federation)
Kuznetsov O.P. – Dr.Sc. (Engineering), Professor of the Institute of Control Sciences of the Russian Academy 
of Sciences (Moscow, Russian Federation)
Mamrosenko K.A. – Ph.D. (Engineering), Associate Professor of the Moscow Aviation Institute (National Research
University), Head of the Center of Visualization and Satellite Information Technologies SRISA RAS 
(Moscow, Russian Federation)
Palyukh B.V. – Dr.Sc. (Engineering), Professor of the Tver State Technical University (Tver, Russian Federation)
Suleimanov D.Sh. – Academician of TAS, Dr.Sc. (Engineering), Professor of the Kazan State Technical University
(Kazan, Republic of Tatarstan, Russian Federation)
Tatarnikova T.M. – Dr.Sc. (Engineering), Associate Professor, Professor of the St. Petersburg Electrotechnical 
University LETI (St. Petersburg, Russian Federation)
Ulyanov S.V. – Dr.Sc. (Physics and Mathematics), Professor of the Dubna International University for Nature, 
Society and Man (Dubna, Russian Federation)
Khoroshevsky V.F. – Dr.Sc. (Engineering), Professor of the Moscow Institute of Physics and Technology
(Moscow, Russian Federation)
Shabanov B.M. – Dr.Sc. (Engineering), Corresponding Member of the RAS, Director of the Joint Supercomputer Center 
of the Russian Academy of Sciences (Moscow, Russian Federation)
Yazenin A.V. – Dr.Sc. (Physics and Mathematics), Professor of the Tver State University (Tver, Russian Federation)

ASSOCIATED EDITORIAL BOARD MEMBERS

National Research University Moscow Power Engineering Institute, Moscow, Russian Federation
Technology Institute at Southern Federal University, Taganrog, Russian Federation
Tver State Technical University, Tver, Russian Federation

EDITORIAL BOARD AND PUBLISHER OFFICE ADDRESS 
Nikolay Korytkov Ave, 3а, Tver, 170024, Russian Federation
Phone: (482-2) 39-91-49  Fax: (482-2) 39-91-00
E-mail: red@cps.tver.ru
Website: www.swsys.ru

Release date 16.03.2024

Printed in printing-office Faktor i K

Krylova St. 26, Tver, 170100, Russian Federation

Published quarterly. 37th year of publication

Format 6084 1/8. Circulation 1000 copies

Prod. order № 4. Wordage 132 pages. Price 550,00 rub. 
Вниманию авторов

Журнал «Программные продукты и системы» публикует материалы научного и научно-практического 

характера по новым информационным технологиям, результаты академических и отраслевых исследований 
в области использования средств вычислительной техники. Практикуются выпуски тематических номеров 
по искусственному интеллекту, системам автоматизированного проектирования, по технологиям разработки 
программных средств и системам защиты, а также специализированные выпуски, посвященные научным 
исследованиям и разработкам отдельных вузов, НИИ, научных организаций. 

Журнал «Программные продукты и системы» внесен в Перечень ведущих рецензируемых научных жур-

налов и изданий, в которых должны быть опубликованы основные научные результаты диссертаций на соискание 
ученых степеней кандидата и доктора наук.

Информация об опубликованных статьях по установленной форме регулярно предоставляется в систему 

РИНЦ, в CrossRef и в другие базы и электронные библиотеки.

Журнал «Программные продукты и системы» включен в ядро коллекции РИНЦ, размещенное на плат-

форме Web of Science в виде базы данных RSCI.

Автор статьи отвечает за подбор, оригинальность и точность приводимого фактического материала. 

При перепечатке ссылка на журнал обязательна. Статьи публикуются бесплатно.

Условия публикации

К рассмотрению принимаются оригинальные материалы, отвечающие редакционным требованиям и со-

ответствующие тематике журнала. Группы научных специальностей: 

1.2. Компьютерные науки и информатика 
1.2.1. Искусственный интеллект и машинное обучение (физико-математические науки). 
1.2.2. Математическое моделирование, численные методы и комплексы программ (физико-математиче-

ские науки, технические науки)

2.3. Информационные технологии и телекоммуникации
2.3.1. Системный анализ, управление и обработка информации, статистика (технические науки, физико-

математические науки). 

2.3.2. Вычислительные системы и их элементы (технические науки).
2.3.3. Автоматизация и управление технологическими процессами и производствами (технические 

науки). 

2.3.5. Математическое и программное обеспечение вычислительных систем, комплексов и компьютер-

ных сетей (технические науки, физико-математические науки).

2.3.6. Методы и системы защиты информации (технические науки, физико-математические науки).
2.3.7. Компьютерное моделирование и автоматизация (технические науки, физико-математические науки).
2.3.8. Информатика и информационные процессы (технические науки).
Работа представляется в электронном виде в формате Word. Объем статьи вместе с иллюстрациями – не 

менее 10 000 знаков. Диаграммы, схемы, графики должны быть доступными для редактирования (Word, 
Visio, Excel). Заголовок должен быть информативным; сокращения, а также терминологию узкой тематики 
желательно в нем не использовать. Количество авторов на одну статью – не более 4, количество статей одного 
автора в номере, включая соавторство, – не более 2. Список литературы, наличие которого обязательно, 
должен включать не менее 10 пунктов.

Необходимы также содержательная структурированная аннотация (не менее 200 слов), ключевые слова 

(7–10) и индекс УДК. Название статьи, аннотация и ключевые слова должны быть переведены на английский 
язык (машинный перевод недопустим), а фамилии авторов, названия и юридические адреса организаций 
(если нет официального перевода) – транслитерированы по стандарту BGN/PCGN. 

Вместе со статьей следует прислать экспертное заключение о возможности открытого опубликования 

материала и авторскую справку. Обзательно соблюдение автором договора (публичной оферты).

Порядок рецензирования

Все статьи, поступающие в редакцию (соответствующие тематике и оформленные согласно требованиям 

к публикации), подлежат двойному слепому рецензированию в течение месяца с момента поступления, рецензия 
отправляется авторам. 

В редакции сформирован устоявшийся коллектив рецензентов, среди которых члены редколлегии жур-

нала, эксперты из числа крупных специалистов в области информатики и вычислительной техники ведущих 
вузов страны, а также ученые и специалисты НИИСИ РАН, МСЦ РАН (г. Москва) и НИИ «Центрпрограмм-
систем» (г. Тверь).

Редакция журнала «Программные продукты и системы» в своей работе руководствуется сводом правил 

Кодекса этики научных публикаций, разработанным и утвержденным Комитетом по этике научных публикаций (
Committee on Publication Ethics – COPE).
Программные продукты и системы / Software & Systems
37(1), 2024

5

Software & Systems
doi: 10.15827/0236-235X.142.005-017
2024, 37(1), pp. 5–17

Software emulator of quantum algorithms for sophisticated simulation 

on a conventional computer

Sergey V. Ulyanov 1, 2, Viktor S. Ulyanov 3

1 Dubna State University – Institute of System Analysis 
and Management, Dubna, 141980, Russian Federation

2 Joint Institute for Nuclear Research –

Meshcheryakov Laboratory of Information Technologies, 

Dubna, 141980, Russian Federation

3 Moscow State University of Geodesy and Cartography (MIIGAiK), 

Moscow, 105064, Russian Federation

For citation
Ulyanov, S.V., Ulyanov, V.S. (2024) ‘Software emulator of quantum algorithms for sophisticated simulation on a conven-
tional computer’, Software & Systems, 37(1), pp. 5–17 (in Russ.). doi: 10.15827/0236-235X.142.005-017
Article info
Received: 14.09.2023
After revision: 21.09.2023
Accepted: 05.10.2023

Abstract. A quantum software engineering platform includes quantum computing methods, a quantum algorithm theory 
and quantum programming. These areas develop according to a technological structure of nanotechnology development 
for hardware design of various configurations. In about 10 to 30 years we expect the appearing of an industrial quantum 
computer for real software engineering; this fact is due to overcoming a number of technological difficulties in implement-
ing hardware, as well as the fundamental difficulty of eliminating decoherence physical phenomenon and correcting errors 
in quantum computers in near future. A key question in quantum computing is searching for quantum algorithms that 
potentially have a significant advantage and supremacy over classical algorithms for problems of practical interest. There-
fore, currently, an approach is being developed to create quantum algorithm structures for quantum simulators with the 
possibility of effective implementation on classical architecture computers. This paper proposes an effective modelling 
method with information analysis of quantum search and decision-making algorithm structures in order to eliminate redun-
dancy in practical implementation of a simulator on a classical structure computer. As an example, we demonstrate the 
method of modeling Grover's quantum search algorithm with stopping the search for a good solution based on the Shannon 
information entropy minimum principle. There are modeling examples to demonstrate the effectiveness of the developed 
approach in quantum software engineering and intelligent control robotics.
Keywords: quantum algorithm, quantum software engineering, quantum computing, quantum simulator, minimum of Shan-
non information entropy, termination criteria

Introduction. The history of quantum compu-

ting starts around the 1980s when during the First 
Conference on the Physics of Computation Rich-
ard Feynman showed that it is not effective to sim-
ulate a quantum system evolution on a classical 
computer. An effective simulation of quantum sys-
tem has a run-time in polynomial size, i.e. the com-
putational time is smaller than a polynomial func-
tion of the problem size. Therefore, relevant simu-
lations of quantum computers will always be larger 
in size than polynomial time. This leads to super-
polynomial time simulations of quantum algo-
rithms; these kinds of simulations have a long 
runtime for large problems. By separating the 
problems in smaller parts, we can avoid long run-
time. For example, simulating Shor’s factoring al-
gorithm on a classical computer takes super-poly-
nomial time. The simulation of quantum algo-
rithms is still constructive for parts of a larger 
problem and it gives us a basis for comparing ex-
perimental and theoretical results. The results from 
Shor’s algorithm might be verified by multiple fac-
tors from an algorithm outcome and hence it is 

simple to check the results from Shor’s factoring 
algorithm implemented on a quantum computer. 
It might be more complicated to check the outputs 
from future algorithms.

However, it is possible to show that Shor’s al-

gorithm gives mathematically correct results. But
how can we verify that implementing Shor’s algo-
rithm on a quantum computer coincides with its 
mathematical model? A simulation of a quantum 
algorithm on a classical computer allows compar-
ing a quantum computer outcome with an output 
form a physically more stable classical computer. 
When developing quantum algorithms, it is inter-
esting to check new algorithms on a classical com-
puter. This study examines quantum algorithm 
simulation on a classical computer. The program 
code implemented on a classical computer will be 
a straight connection between the mathematical 
formulation of quantum mechanics and computa-
tional methods. A computational language in-
cludes such terms as a quantum state, a superposi-
tion and other quantum operators.
Программные продукты и системы / Software & Systems
37(1), 2024

6

Quantum algorithm general structure

The problem solved by a quantum algorithm 

(QA) can be stated in the symbolic form: 

Input
Function f: {0, 1}n → {0, 1}m.

Problem Find a certain property of function f.
A given function f is a map of one logical state 

into another, QA estimates qualitative properties 
of function f. Fig. 1 demonstrates a general circuit 
description of QA.

Three main quantum operators (as the superpo-

sition, the entanglement (quantum oracle) and the 
interference) are a background of QA structure de-
sign for implementing quantum massive parallel 
computing. Therefore, they include the matrix de-
sign form of three quantum operators: superposi-
tion (Sup), entanglement (UF) and interference (Int)
(see, below Fig. 2). 

The structure of a quantum algorithmic gate 

(QAG) in Fig. 1 in a general form can be defined 
as follows:

(
)

1
,

h
n
n
m

F
QAG
Int
I
U
H
S

+




=







(1)

where I is an identity operator; symbol  denotes 
a tensor product; S is equal to I or H and depends 
on a problem description. The type of operator UF
physically describes the qualitative properties of 
function f. 

Figure 2 shows QA steps including described 

qualitative peculiarities of function f and physical 
interpretation of applied quantum operators.

The quantum circuit (Fig. 2) is a high-level de-

scription of a method for composing smaller ma-
trices using tensor and dot products in order to gen-
erate a finite QAG.

For example, Fig. 3 represents a general ap-

proach to Grover’ QAG design [1].

The presented HW performs all functional 

steps of a Grover’s QSA. A termination condition
criterion is a minimum entropy-based method that 
is implemented in a digital part together with dis-
play output [2]. 

There are fast algorithms to simulate most of 

known QAs on classical computers [1] and in com-
putational intelligence toolkit: 1) Matrix-based 
approach; 2) Model representations of quantum 
operators in fast QAs; 3) Algorithmic-based ap-
proach when matrix elements are calculated on de-
mand; 4) Problem-oriented approach, where we 
succeeded to run Grover’s algorithm with up to 64 
and more qubits with Shannon entropy calculation
(up to 1024 without a termination condition); 
5) Quantum algorithms with a reduced number of 
operators (entanglement-free QA, and so on). 

In this article we briefly describe main blocks 

in Fig. 3: a) unified operators; b) problem-oriented 
operators; c) benchmarks of QA simulation on 
classical computers; d) quantum control algo-
rithms based on quantum fuzzy inference (QFI) 

Fig. 1. QA general description

Input

n

m

0

0

H

H

...

x

x

S

S

...

UF

INT

Superposition
Entanglement
Interference
Output

h

h

h

h

bit

bit

bit

bit

...
...

M
E
A
S
U
R
E
M
E
N
T

...
...

Repeated k times

Fig. 2. QA general structure

Qualitative 
properties of 

function

Quantum Massive Parallel Computing

fin

=

QC output
Classical input

Quantum Fourier  

transformation

Problem oriented operator 

Hadamard  

transformation

Coding of 
function 
properties

Qualitative 
properties of 

function

Quantum Oracle Black BOX

initial

[ (Interference) (Quantum Oracle) ] (Superposition)

Answer
QAG design

Quantum knowledge 

base optimizer

Problem

Soft Computing 

optimizer
Программные продукты и системы / Software & Systems
37(1), 2024

7

and quantum genetic algorithm (QGA) as new 
QSA types.

Description of quantum operators: 

SW smart toolkit support

In terms of simulation, we consider the struc-

ture of quantum operators as a superposition, en-
tanglement and interference. In this case a super-
position and an interference have a more compli-
cated structure and differ from an algorithm to an 
algorithm [3–5]. We also focus on considering en-
tanglement operators, since they have a similar 
structure for all QAs and differ only by an ana-
lyzed function [6–8].

QA superposition operators. In general form, a 

superposition operator is a combination of tensor 
products of Hadamard H operators with identity 
operator I: 

1
1
1
0
1
,
.
1
1
0
1
2

H
I




=
=




−





The superposition operator of most QAs (see 

Fig. 1) can be expressed as: 

1
1

n
m

i
i
Sp
H
S

=
=





= 
 









,

where n and m are the numbers of inputs and out-
puts respectively. Operator S may be Hadamard H
operator or identity operator I depending on the al-
gorithm. Table 1 presents the number of outputs m, 
as well as the structures of corresponding superpo-
sition and interference operators for different QAs.

Table 1

Parameters of superposition and interference 

operators of main quantum algorithms

Algorithm
Superposition
m
Interference

Deutsch’s
H
I

1
H
H


Deutsch-Jozsa’s
nH
H

1
nH
I


Grover’s
nH
H

1
n
D
I


Simon’s
n
n
H
I

n
n
n
H
I


Shor’s
n
n
H
I

n

n

n
QFT
I


Elements of the Walsh-Hadamard operator 

could be obtained as following:

(
)

*

/2
/2
,

1
  1,    if 
 is even,
1

1,   if 
 is odd,
2
2

i j

n

n
n
i j

i
j
H
i
j

−




=
=



−



(2)

where 
0,1, ..., 2 ,
0,1, ..., 2 .
n
n
i
j
=
=
Its elements

could be obtained by the simple replication accord-
ing to the rule presented in Eq. (2). Thus, this ap-
proach greatly improves the performance of clas-
sical simulation of the Walsh–Hadamard opera-
tors.

Interference operators of main QAs. Interfer-

ence operators must be selected individually for 
each algorithm according to the parameters pre-
sented in Table 1; for Grover’s algorithm they can 
be written as a block matrix:

/2
,

/2
/2

1

2

1
1
1
,
2
2

Grover
n

n
n
i j

n
n

i
j
i
j

Int
D
I
I
I

I
I

=






=

=
−

=











= − +


=









Fig. 3. Circuit and quantum gate representation of Grover’s QSA
Программные продукты и системы / Software & Systems
37(1), 2024

8

/2

,
,
1

,
,
2 n

I i
j

I i
j

−
=

=




(3)

where 
0, ..., 2
1,
0, ..., 2
1
n
n
i
j
=
−
=
− , Dn refers to

a diffusion operator: 


1
(
)

/2
,

( 1)

2

AND i
j

n
n
i j
D

=
−
=
[9–12]. 

Note that with the increasing number of qubits, the 
gain coefficient becomes smaller. 

The matrix dimension increases according to 2n,

but each element can be extracted using Eq. (3) 
without allocating the entire operator matrix. In a 
certain form, the operator Dn (diffusion – inversion 
about average) in Grover’s algorithm is decom-
posed as follows: 

1
0
0
0

1
1
0
1
0
0
1
1
1

1
1
0
0
0
1
1
2

0
0
0
1

n

n
n

n
n
D






−











=








−
−










and can be implemented with 
( )
(log( ))
O n
O
N
=

quantum gates. In terms of efficient computation, 
it means that the form in Eq. (3) is more preferable.

Entanglement operators of main QAs. Entan-

glement operators in a general form are a part 
of QA; the information about the function (being 
analyzed) is coded as an input-output relation. In the 
general approach to coding binary functions into 
corresponding entanglement gates, an arbitrary bi-
nary function is considered as: 




: 0,1
0,1
,

n
m
f
→

such that 
0
1
0
1
(
, ...,
)
(
, ...,
)
n
m
f x
x
y
y
−
−
=
. First, irre-

versible function f transforms into reversible func-
tion F as following: 




: 0,1
0,1
,

m n
m n
F

+
+
→
and 

(
)
0
1
0
1

0
1
0
1
0
1

, ...,
,
, ...,

(
, ...,
,
(
, ...,
)
(
, ...,
)),

n
m

n
n
m

F x
x
y
y

x
x
f x
x
y
y

−
−

−
−
−

=

=


where  denotes addition by module 2. This trans-
formation creates a unitary quantum operator and 
performs a similar transformation. It is possible de-
sign an entanglement operator matrix using re-
versible function F according to the following rule:



,
1 iff (
)
,

,
 0,..,0;1,..,1; .

B
B

B
B

F
i
j

n
m
n
m

U
F j
i

i j

+
+

=
=

 







B denotes binary coding.
A diagonal
block matrix
of the form: 

0

2
1

0

0
n

F

M

U

M
−






= 







is actually a resulted entan-

glement operator. 

Each block
,
0, ..., 2
1
n

i
M
i =
−
can be ob-

tained as follows:

1

0

,  iff ( , )
0,

, iff ( , )
1,

m

i
k

I
F i k
M
C
F i k

−

=

=

=  
=


(4)

and consists of m tensor products of I or C opera-
tors, where C stays for NOT operator.

Note that an entanglement operator is a sparse 

matrix and according to this property (4) it is possi-
ble to accelerate entanglement operation simulation.

Structure of QA simulation system 

in MatLab

Figure 4 shows a software system structure for 

QA simulation. 

The software system is divided into two general 

sections. The first section involves common func-
tions. The second section involves algorithm-spe-
cific functions for implementing particular algo-
rithms.

Common functions. The common functions in-

clude:

•
superposition building blocks,

•
interference building blocks,

•
bra-ket functions,

•
measurement operators,

•
entropy calculation operators,

•
visualization functions,

•
state visualization functions,

•
operator visualization functions.

Algorithm specific functions. Algorithmic spe-

cific functions include:

•
entanglement encoders,

•
problem transformers,

•
result interpreters,

•
algorithm execution scripts,

•
Deutsch algorithm execution script,

•
Deutsch Jozsa algorithm execution script,

•
Grover’s algorithm execution script,

•
Shor’s algorithm execution script,

•
quantum control algorithms as scripts.

Visualization functions. Visualization func-

tions are functions that provide visualization dis-
play of quantum state vector amplitudes and quan-
tum operator structure. 

Algorithmically-specific functions. Algorithmi-

cally-specific functions provide a set of scripts for 
QA execution in a command line and tools for QA
simulation including quantum control algorithms. 
The functions of section 2 prepare the appropriate
operators of each algorithm and use common func-
tions as operands. 

QA simulation by a command line. The exam-

ple of the Grover’s algorithm script is presented at 
the link http://swsys.ru/uploaded/image/2024-1/Ul-
yanov.html.
Программные продукты и системы / Software & Systems
37(1), 2024

9

Other known QA can be formulated and exe-

cuted by similar scripts, and using the correspond-
ing equations presented earlier [9–11].

Simulating QA as a dynamic system. In order to 

simulate dynamic system behavior with quantum 
effects, it is possible to represent QA as a dynamic 
system in the form of a block diagram and then 
simulate its behavior in time. Figure 5 shows an 
example of a quantum circuit Simulink diagram to 
calculate the fidelity <a|a> of the quantum state 
and to calculate the density matrix |a><a| of the 
quantum state. Bra and ket functions are from the 
common library. This example demonstrates using 
common functions to simulate QA dynamics. 

In Fig. 6, the input is ket function. The ket func-

tion output is provided to the first input of the ma-
trix multiplier and as the second input of the matrix 
multiplier. The input is also provided to the bra
function. The bra function output is provided to 
the second input of the matrix multiplier and as the 
first input of the matrix multiplier. The multiplier 
output is an input state density matrix. The multi-
plier output is the input state fidelity.

Figure 7 shows Simulink structure of an arbi-

trary QA. 

We can use such structure to simulate a number

of quantum algorithms in Matlab/Simulink envi-
ronment.

Dedicated QA emulator

Developments in QA algorithmic representa-

tion are also applicable for designing QA soft-
ware emulators. A key point is reducing multiple 
matrix operations to vector operations and the fol-
lowing replacement of multiplication operations. 
This may increase emulation performance, espe-
cially for algorithms that do not require complex 
number operations, and when a quantum state 
vector has a relatively simple structure (like 
Grover’s QSA).

The developed software can simulate 4 basic

quantum algorithms, e.g. Deutsch-Jozsa, Shor’s, 
Simon’s and Grover’s. The system uses a unified 
user-friendly interface for all algorithms providing 
3D visualization of state vector dynamics and 
quantum operators.

On the QA emulator launch window, you can 

choose to create a new QA model or continue 
modeling the existing one (http://www.swsys.ru/
uploaded/image/2024-1/13.jpg).

If we choose creating a new model, then algo-

rithm selection dialog starts. Here we can choose 
QA and its dimensions. 

In fact, the system may operate with up to 50 

qubits and more, but, it is better to limit the number 
of qubits to 10–11 due to visualization problems.

Fig. 4. Structure of QA simulation software
Программные продукты и системы / Software & Systems
37(1), 2024

10

Once algorithm initial parameters are set, the 

system draws an initial state vector and selects an 
algorithm structure in the system’s main window 
(Fig. 7).

The main window (Fig. 7) contains all infor-

mation of the emulated quantum algorithm and en-
ables basic operations and analysis. The form 
menu has an access to involved quantum operators 
(Fig. 8), and it is possible to modify input func-
tions. 

QAs have reversible nature; therefore, it is pos-

sible to make forward and backward algorithm 
steps by clicking on arrows; currently applied al-
gorithm step will be highlighted on the algorithm 
diagram.

The emulator menu consists of four compo-

nents: 

1. Item File provides basic operations, such as 

project save/load, and new model creation inter-
face access.

2. Item Model provides an access to the input 

function editor.

3. Item View provides an access to operator 

matrix visualizers, including Superposition, En-

tanglement and Interference operators. It is also 
possible to get 3D preview of algorithm state dy-
namics (Fig. 9).

4. From Help menu there is an access to the 

program documentation.

Fig. 5. Simulink diagram for simulating the arbitrary quantum algorithm

Fig. 6. Simulink diagram for simulating an arbitrary quantum algorithm

Fig. 7. Main window of QA emulator software 

(3 qubit Grover QSA)