Next Article in Journal
Degree of the Product of Two Algebraic Numbers One of Which Is of Prime Degree
Next Article in Special Issue
A Depth-Progressive Initialization Strategy for Quantum Approximate Optimization Algorithm
Previous Article in Journal
Analysis and Forecasting of International Airport Traffic Volume
Previous Article in Special Issue
Heart Failure Detection Using Instance Quantum Circuit Approach and Traditional Predictive Analysis
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Graph Generation for Quantum States Using Qiskit and Its Application for Quantum Neural Networks

by
Alexandru-Gabriel Tudorache
Department of Computer Science and Engineering, “Gheorghe Asachi” Technical University of Iasi, D. Mangeron Street nr. 27A, 700050 Iasi, Romania
Mathematics 2023, 11(6), 1484; https://doi.org/10.3390/math11061484
Submission received: 14 February 2023 / Revised: 5 March 2023 / Accepted: 16 March 2023 / Published: 18 March 2023
(This article belongs to the Special Issue Advances in Quantum Computing and Applications)

Abstract

:
This paper describes a practical approach to the quantum theory using the simulation and processing technology available today. The proposed project allows us to create an exploration graph so that for an initial starting configuration of the qubits, all possible states are created given a set of gates selected by the user. For each node in the graph, we can obtain various types of information such as the applied gates from the initial state (the transition route), necessary cost, representation of the quantum circuit, as well as the amplitudes of each state. The project is designed not as an end goal, but rather as a processing platform that allows users to visualize and explore diverse solutions for different quantum problems in a much easier manner. We then describe some potential applications of this project in other research fields, illustrating the way in which the states from the graph can be used as nodes in a new interpretation of a quantum neural network; the steps of a hybrid processing chain are presented for the problem of finding one or more states that verify certain conditions. These concepts can also be used in academia, with their implementation being possible with the help of the Python programming language, the NumPy library, and Qiskit—the open-source quantum framework developed by IBM.

1. Introduction

Over the last years, the quantum technology field has become more and more popular worldwide, as various simulators and real quantum computers are now available to the general public. It is a topic that is covered in universities, research centers, and companies, with clear appreciation of its potential. In 2023, IBM presented the IBM Osprey processor, a 433-qubit processor, making a leap from their Eagle processor launched in 2021 (using 127 qubits), with plans to evolve past the 4000-qubit mark in 2025 (see [1] for details).
One of the key areas that has been examined by professors and researchers and that has the potential to change the information-processing paradigm is the one of quantum neural networks; here, the machine learning concept is combined with the application of multiple quantum gates, each corresponding to rotation angles on different axes (for a visual representation of the qubit using the Bloch sphere). A presentation of one of the more hands-on approaches is given by the researchers at Google using the TensorFlow Quantum (TFQ) framework (a library for quantum machine learning), where an optimization process based on a combination of quantum and classical ideas is described (see [2] for details); as a general architecture, it is made of three elements: the input and controlled circuits and the controller module (the actual neural network).
Schuld et al. [3] presented the readers an overview of different recent concepts and algorithms regarding quantum neural networks. Li et al. [4] introduced a new neural network architecture called CHQNN, which can be used to extract the properties of various sequences. It contains three layers: the classical component is part of the output layer, while the quantum neuron design represents the hidden layer. The main idea behind the neuron is the usage of rotation gates alongside multi-qubit controlled Hadamard gates (an extension of the controlled-not gate, i.e., CNOT, but instead of inverting the state of the target qubit, a Hadamard gate is applied on state of the target qubit only if all the control qubits are in the 1 state). Different classification tests regarding the quantum phase recognition were presented in paper [5], which targets circuits based on tree tensor networks (TIN) and multiscale entanglement renormalization ansatz (MERA); the image classifications make use of the MNIST dataset together with the Cirq and TensorFlow Quantum frameworks, having results that reach maximum accuracies of 93% and 96%.
The concept behind generative adversarial networks (GANs) was applied to the quantum field by Situ et al. in their paper [6], where the authors describe the proposed circuits needed to obtain a discrete distribution; they were designed with the help of one-qubit rotation gates and controlled-phase gates (with one qubit acting as the control qubit and the other one as the target qubit). This mentioned paper includes a numerical simulation section, in which a dataset containing bars and stripes (BAS) is used to evaluate the quantum models; the results indicate that this process can lead to the distribution efficiently, and by adding more layers to the architecture, more complex tasks can be approached. Another application of hybrid quantum-classical GANs (HQCGAN) was described in paper [7], where an optimized quantum generator together with an image remapping method were tested using the MNIST and Fashion-MNIST images. The experiments were divided into discrete distribution and image generation groups, and the results underlined certain advantages for resource usage and image quality, requiring a small number of qubits for the handwritten digit images classification. Another implementation took advantage of Rényi divergences to overcome the barren plateau, which generally affects the generative adversarial networks (the authors of this technique named this framework RyQGAN; see [8] for details). The main idea is the definition of a special loss function used to train the network based on the maximal Rényi divergence between two quantum states. A fidelity percentage of 99.99%, obtained when generating Gibbs states (in the “Experiment” section of the mentioned paper), emphasized the effectiveness of RyQGAN, showing potential to be used for solving future detections problems. Zheng et al. [9] described their proposed framework for a quantum convolutional neural network (QCNN), which was divided in three parts: the quantum encoding, model design, and adjusting of the parameters. It showed good performance when tested on the MNIST dataset—in terms of learning capacity, accuracy values of 96.65% were obtained for Euclidean data and 85% for non-Euclidean data; applying three optimization algorithms and analyzing a barren plateau comparison indicated good optimization capacity; there is also research potential for lightweight QCNNs.
Other manuscripts on this subject have pointed out different use cases for quantum-classical hybrid machine learning solutions. We mention, belonging to the expert systems category, a new neuro-evolution model (quantum-inspired neuro coevolution, QNCo; see [10]) that can be applied to multi-agent coordination problems; influenced by quantum physics, it is based on the evolution of sub-populations converging to a target gain. A self-adaptive quantum rotation gate together with an altered quantum measurement are the core elements of a multi-document text summarization quantum-inspired genetic algorithm (MTSQIGA; see [11]). A time-series prediction application was given by Cui et al. [12], where the authors described the design of a new network called complex rotation quantum dynamic neural networks (CRQDNN), built using a complex quantum neuron (CQN) and an infinite-impulse response (IIR) filter for the memory component. The QuantumLeap system (see [13]) is a hybrid deep quantum neural network created for financial applications; the price of most analyzed stock securities (there are 24 selected stocks) is predicted with a relative error of below 1%. The investigation of various faults that appear in electrical power systems was proposed in paper [14] using a hybrid quantum deep learning framework. Different applications that have been proposed over the years that combine the classical and quantum techniques in relation to the brain–computer interface topic can be found in paper [15]. We also noticed the presence of quantum technology in the medical field, an example being a proposed quantum-inspired self-supervised network (QIS-Net) applied for the segmentation of brain MR images (see [16]), making use of three quantum neuron layers with good accuracy results.
Our paper is built from the need to create a better link between the evolution and generation of quantum states that can be reached in a similar context; this is achieved by combining a versatile data structure (the graph), in terms of traversal and search problems, with various types of information regarding these states. The configuration of the qubits from the obtained graph should be integrated with other problems (classical and quantum) offering either an advantage from the time and/or cost perspective or additional data that can help the researcher reduce the search area and improve the methods used towards finding the target state.
The rest of the paper is structured as follows: Section 2 presents the main ideas and objectives for the proposed manuscript, followed by a brief description of the selected quantum framework and the implementation details—an interpretation of a Statevector example and the class diagram of the solution. Section 3 illustrates the results and explanations for a complete example together with a visual representation of the graph obtained for certain parameters (one qubit register and three selected gates). Section 4 discusses the potential applications of the generated graph—general uses as well as some detailed ideas for integration inside a neural network. Section 5 completes the paper with the main conclusions.

2. Materials and Methods

2.1. Project Description

The main objective of this paper is to describe a method for finding a certain quantum state given an initial starting configuration that can be programmed directly in Python or reached by applying a sequence of quantum gates; the default starting state for all qubits is the 0 state.
A secondary goal is the quantum exploration, as we obtain a wide list of states on a given number of qubits and for different scenarios where users would be concerned with applying certain gates—these future constraints would target concepts such as complexity, gate cost, quantum processor integration, general design issues, limitations regarding specific applications, and so on. Another secondary goal is the analysis of the resulting graph, where we leave enough space for the user to decide how to interpret and to configure the graph—for this, a cost (interpreted as computation or financial) is associated with each gate and can be used to analyze the effort required to obtain a certain state (to transition from the initial state to the target one). Further algorithms that minimize cost are also possible in this context. The final objective is to discuss a configuration for a quantum neural network using the states of the graph.
With these ideas in mind, we propose an application that can generate an exploration graph, with the following convention for its elements:
  • Each node holds the information corresponding to a quantum circuit: number of qubits, used gates, and amplitudes for each state;
  • Each transition is represented by a quantum gate acting on one or more qubits;
  • Each intermediate state is analyzed even if a single gate was applied as part of a sequence of gates;
  • The newly-obtained state after applying a quantum gate is first verified through the already existing states before deciding if it should be added as a new node in the graph, not as circuit design (applied quantum gates) but by using the Statevector amplitudes (represented in Qiskit using a list containing the amplitudes for the possible states).

2.2. IBM’s Framework Presentation

The most important tool that allows for the implementation of the concepts discussed in this paper is the Qiskit open-source framework (see [17]), which gives users the opportunity to design their own quantum circuits (for the chosen algorithms), run the simulations on the local machine or on a real quantum device, and analyze the measurement results. The framework enables the initial configuration of the quantum state, the possibility to work directly from the browser or from an IDE with the installed Python library, the placement of gates (selected from a wide list), and the opportunity to add the simulation task (job) to the execution queue of the desired device specified from a list of multiple available devices and with a various number of qubits and topologies.
The classes in the proposed project required for the generation and analysis of the graph are built on top of Qiskit, namely the configuration of quantum circuits that allows us to progress through the graph and generate the next nodes, the quantum registers that hold the actual information for the qubits, and the processing component of the local circuit, using the simulator, a real processor, or directly through the use of the Statevector class.

2.3. Implementation Details

2.3.1. Statevector Example

Before going into the actual details of the project, we present a simple example that shows what the Statevector object holds in the Qiskit framework for a certain state. After implementing the entanglement circuit on a two-qubit register, as presented in Figure 1, the Statevector object is interpreted as follows (the actual data and their dimensions):
Statevector ([0.70710678 + 0j, 0 + 0j, 0 + 0j, 0.70710678 + 0j], dims = (2, 2)).
The state of the quantum register can also be written using the formal matrix notation as follows:
s t a t e = 0.70710678 + 0 j 0 + 0 j 0 + 0 j 0.70710678 + 0 j = 1 2 00 + 11 .
In other words, for the four possible states, we have the following amplitudes and probabilities:
  • 00 —amplitude approximately 0.707 ( 1 2 , so the probability is 0.5 );
  • 01 —amplitude 0 (and probability 0);
  • 10 —amplitude 0 (and probability 0);
  • 11 —amplitude approximately 0.707 ( 1 2 , so the probability is 0.5 ).
These values reflect the ideal states (no noise and no gate error), but the simulation options can be customized to reflect the behavior of the gates on any simulator (Qiskit Aer simulator) or real quantum device, depending on the user’s option.

2.3.2. Class Diagram

Using the mentioned observations from the previous sections as a starting point, we can now present the main elements in the structure of the program. There are four classes in the project, for which an explanation to each of their fields is given as follows:
  • The QuantumGate class with the following fields:
    • The type of gate used (a simple string);
    • The cost;
  • The QuantumState class with the following fields:
    • A unique state ID;
    • The minimum cost of reaching that state with the selected gates;
    • The size of the quantum register on which we apply different gates (number of qubits);
    • The quantum circuit, which is an instance of the QuantumCircuit class (from Qiskit; see [18] for details);
    • The quantum register, which is an instance of the QuantumRegister class (see [19]);
    • The statevector, which is an instance of the Statevector class (see [20]);
  • The QuantumTransition class with the following fields:
    • The current state, which is an instance of the QuantumState class;
    • The next state, which is an instance of the QuantumState class;
    • The used gate, which is an instance of the QuantumGate class;
    • A list of indices showing the qubits from the quantum register on which the gate is applied;
  • The QuantumGraph class with only one field as follows:
    • The data structure for the actual graph is a dictionary, where the keys are represented by QuantumState objects, and the values are represented by lists of QuantumTransition instances; the idea is to group all the transitions that have the same starting state as values for the same key. A list containing QuantumTransition objects could also be used to directly represent the graph, but in this case, each transition would have to be interrogated in order to filter the transitions by the starting state.
In order to generate all quantum states, the Python itertools module is used (see [21]). There are two functions used to generate the combinations: one generates all the combinations for the selected gates depending on the number of qubits, while the other generates all the possible indices of the qubits for the multiple-qubit gates (CNOT and controlled-controlled-not, CCNOT).
Thus far, the project offers support for the following gates (there is a vector holding this information in the project: supported_gate_list):
  • Single-qubit gates: X (NOT), Z, and H;
  • Multiple-qubit gates: CNOT and CCNOT.
An important implementation concept is the fact that when building the graph, before adding a new state, we must check if the Statevector of the new state is within a small error margin from all the other explored states. (This is especially important when working with Hadamard gates, as the calculus introduces small computing errors.) If so, it means that we have found an already explored state using a new route and must check to see if the cost should be updated with the one from this new path.
The base function for building the graph, i.e., add_transition(…), a method of the QuantumGraph class, adds a QuantumTransition instance for a certain key mapped as the starting state. It also checks if the new route is cheaper (faster) than the old one and updates the cost accordingly if necessary.
The UML project diagram that captures the key elements discussed above is presented in Figure 2 (using the PlantUML plugin; see [22] for details).
The user (developer/researcher) can quickly configure the following parameters:
  • The number of qubits for the register;
  • The initial state—either by setting the statevector or by applying a different number of gates;
  • The cost of the initial state;
  • The cost of the quantum gates—depending on the architecture of the used device, these parameters have different values, and by updating them, the actual minimum cost can be found;
  • The quantum gates that should be used for the exploration.

3. Results

In this section, we present a full example: the exploration graph obtained for certain parameters; these values are configured as follows:
  • The register size is set to 1 qubit;
  • The initial state is set to 0 ;
  • The cost of the initial state is set to 0 (the default value);
  • The default cost of each gate is set to 1 (for testing purposes);
  • The selected quantum gates are the X (NOT), Z, and Hadamard gates.
The generated results that describe the dictionary behind the graph can be written using the following convention: each paragraph here starts with a quantum state, for which we have its unique ID, and a list of transitions showing the states that can be achieved (called “next states”); for each state, we present the corresponding statevector and the minimum cost to reach it (from the initial starting state). For more details on the states and the transitions in the graph, please consult Appendix A.
The described graph is shown in Figure 3, using the visual representations from Qiskit for the quantum circuits.
The quantum state ψ for each node can also be formally written as follows:
  • For the state with ID = 0: ψ = 0 ;
  • For the state with ID = 1: ψ = 1 ;
  • For the state with ID = 2: ψ = 1 2 0 + 1 ;
  • For the state with ID = 3: ψ = 1 2 0 1 ;
  • For the state with ID = 4: ψ = 1 ;
  • For the state with ID = 5: ψ = 0 ;
  • For the state with ID = 6: ψ = 1 2 0 + 1 ;
  • For the state with ID = 7: ψ = 1 2 0 1 .

4. Potential Applications and Future Ideas

The main advantage of the described idea is the possibility to develop the graph from a certain starting point in a given algorithm with a configurable set of transition gates.

4.1. General Use Case

For example, let us analyze the scenario where a user wishes to find (and view) the circuit for a certain entangled state or perhaps search for potential entangled states on a given number of qubits; a quantum oracle can be proposed for this purpose as specifically designed for the approached problem. Our proposed solution can speed up this process when dealing with a higher number of qubits. After setting the starting state of the quantum register, the user can select only the gates that he/she considers to be relevant: the CNOT, Hadamard, Z, and NOT gates. (More gates can be added, depending on the circumstances, if the desired state is not found.) The program will then process all possible states, first using a single gate on one of the qubits, then adding the other gates in the selected transition list; all intermediate states are analyzed, as long as the corresponding state vector representation has not already been processed, within a certain computational error margin; it is unique from this point of view, as a state can be obtained in multiple ways with different gates.
The graph is created, node by node, containing the generated states and their probabilities, helping the user find the desired state in the graph first and then analyze the required chain of transitions (applied gates) required from the start state.
A different method for computing the cost can also be developed based on physical factors that influence the functioning of the quantum system; another idea here is to use a separate metric based on the complexity of the circuit, such as circuit depth, overall gate error, or quantum volume.
A key idea for an extension of the project is the analysis of the graph: perhaps the user wishes not only to explore it but check if a quantum state exists there—that means that it can be created/reached using the selected gates; for a certain statevector, the user can obtain the route in the graph: the chain of gates that need to be applied to achieve the desired state, with the minimum cost.
Another field (named ”previous”) can be added to the QuantumState class, containing the QuantumState object from which the current state can be obtained; this field should be modified (overwritten) when a new route with a lower cost is found at the exploration step in building the graph using all the possible transitions. In case of cost equality, we leave the first discovered route. The previous node for each state can be written as follows:
  • State <ID = 0>—previous state: none/initial state;
  • State <ID = 1>—previous state <ID = 0>;
  • State <ID = 2>—previous state <ID = 0>;
  • State <ID = 3>—previous state <ID = 2>;
  • State <ID = 4>—previous state <ID = 1>;
  • State <ID = 5>—previous state <ID = 4>;
  • State <ID = 6>—previous state <ID = 4>;
  • State <ID = 7>—previous state <ID = 6>.
Let us assume that the state that we are looking for is ψ s e a r c h = 1 2 0 1 or, written as Statevector, [−0.70710678 + 0j, −0.70710678 + 0j]. We also assume that the starting quantum state is ψ i n i t i a l = 0 (the state with ID = 0).
The actual route can be created not only as a list of IDs but also as a more complex list of transitions—in our project, a list of QuantumTransition objects. For this example, the vector of routes could be (as it is not unique): id_route = [0, 1, 4, 5, 7], while the transition route can be expressed as follows:
  • State <ID = 0>—adding a X gate on qubit [0] => state <ID = 1>;
  • State <ID = 1>—adding a Z gate on qubit [0] => state <ID = 4>;
  • State <ID = 4>—adding a X gate on qubit [0] => state <ID = 5>;
  • State <ID = 5>—adding a H gate on qubit [0] => state <ID = 7>.
Further concepts can be designed alongside applications that target other quantum algorithms, which require finding certain complex states.

4.2. Application in Neural Networks

The ideas presented in this manuscript also have great potential to accelerate or lead to better processing techniques in the field of quantum machine learning. Another parameter, such as a neuron activation weight (in the case of a quantum perceptron), can be added to the QuantumState or the QuantumTransition class. This can be seen as an extension of the already analyzed quantum machine learning concepts in recent years, with some modifications. More details can be found in ref. [3], which presents different approaches to quantum neural networks. Building this hybrid solution, which has the purpose of identifying a certain unknown quantum state that satisfies some constraints, requires two steps:
  • The first step consists of generating the exploration graph, using a starting state as close to the one desired (if this is possible by using a heuristic function; otherwise, we can use a default or a random state); if the exploration graph becomes too large, or the processing power exceeds the available resources, multiple solutions could be employed, such as a circuit depth limit or by stopping the program after running for a limited time. We also accept this as a compromise, as not building all quantum states could imply missing the target one;
  • The second step is the design of the neural network on top of the built graph; in other words, we can use the graph as a potential solution for the inner neuron layers. This kind of solution means that we are able to not only detect the desired quantum state but also have available the gate route to reach it. Combining this architecture with the cost concept would result in an optimized solution. (The cost concept can also be replaced with other ideas, as discussed.)
For example, by having the initial state ψ i n i t i a l = x 2 x 1 x 0 = 000 , we present the states from the first layer, where the gates that make the transitions possible have an associated weight, w l a y e r _ i n d e x ,   g a t e _ t y p e , q u b i t _ i n d e x . The graph generation rules would also have to be modified in order to avoid transitions to already analyzed states in the network.
The described design is schematically presented in Figure 4, where we selected three quantum gates for the corresponding graph: the NOT, CNOT, and Hadamard gates. The graph and the code required to generate it can be altered/reimagined to fit the task at hand; another point that needs to be approached, which also depends on the local problem, is deciding what the quantum states on the output (last) layer should be. A trivial solution to this could be to simply create multiple neural networks step by step and then analyze the results for each one: the first one, with no inner layer (so the only layer would be the final one—basically all transitions lead to final states); the second one, with a single inner layer; and so on. The process of designing the neural networks can take place after the graph creation, thus indicating for each group of transitions what the Statevector and circuits are for the nodes on the last layer. A metric is also needed in order to compare the results obtained for the best-fitting states in each case. The initial (input) layer of the network can also be redesigned to contain multiple starting quantum states. In the presented architecture, we named the k states on the final layer Ψ 0 , Ψ 1 , Ψ k , with all of these states being part of the graph elements, which were discovered in the graph-creation stage. A potential advantage would be that the same configuration of neural networks can be retrained for different purposes (using a different quantum oracle, when the same gates were used in the exploration phase).
Another variation of the mentioned steps is to find the desired state first using a quantum neural network (using rotation and controlled-rotation gates) and then to build the graph in order to optimize the cost.
What can also be proposed, using the described idea, is a hybrid classical–quantum solution containing multiple processing blocks, with the purpose of finding (and validating) quantum states, as follows:
  • First of all, a set of parameters is considered in order to generate the graph according to the constraints of the available quantum processor;
  • The graph needs to be analyzed, at different depths, in order to identify and build the corresponding quantum circuits for the superposition states, starting with the obtained Statevector values (if possible, in order to ensure that the quantum properties are used to accelerate the search); otherwise, a neural network such as the one presented is recommended for more complex cases;
  • Depending on the problem that needs to be solved, the validation function f is designed, and then, a quantum oracle is created ( U f ); this component answers to the question of whether the candidate state is a potential solution—multiple solutions are possible for certain problems. In case of a higher complexity, multiple quantum oracles should be proposed and sequentially applied, each filtering the solutions and mapping to a validation function. A separate qubit, q v a l , is used to indicate that a solution has been found (for an oracle); an extension of the CCNOT gate can be used to chain together multiple validation qubits;
  • The neural network block (or quantum circuit architecture using entangled states) is connected to the input of the oracle;
  • At last, as in every quantum circuit, the simulation should take place multiple times using the selected device or simulator, and then, the measurement results should be interpreted.
These ideas are presented in Figure 5—overall, the illustrated processing chain describes a new quantum technology method offering a speed-up in the search for an unknown state and that can be proposed together with different quantum machine learning topologies.
The advantage is justified by the main processing component, which ties a general circuit, designed to generate certain states, to specific oracles that can each answer a simple question; this configuration can be derived from maximally entanglement circuits for a different number of qubits or quantum neural-network-inspired circuits—either as the one presented or involving rotation gates controlled by classical neurons. Since we are integrating this pre-filtering part, which can be tweaked by each user depending on the analyzed problem, we are already selecting potential candidates and minimizing the search space. By taking into account the gate cost for the selected device and quantum state, along with other parameters that can be deduced from the graph analysis, we are founding the basis for a framework that allows for an efficient search and comparison between different states as well as evaluating different quantum machine learning concepts.

5. Conclusions

The ideas presented in this manuscript illustrate another approach to the quantum information-processing field. The concepts discussed above describe a method for building an exploration graph, starting with a given quantum state and progressing onto a parameterized set of gates; it also allows users to configure the gate cost and extend the graph with other relevant properties. The amplitudes of the states are unique for each node in the graph, and the circuits can be consulted for each state matching the corresponding Statevector object searched by the user. Another key aspect of the paper is represented by the applications of the proposed concepts—the graph can be used to find the lowest-cost route to a certain state, which is associated with the chain of gates required to reach it. A different use case is also shown, integrating the evolution of the graph into multiple quantum neural networks with an architecture based on the states obtained from the exploration graph. It can be used alongside the design of specific quantum oracles in the context of multiple validation constraints (represented by mathematical functions), therefore illustrating the theoretical processing chain that can improve the search for a quantum state.

Funding

This research was funded by the “Gheorghe Asachi” Technical University of Iasi.

Data Availability Statement

Not applicable.

Conflicts of Interest

The author declares no conflict of interest.

Appendix A

This appendix presents the details of the results obtained in the analyzed example. The states and transitions of the graph can be written as follows:
1.
State <ID = 0>
  • Statevector: [1 + 0j 0 + 0j]
  • Min cost: 0
  • Next state <ID = 1>—adding a x gate (cost = 1) on qubit(s) [0]
    • Statevector: [0 + 0j 1 + 0j]
    • Min cost: 1
  • Next state <ID = 0>—adding a z gate (cost = 1) on qubit(s) [0]
    • Statevector: [1 + 0j 0 + 0j]
    • Min cost: 0
  • Next state <ID = 2>—adding a h gate (cost = 1) on qubit(s) [0]
    • Statevector: [0.70710678 + 0j 0.70710678 + 0j]
    • Min cost: 1
2.
State <ID = 1>
  • Statevector: [0 + 0j 1 + 0j]
  • Min cost: 1
  • Next state <ID = 0>—adding a x gate (cost = 1) on qubit(s) [0]
    • Statevector: [1 + 0j 0 + 0j]
    • Min cost: 0
  • Next state <ID = 4>—adding a z gate (cost = 1) on qubit(s) [0]
    • Statevector: [ 0 + 0j −1 + 0j]
    • Min cost: 2
  • Next state <ID = 3>—adding a h gate (cost = 1) on qubit(s) [0]
    • Statevector: [0.70710678 + 0j −0.70710678 + 0j]
    • Min cost: 2
3.
State <ID = 2>
  • Statevector: [0.70710678 + 0j 0.70710678 + 0j]
  • Min cost: 1
  • Next state <ID = 2>—adding a x gate (cost = 1) on qubit(s) [0]
    • Statevector: [0.70710678 + 0j 0.70710678 + 0j]
    • Min cost: 1
  • Next state <ID = 3>—adding a z gate (cost = 1) on qubit(s) [0]
    • Statevector: [0.70710678 + 0j −0.70710678 + 0j]
    • Min cost: 2
  • Next state <ID = 0>—adding a h gate (cost = 1) on qubit(s) [0]
    • Statevector: [1 + 0j 0 + 0j]
    • Min cost: 0
4.
State <ID = 3>
  • Statevector: [0.70710678 + 0j —0.70710678 + 0j]
  • Min cost: 2
  • Next state <ID = 6>—adding a x gate (cost = 1) on qubit(s) [0]
    • Statevector: [−0.70710678 + 0j 0.70710678 + 0j]
    • Min cost: 3
  • Next state <ID = 2>—adding a z gate (cost = 1) on qubit(s) [0]
    • Statevector: [0.70710678 + 0j 0.70710678 + 0j]
    • Min cost: 1
  • Next state <ID = 1>—adding a h gate (cost = 1) on qubit(s) [0]
    • Statevector: [0 + 0j 1 + 0j]
    • Min cost: 1
5.
State <ID = 4>
  • Statevector: [0 + 0j −1 + 0j]
  • Min cost: 2
  • Next state <ID = 5>—adding a x gate (cost = 1) on qubit(s) [0]
    • Statevector: [−1 + 0j 0 + 0j]
    • Min cost: 3
  • Next state <ID = 1>—adding a z gate (cost = 1) on qubit(s) [0]
    • Statevector: [0 + 0j 1 + 0j]
    • Min cost: 1
  • Next state <ID = 6>—adding a h gate (cost = 1) on qubit(s) [0]
    • Statevector: [−0.70710678 + 0j 0.70710678 + 0j]
    • Min cost: 3
6.
State <ID = 5>
  • Statevector: [−1 + 0j 0 + 0j]
  • Min cost: 3
  • Next state <ID = 4>—adding a x gate (cost = 1) on qubit(s) [0]
    • Statevector: [0 + 0j −1 + 0j]
    • Min cost: 2
  • Next state <ID = 5>—adding a z gate (cost = 1) on qubit(s) [0]
    • Statevector: [−1 + 0j 0 + 0j]
    • Min cost: 3
  • Next state <ID = 7>—adding a h gate (cost = 1) on qubit(s) [0]
    • Statevector: [−0.70710678 + 0j −0.70710678 + 0j]
    • Min cost: 4
7.
State <ID = 6>
  • Statevector: [−0.70710678 + 0j 0.70710678 + 0j]
  • Min cost: 3
  • Next state <ID = 3> —adding a x gate (cost = 1) on qubit(s) [0]
    • Statevector: [0.70710678 + 0j −0.70710678 + 0j]
    • Min cost: 2
  • Next state <ID = 7>—adding a z gate (cost = 1) on qubit(s) [0]
    • Statevector: [−0.70710678 + 0j −0.70710678 + 0j]
    • Min cost: 4
  • Next state <ID = 4>—adding a h gate (cost = 1) on qubit(s) [0]
    • Statevector: [0 + 0j −1 + 0j]
    • Min cost: 2
8.
State <ID = 7>
  • Statevector: [−0.70710678 + 0j −0.70710678 + 0j]
  • Min cost: 4
  • Next state <ID = 7>—adding a x gate (cost = 1) on qubit(s) [0]
    • Statevector: [−0.70710678 + 0j −0.70710678 + 0j]
    • Min cost: 4
  • Next state <ID = 6>—adding a z gate (cost = 1) on qubit(s) [0]
    • Statevector: [−0.70710678 + 0j 0.70710678 + 0j]
    • Min cost: 3
  • Next state <ID = 5>—adding a h gate (cost = 1) on qubit(s) [0]
    • Statevector: [−1 + 0j 0 + 0j]
    • Min cost: 3

References

  1. IBM Unveils 400 Qubit-Plus Quantum Processor and Next-Generation IBM Quantum System Two. Available online: https://newsroom.ibm.com/2022-11-09-IBM-Unveils-400-Qubit-Plus-Quantum-Processor-and-Next-Generation-IBM-Quantum-System-Two (accessed on 23 January 2023).
  2. Hello, Many Worlds|TensorFlow Quantum. Available online: https://www.tensorflow.org/quantum/tutorials/hello_many_worlds (accessed on 23 January 2023).
  3. Schuld, M.; Sinayskiy, I.; Petruccione, F. The quest for a Quantum Neural Network. Quantum Inf. Process. 2014, 13, 2567–2586. [Google Scholar] [CrossRef] [Green Version]
  4. Li, P.; Xiao, H.; Shang, F.; Tong, X.; Li, X.; Cao, M. A hybrid quantum-inspired neural networks with sequence inputs. Neurocomputing 2013, 117, 81–90. [Google Scholar] [CrossRef]
  5. Lazzarin, M.; Galli, D.E.; Prati, E. Multi-class quantum classifiers with tensor network circuits for quantum phase recognition. Phys. Lett. A 2022, 434, 128056. [Google Scholar] [CrossRef]
  6. Situ, H.; He, Z.; Wang, Y.; Li, L.; Zheng, S. Quantum generative adversarial network for generating discrete distribution. Inf. Sci. 2020, 538, 193–208. [Google Scholar] [CrossRef]
  7. Zhou, N.-R.; Zhang, T.-F.; Xie, X.-W.; Wu, J.-Y. Hybrid quantum–classical generative adversarial networks for image generation via learning discrete distribution. Signal Process. Image Commun. 2023, 110, 116891. [Google Scholar] [CrossRef]
  8. Liu, L.; Song, T.; Sun, Z.; Lei, J. Quantum generative adversarial networks based on Rényi divergences. Phys. A 2022, 607, 128169. [Google Scholar] [CrossRef]
  9. Zheng, J.; Gao, Q.; Lü, J.; Ogorzałek, M.; Pan, Y.; Lü, Y. Design of a quantum convolutional neural network on quantum circuits. J. Franklin Inst. 2022. [Google Scholar] [CrossRef]
  10. Dias, E.D.M.; Vellasco, M.M.B.R.; da Cruz, A.V.A. Quantum-inspired neuro coevolution model applied to coordination problems. Expert Syst. Appl. 2021, 167, 114133. [Google Scholar] [CrossRef]
  11. Mojrian, M.; Mirroshandel, S.A. A novel extractive multi-document text summarization system using quantum-inspired genetic algorithm: MTSQIGA. Expert Syst. Appl. 2021, 171, 114555. [Google Scholar] [CrossRef]
  12. Cui, Y.; Shi, J.; Wang, Z. Complex Rotation Quantum Dynamic Neural Networks (CRQDNN) using Complex Quantum Neuron (CQN): Applications to time series prediction. Neural Netw. 2015, 71, 11–26. [Google Scholar] [CrossRef] [PubMed]
  13. Paquet, E.; Soleymani, F. QuantumLeap: Hybrid quantum neural network for financial predictions. Expert Syst. Appl. 2022, 195, 116583. [Google Scholar] [CrossRef]
  14. Ajagekar, A.; You, F. Quantum computing based hybrid deep learning for fault diagnosis in electrical power systems. Appl. Energy 2021, 303, 117628. [Google Scholar] [CrossRef]
  15. Huang, D.; Wang, M.; Wang, J.; Yan, J. A survey of quantum computing hybrid applications with brain-computer interface. Cognit. Rob. 2022, 2, 164–176. [Google Scholar] [CrossRef]
  16. Konar, D.; Bhattacharyya, S.; Gandhi, T.K.; Panigrahi, B.K. A Quantum-Inspired Self-Supervised Network model for automatic segmentation of brain MR images. Appl. Soft Comput. 2020, 93, 106348. [Google Scholar] [CrossRef]
  17. Qiskit. Open-Source Quantum Development. Available online: https://qiskit.org (accessed on 23 January 2022).
  18. Qiskit. QuantumCircuit. Available online: https://qiskit.org/documentation/stubs/qiskit.circuit.QuantumCircuit.html (accessed on 23 January 2023).
  19. Qiskit. QuantumRegister. Available online: https://qiskit.org/documentation/stubs/qiskit.circuit.QuantumRegister.html (accessed on 23 January 2023).
  20. Qiskit. Statevector. Available online: https://qiskit.org/documentation/stubs/qiskit.quantum_info.Statevector.html (accessed on 23 January 2023).
  21. itertools—Functions Creating Iterators for Efficient Looping–Python 3.11.1 Documentation. Available online: https://docs.python.org/3/library/itertools.html (accessed on 23 January 2023).
  22. PlantUML Integration-IntelliJ IDEs Plugin|Marketplace. Available online: https://plugins.jetbrains.com/plugin/7017-plantuml-integration (accessed on 23 January 2023).
Figure 1. Simple entanglement circuit.
Figure 1. Simple entanglement circuit.
Mathematics 11 01484 g001
Figure 2. UML Class diagram of the project.
Figure 2. UML Class diagram of the project.
Mathematics 11 01484 g002
Figure 3. The graph for the presented example, with quantum states as nodes, for a one-qubit register and three selected gates (X, Z, and H).
Figure 3. The graph for the presented example, with quantum states as nodes, for a one-qubit register and three selected gates (X, Z, and H).
Mathematics 11 01484 g003
Figure 4. Design of a neural network using the quantum states from the graph. The configuration of the output layer depends on the states from the inner layers; the data from the graph, analyzed at different exploration depths, were used to populate the final nodes in each neural network architecture.
Figure 4. Design of a neural network using the quantum states from the graph. The configuration of the output layer depends on the states from the inner layers; the data from the graph, analyzed at different exploration depths, were used to populate the final nodes in each neural network architecture.
Mathematics 11 01484 g004
Figure 5. The scheme for the hybrid classical–quantum solution, integrating the main processing blocks (the neural network) with a quantum oracle.
Figure 5. The scheme for the hybrid classical–quantum solution, integrating the main processing blocks (the neural network) with a quantum oracle.
Mathematics 11 01484 g005
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Tudorache, A.-G. Graph Generation for Quantum States Using Qiskit and Its Application for Quantum Neural Networks. Mathematics 2023, 11, 1484. https://doi.org/10.3390/math11061484

AMA Style

Tudorache A-G. Graph Generation for Quantum States Using Qiskit and Its Application for Quantum Neural Networks. Mathematics. 2023; 11(6):1484. https://doi.org/10.3390/math11061484

Chicago/Turabian Style

Tudorache, Alexandru-Gabriel. 2023. "Graph Generation for Quantum States Using Qiskit and Its Application for Quantum Neural Networks" Mathematics 11, no. 6: 1484. https://doi.org/10.3390/math11061484

APA Style

Tudorache, A. -G. (2023). Graph Generation for Quantum States Using Qiskit and Its Application for Quantum Neural Networks. Mathematics, 11(6), 1484. https://doi.org/10.3390/math11061484

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop