Full text
Int. Journ. of Unconventional Computing, Vol. 17, pp. 159–171 ©2022 licensed under the Creative Commons Reprints available directly from the publisher Attribution 3.0 License. Photocopying permitted by license only Published by license under the OCP Science imprint, a member of the Old City Publishing Group. An Approach to Interfacing the Brain with Quantum Computers: Practical Steps and Caveats E. R. MIRANDA1,∗,S.VENKATESH1,J.D.MARTIN-GUERRERO2, C. HERNANI-MORALES2,L.LAMATA3AND E. SOLANO4,5,6 1ICCMR, University of Plymouth, Plymouth, UK 2IDAL, Electronic Engineering Department, ETSE-UV, University of Valencia, Valencia, Spain 3Department of Atomic, Molecular and Nuclear Physics, University of Seville, Seville, Spain 4QuArtist, Physics Department, Shanghai University, Shanghai, China 5Ikerbasque, Bilbao, Spain 6Kipu Quantum, Munich, Germany Received: December 25, 2021. Accepted: December 29, 2021. We report on the first proof-of-concept system demonstrating how one can control a qubit with mental activity. We developed a method to encode neural correlates of mental activity as instructions for a quantum computer. Brain signals are detected utilising electrodes placed on the scalp of a person, who learns how to produce the required mental activity to issue instructions to rotate and measure a qubit. Currently, our proof-of-concept runs on a software simulation of a quantum computer. At the time of writing, available quantum computing hardware and brain activity sensing technology are not sufficiently developed for real-time control of quantum states with the brain. But we are one step closer to interfacing the brain with real quantum machines, as improvements in hardware technology at both fronts become available in time to come. The paper ends with a discussion on some of the challenging problems that need to be addressed before we can interface the brain with quantum hardware. ∗Contact author: E-mail: [email protected] 159
160 E. R. MIRANDA et al. 1 INTRODUCTION In a recent perspective paper [1], we proposed the concept of Quantum Brain Networks (QBraiNs) as an emerging interdisciplinary endeavour, integrating knowledge and methods from neurotechnology, artificial intelligence (AI), and quantum computing (QC). The objective of QBraiNs is to establish direct communications between the human brain and quantum computers. We foresee the development of highly connected networks of wetware and hardware devices, processing classical and quantum computing systems, mediated by Brain-Computer Interfaces (BCI) and AI. Such networks will involve unconventional computing systems and new modalities of human-machine interaction. This paper introduces a first attempt at controlling a qubit with mental activity. We developed a proof-of-concept system, which demonstrates how a person can rotate and measure a qubit using brain signals. However, due to limitations imposed by currently available quantum computing hardware and brain sensing technology, our proof-of-concept runs on a software simulation of a quantum computer. Nevertheless, we are one step closer to interfacing the brain with real quantum machines, as improvements in hardware technology at both fronts become available in time to come. We invented a method to encode neural correlates of mental activity as instructions for a quantum processor. Brain data are read utilising electrodes placed on the scalp of a person, who learns how to produce the required mental activity to issue instructions to rotate and measure a qubit. By way of previous related work, Kanas et al. [2] hinted at the possibility of interfacing the brain with quantum computers. Other speculative propositions were put forward by Pesa and Zizzi [3] and Musha [4]. However forward-thinking as these works may sound, none of them present a concrete experiment or demonstration to support their cases. To the best of our knowledge, the first ever practical demonstration of BCI using quantum computing was reported by Miranda [5]. The goal of our research is to go a step beyond using quantum computing to analyse brain signals for controlling devices, such as a robot, a vehicle, or a musical instrument, as introduced in [5]. Rather, here we envisage the possibility of forging deeper connections between brains and quantum computers. The ultimate goal is to be able to affect the states of quantum computers with the mind. 2 CODES OF BRAIN ACTIVITY The Homo sapiens’ brain is one of the most complex systems known to science. It has circa one hundred billion neurones forming a network of
ANAPPROACH TO INTERFACING THE BRAIN WITH QUANTUM COMPUTERS 161 quadrillions of connections [6]. The amount of information that circulates through this network is, although probably bounded, immense. Essentially, neurones are electrical entities. They communicate with one another through action potentials and chemical neurotransmitters. These action potentials are often referred to as spikes. There exists technology nowadays to record neural communication at various levels: from the microscopic level of neurone-to-neurone communication, to higher levels of communication between networks of neurones. Unfortunately, most of this technology is impractical for deployment outside highly specialised research laboratories. At the same time, the engineering to develop sensors made with bioelectronics and nanomaterials is progressing fast to improve this scenario [7]. Even though sensing technology is becoming increasingly sophisticated, the understanding of the meaning of sensed signals remains very problematic. We may be able to detect neural signals fairly accurately nowadays, but we would not necessarily know what they mean. For instance, it is not hard to render sequences of spikes as sequences of binary numbers for a digital computer to process. But we would have very little clues about what the neurones are communicating to each other. Of course, AI can provide solutions here, as is the case of the machine learning (ML) algorithms for neural decoding introduced in [8]. A widely used method for reading electrical brain activity is to use electrodes placed on the scalp of a person (Figure 1). This recording is called the electroencephalogram, or EEG [9]. There is a plethora of different EEG recording systems commercially available. They are of varying reliability; the low-cost ones usually relay more spurious signals than actual EEG. It FIGURE 1 Brain activity can be read using electrodes strategically placed on the human scalp.
162 E. R. MIRANDA et al. FIGURE 2 Widely used scheme for positioning electrodes for EEG recording. is also possible to record electrical brain activity with electrodes surgically implanted under the skull, on the surface of the cortex, or deep inside the brain; e.g., electrocorticography (ECoG) [10]. Surgically implanted electrodes provide substantially better signals to work with than scalp electrodes. But brain implants are not routinely used in research with humans at present for obvious health and safety reasons1. 2.1 The electroencephalogram For this project, we adopted scalp EEG. We used an affordable off-the-shelf mid-range device manufactured by g.tec, Graz, Austria2. It consists of a cap furnished with electrodes and a transmitter that relays the EEG wirelessly to a computer. The standard scheme for positioning electrodes on the scalp is shown in Figure 2. The terminology for referring to the positioning of the electrodes uses letters to indicate a brain region and a number: Fp (pre-frontal), F (frontal), C (central), T (temporal), P (parietal) and O (occipital). Odd numbers are for electrodes on the left side of the head and even numbers for those on the right side; the letter “z” stands for the central region. For this project, 1Other technologies for brain scanning include functional Magnetic Resonance Imaging (fMRI), nearinfrared spectroscopy (NIRS), and magnetoencephalography (MEG). However, these are prohibitively expensive, less portable, and (by the time of writing) offer inadequate time-resolution for BCI purposes. 2https://www.unicorn-bi.com/
ANAPPROACH TO INTERFACING THE BRAIN WITH QUANTUM COMPUTERS 163 Frequency Bands Rhythms Mental States f<4 delta Sleep 4≤f<8 theta Drowsiness 8≤f<15 alpha Low arousal; unfocused; relaxed 15 ≤f<40 beta High arousal; focused; excited TABLE 1 Typical EEG rhythms and associated mental states. Frequency bands are expressed in Hertz (Hz). we used eight electrodes (i.e., eight EEG channels) positioned at F8, F7, Cz, Pz, C4, C3, T6 and T5, respectively. Power spectrum analysis is a popular method to extract information from EEG. This method breaks the EEG signal into different frequency bands and reveals the distribution of power between them. Power spectrum analysis is widely used in BCI research because it reveals patterns of brain activity that can be recognised automatically and translated into commands for a system. Research exploring the mental correlates of EEG usually considers spectral components up to 40 Hz [11]. There are four recognised spectral frequency bands, or EEG rhythms, each of them associated with specific mental states (Table 1). 2.2 Encoding method We developed a simple method to encode EEG as instructions to rotate a qubit. The method takes into account two mental states: low arousal (a.k.a. relaxed) and high arousal (a.k.a. excited). However, to control the qubit, we need at least four different instructions. As the number of instructions is greater than the number of mental states, we sequentially relayed instructions to the system through unique ‘brain codes’. These are Morse-like binary codes. As shown in Table 2, there is a unique brain code associated with each instruction, where 0 and 1 correspond to relaxed and excited mental states, respectively. The instructions are as follows: r{0, 1}: This is the instruction to start the program, which initializes the connection with the quantum system. None of the other instructions would work without this initialization. r{1, 1}: This instruction increases the angle of rotation, by a pre-defined amount. r{0, 0}: This instruction decreases the angle of rotation, by a pre-defined amount. r{1, 0}: This instruction has two functions. When it occurs for the first time, it changes the axis of rotation on the Bloch sphere (Figure 3),
164 E. R. MIRANDA et al. Command Brain Code Description Start program {0, 1} A relaxed state followed by an excited state. This initializes the connection with the quantum computer. Increase angle {1, 1} An excited state followed by another excited state. This increases the angle of rotation. Decrease angle {0, 0} A relaxed state followed by another relaxed state. This decreases the angle of rotation. Change axis or measure {1, 0} An excited state followed by a relaxed state. On its first occurrence, it shifts the axis of rotation. On its second occurrence, it measures the qubit. TABLE 2 Different instructions passed to the quantum computer through unique brain codes. from z(vertical axis) to y(horizontal axis), and vice-versa. Then, when it occurs for the second time, the system measures the qubit. 3 MACHINE LEARNING Section 2 already hinted that the task of establishing what brain signals mean is a fiendish problem. And the fact that the EEG signal is very noisy makes this even more complicated. The EEG signal captured by surface electrodes is severely distorted by corticalfluids, the meninges3, the skull,skin and hair. Thesignal is unreliable, even to identify only two different classes of mental states. Hence, we use machine learning to harness the capability of the system to identify them. In order to teach the system to classify between two states of mind, we need to compile a training set with labelled data produced by the user. First of all, the system has to be calibrated for the specific user. And this person needs to train themselves how to produce EEG corresponding to relaxed and excited mental states, respectively [12]. For instance, closing the eyes is one of the easiest and most pragmatic ways to induce the brain to produce (‘relaxing’) alpha rhythms. Once the user has practised how to 3These are membranes that envelop the brain.
ANAPPROACH TO INTERFACING THE BRAIN WITH QUANTUM COMPUTERS 165 achieve a relaxed state of mind, then this is effortlessly achievable with the eyes open. People who are trained in meditation techniques (e.g., yoga) are able to produce alpha rhythms with ease. Beta rhythms can be produced by imagining, or remembering, a stressful situation. Mentally solving a puzzle or a mathematical problem can induce the brain to produce (‘exciting’) beta rhythms. Once the user has rehearsed to switch between the two states of mind, then samples of EEG signals corresponding to the respective states are recorded to form a training data set for the classifier. Next, we perform short-time fast Fourier transform (FFT) analysis on each sample to calculate their average power in the alpha and beta frequency bands. These values are used as features to teach the samples’ profiles to a machine learning algorithm. For the machine learning, we adopted the k-Nearest Neighbors (kNN) method. We implemented this using the scikit-learn Python library version 1.0.14. kNN is a supervised machine learning method widely used for classification and regression [13]. In the case of classification, it is based on assigning a class (or label) to a given sample, to which most of its kneighbours (in a given metric space) belong to. The sample data set was split into two subsets, a training and a test set, respectively. The former is used for the calculation of distances (Eq. 1). And the latter is used to simulate how the system would work in a real environment. dij =||xi−xj|| (1) In particular, kNN calculates the distance from each sample in the test set to the samples of the training set. Then, distances are ordered from smallest to largest, and the kclosest samples are selected. The next step involves querying the labels of the selected ksamples. As we are dealing with a classification problem, a voting strategy is used to decide the class of the test sample; i.e., the most voted label is used as the selected class. The degrees of similarity between the samples are calculated using Euclidean distance measurements. The algorithm calculates all possible pairwise Euclidean distances between them. Samples that are close to each other are assigned the same label. Our assumption is that similar brain activities have EEG profiles that are close to each other. Thus, kNN enables the system to determine the label (or, ‘class’) of new incoming EEG data using a distance criterion. 4https://scikit-learn.org/stable/
166 E. R. MIRANDA et al. FIGURE 3 A snapshot of rotating the qubit using the brain code {1, 1}. 4 PROOF-OF-CONCEPT SYSTEM As explained in section 2.2, a user alters their mental states to generate brain codes, or instructions, to rotate a qubit. There is a metronome to synchronize thebrain with the system.It emits an audible‘click’ every second. Thesystem builds the brain codes within a window of time lasting for four clicks (i.e., four seconds). The flow diagram in Figure 4 illustrates how the system works. Initially, the system emits four clicks, which prompts the user to be ready to start a session. Subsequently, the brain activity detected during the following four clicks will correspond to the first digit in the code. Similarly, the second digit is established through the next four clicks. Then, a rest period of four clicks is provided to enable the user to monitor the output; that is, to see if the desired qubit rotation has been achieved. Then, the cycles recommences, and so on. Figure 3 shows a snapshot of rotating the qubit with the code {1, 1}. In this case, the system detected two consecutive excited mental states in the EEG. This instructed the system to rotate the qubit to the right by a given angle. As a convention, in the context of Figure 3, to ‘increase the angle of rotation’ means to move the state vector to the right side of the image. Conversely, to ‘decrease the angle of rotation’ means to move the state vector to the left. A video demonstration and programming code are available at the ICCMR GitHub repository: https://github.com/iccmr-plymouth/Quantum-BCI. 5 CONCLUDING DISCUSSION 5.1 Towards BCI with quantum hardware Our proof-of-concept demonstration currently runs on an IBM Quantum simulator5. In general, quantum simulators offer more controllability than real 5https://www.ibm.com/quantum-computing/services
ANAPPROACH TO INTERFACING THE BRAIN WITH QUANTUM COMPUTERS 167 FIGURE 4 System flow diagram. quantum computers and, for a small number of qubits, there would be no much difference in performance. Currently, to use a real quantum computer, a program needs to be sent to a machine through a cloud service for batch processing. It is placed in a queue to be computed at a later time. Then, the results are sent back to the client computer. It is not uncommon to having to wait for dozens of minutes until a queued job is processed. This is problematic because our system needs real time access to a qubit. It is important to note, however, that even if current providers of quantum computing hardware facilities would grant us direct access to their machines, our system would need a specific range of parameters that are not generally available by the time of writing.