1 Introduction

The compelling application of quantum-enabled technology predicts the dominance of quantum computers over the world in the near future [1]. Quantum computers can be used in the area of robotics [2] which is gradually becoming one of the major focuses of quantum computation and quantum information. A quantum robot is a mobile quantum system equipped with a quantum computer and ancilla system [3]. Its major goal consists of specific changes in the state of the environment and to do measurement on it. Quantum robotics is currently drawing attention rapidly in the past few years. The main aim of quantum robotics is to apply quantum mechanics, quantum computation and quantum algorithms in the study of robotics. On the other hand, the application of robotics and engineering principles can be used to develop quantum computers and implement it as well [4]. A beautiful yet strange domain of quantum information and quantum computation is stretching its wings in the premise of commercialization. However, it is not far away from now that robots controlled by quantum processors are going to come in handy in research and commercial world on a regular basis. Those kinds of robots will be able to use the resource of entanglement, superposition principle of quantum mechanics [5], violation of Bell’s inequality [6] and will open a new horizon of robotics technology and their ability [5].

The first idea of theoretical quantum robot was introduced by Benioff [3, 7] on a strictly quantum world. Then Raghuvanshi et al. [5] showed some practical examples of quantum-controlled robots which used the idea of Braitenberg vehicles [8]. They used classical sensors and classical motors with a quantum circuit (or it can be thought like a quantum brain) that decides the movement of the quantum vehicle [9]. For a binary input with only two possible situations, the quantum circuit used there would determine the movement of the robot probabilistically and had three degrees of freedom in general such as moving to right, left and straight, while in this present work, we add one more degree of freedom to the robot as it can fly and would deterministically select its path. We use light with particular intensity and two different input states correspond to whether light is falling on the sensors or not.

We design a quantum circuit and simulate it by using IBM Quantum Experience. Recently, IBM has developed different types of prototypes of quantum processors and they are available by a free web based interface called IBM Quantum Experience (IBM QE). Researchers have taken a proper advantage of it by demonstrating and running a variety of quantum computing experiments, e.g. [10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]. Here, we use IBM’s 5-qubit quantum processor, ‘ibmqx4’ to design the quantum circuit and perform the experiment by simulating it. We verify the new protocol of quantum robot and illustrate its application in a game.

The paper is organized as follows. Section 2 discusses the theoretical scheme of a Braitenberg vehicle in brief. Sections 3 and 4 focus on the quantum-controlled circuit and how it simulates the behaviour of the robot deterministically. Section 5 explicates an application of quantum robot in a game, where our robot is a perfect winner. Finally, we conclude the paper in Sect. 6 by providing its future implications and applications.

2 The classical Braitenberg vehicle

The revolutionary and striking idea behind Braitenberg vehicles [8] is that with only simple circuit structure some mixed and complex behaviour can be shown. A schematic diagram of a simple Braitenberg vehicle is depicted in Fig. 1.

Fig. 1
figure 1

Schematic side view of Braitenberg vehicle. The light sensors S1 and S2 are presented here as an angle which are connected to the motors M1 and M2, respectively, represented by rectangular boxes. Here W1 and W2 are wheels of the vehicle

As observed from Fig. 1, the two light sensors, S1 and S2, are directly connected with the two motors, M1 and M2, respectively. The mechanism is such that if a light sensor senses some light, then the motor connected to it starts and in the absence of light, the motor turns off. When the robot is exposed to high light intensity, both the motor is turned on, and as a result, the robot moves forward at full speed. In the case when only the left light sensor, S1, senses some light, only the left motor, M1, starts and the motor moves towards right-hand side. The same goes for the case of light coming from right-hand side in which case the motor turns to the left. This behaviour of the robot can be interpreted as ‘fear’ or ‘shyness’. In our work, we have added one more degree of freedom to the simple Braitenberg vehicle. We present a vehicle that has two light sensors (S1 and S2) attached with it and two motors (M1 and M2) which are connected to the sensors as depicted in Fig. 2. However, here we have used another additional motor, M3, which makes the robot fly in certain situation. The design of the quantum circuit is such that it deterministically controls the behaviour of these kind of vehicles. The schematic diagram of our quantum-controlled Braitenberg vehicle is illustrated in Fig. 2.

Fig. 2
figure 2

Schematic side view of quantum robot. The light sensors S1 and S2 are presented here as an angle which are connected to the motors M1 and M2, respectively, and the motor M3 is connected with a propeller P

3 The quantum scheme

The robot designed here has three motors, M1, M2 and M3, and two sensors, S1 and S2. We are denoting \(|0\rangle \) as light is not falling on sensors, and \(|1\rangle \) as light is falling on the sensors. The two motors (M1 and M2) of robot are connected directly to the two sensors (S1 and S2) as shown in Fig. 2. We introduce a third motor, M3, that is attached with a propeller, P, overhead of the vehicle. When the third motor (M3) is active, the vehicle takes off from the ground. The rest of its actions are same as the classical model discussed earlier in Sect. 2. All the motors (M1, M2 and M3) used in this robot have binary output as \(|0\rangle \) and \(|1\rangle \). Here \(|0\rangle \) denotes that the motor is not moving, and \(|1\rangle \) denotes that the motor is moving. We design a quantum circuit such that when the input of both the sensors (S1 and S2) is \(|00\rangle \), the output of motors (M1 and M2) is \(|11\rangle \) that implies the robot moves forward. When the input of both the sensors (S1 and S2) is \(|01\rangle \), then the output is \(|01\rangle \) that means the right motor (M2) runs and the left motor (M1) remains off, so that the robot can take a turn towards the left and the robot turns away from the source. When the input of both the sensors (S1 and S2) is \(|10\rangle \), then the output is \(|10\rangle \) and similarly, it avoids closeness to the source. When the input of both the sensors (S1 and S2) is \(|11\rangle \), the output is \(|00\rangle \), and in this situation the third motor starts and the robot takes a flight. The details of the movement of the robot are tabulated in Table 1.

Table 1 The robot behaviour upon the sensation of light

4 The quantum circuit

4.1 Working and decomposition of two-control-two-target Toffoli (\(C^{2}(X_{3}X_{4})\)) gate

The working of two-control-two-target Toffoli gate \(C^{2}(X_{3}X_{4})\) is described as follows. There are two control qubits and two NOT operations in \(C^{2}(X_{3}X_{4})\) gate. A four-qubit quantum state is taken as an input. The gate flips both the third and fourth qubits of the state only in case when the first two qubits are in \(|11\rangle \) state; otherwise, there is no change in the output state. The decomposition of \(C^{2}(X_{3}X_{4})\) is illustrated in Fig. 3. Two Toffoli gates (\(C^{2}(X_{3})\) and \(C^{2}(X_{4})\)) are used to design the above quantum gate.

Fig. 3
figure 3

Equivalent quantum circuit for two-control-two-target Toffoli (\(C^{2}(X_{1}X_{2}\)) gate

Fig. 4
figure 4

Quantum circuit for implementing the proposed protocol of the quantum robot. The top two qubits represent two ancilla qubits, the next two are the input qubits, and the last one is attached with the third motor (M3). Measurements are done in the Z basis on the last three qubits, which determines the activation of the certain motors and thus controls the movement of the robot

4.2 Circuit diagram

Here we use IBM Quantum Experience’s 5-qubit quantum chip, ‘ibmqx4’ for performing the experiment. The first two qubits, q[0] and q[1] (see Figs. 4 and 5), represent the ancillary qubits, and the last three qubits, q[2], q[3] and q[4] correspond to three motors M1, M2 and M3, respectively.

  • If the input is \(|00\rangle \), then the initial state of the whole system is \(|00000\rangle \). After the action of two CNOT gates on two ancilla qubits (q[0] and q[1]), the output becomes \(|00000\rangle \). Then the two-control-two-target Toffoli gate with the controlled qubits (q[0] and q[1]) as \(|11\rangle \) followed by a two-anticontrol-two-target Toffoli gate with controlled qubits (q[0] and q[1]) \(|00\rangle \) acts on the input qubits (q[2] and q[3]) and the state of the whole system becomes \(|00110\rangle \). Finally, a Toffoli gate with two-anticontrol qubits (q[2] and q[3]) operates on the three qubits (q[2], q[3] and q[4]) connected to the motors (M1, M2 and M3), and hence, the system’s state is changed to \(|00110\rangle \). Then measurement along the Z-basis on the last three qubits (q[2], q[3] and q[4]) gives the result as 1, 1 and 0 for motors M1, M2 and M3, respectively. Thus, both the motors (M1 and M2) connected with wheels (W1 and W2) start and the quantum robot moves forward, while the third motor (M3) remains inactive.

  • Similarly for the input \(|01\rangle \), the initial state of the whole system is \(|00010\rangle \). In a similar manner by action of gates, it can be seen that the final state of the system remains \(|01010\rangle \). Then measurement along the Z-basis on the last three qubits (q[2], q[3] and q[4]) gives the result as 0, 1 and 0 for motors M1, M2 and M3, respectively. Hence, only the motor connected with the right wheel (W2) starts and the quantum robot takes a left turn.

  • With the input state \(|10\rangle \), then the initial state of the whole system is \(|00100\rangle \) and the final state becomes \(|10100\rangle \). Then measurement along the Z-basis on the last three qubits (q[2], q[3] and q[4]) gives the result as 1, 0 and 0 for motors M1, M2 and M3, respectively. Hence, only the motor (M1) connected with the left wheel (W1) starts and the quantum robot turns right.

  • The interesting case happens for the input \(|11\rangle \). Then the initial state of the whole system is \(|00110\rangle \), and the system’s state is finally changed into \(|11001\rangle \). Then measurement along the Z-basis on the last three qubits (q[2], q[3] and q[4]) gives the result as 0, 0 and 1 for motors M1, M2 and M3, respectively. Here both the motors (M1 and M2) connected with wheels (W1 and W2) remain turned off but the third motor (M3) becomes active now, and the robot takes off from the ground.

Fig. 5
figure 5

Construction of the quantum circuit in IBM QE. Two-controlled-two-target Toffoli gate (shown in yellow coloured box of Fig. 4) is decomposed into parallel c Fonnection of two-controlled Toffoli gates using 1, 2, 3 and 1, 2, 4 qubit, respectively. The two-controlled Toffoli gates are decomposed into Hadamard, \(S, T, T^{\dagger }\) gates as explained in Ref. [1] (Color figure online)

4.3 Simulation of the circuit diagram

We constructed our quantum circuit in IBM Quantum Experience using the quantum gates such as CNOT, Hadamard \((H), X, T, T^{\dagger }, S, S^{\dagger }\). Since two-controlled-two-target Toffoli gates do not have a standard notation in IBM Q Experience, they are constructed by using standard gates such as Hadamard, \(X, T, T^{\dagger }, S, S^{\dagger }\). The result of our simulation is presented in Fig. 5.

Fig. 6
figure 6

Result of simulation of the quantum circuit. For a particular input, the output state is deterministic and is represented by the coloured boxes whose size determines the probability of that particular output state. In our case, the size of each box is unity. For example, the yellow coloured box for input state \(|00\rangle \) represents that only the output state of \(|110\rangle \) appears with probability one and other output states do not show up at all (Color figure online)

5 Application of quantum robot in a game

The model of quantum robot introduced here has an advantage over a simple game. Its schematic diagram is presented in Fig. 6. Following are the two assumptions to play the game.

  • This is a four-lane road where there is no divider in between them. The robot spreads over two lanes, and it is always in motion with a constant speed. The motors M1 and M2 of the robot are designed such that they help it to change lane upon receiving proper signals.

  • There are various other obstacles (which sends some kind of light signals) moving on only the two terminal tracks named as Track 1 and Track 2 (see Fig. 7). They move randomly on both ways up or down, but all of them have same uniform speed with respect to the robot. There is one starting point and one finishing line.

Fig. 7
figure 7

Advantage of quantum robot over a game. Top view of the quantum robot in a hypothetical game situation is depicted. Here 1 and 2 are the tracks allowed for obstacles. S1a and S1b are sensors on one side whose input goes through an OR gate to the first input of the quantum circuit. S2a and S2b are similarly connected to the second input

The rule of the game is described as follows. The quantum robot has to cover the distance upto the finishing line without touching any of the obstacles. Here we use the same kind of robot, but it would have four sensors (S1a, S1b, S2a and S2b), and each couple of sensors on one side would be connected through an OR gate to the input of that side of the vehicle. If from any side there is some obstacle, the input to the circuit will be \(|1\rangle \). If the right motor turns on, the robot will shift a lane towards the left and vice versa. While both the motors are turned on, the robot remains still. When obstacles are coming from both the tracks, then the third motor (M3) connected to propeller helps the robot to take off from the ground. Now in this hypothetical construction of a game, our robot will always win it. The condition of winning is apparent from Table 1 that represents the motion of the robot in different scenarios.

6 Conclusion

To conclude we have demonstrated here a quantum algorithm for a quantum Braitenberg vehicle, where one more motor has been added that enables the vehicle to fly. A new quantum circuit has been proposed to manipulate the behaviour of the quantum robot and has been simulated using the IBM Q Experience platform. Furthermore, the concept of quantum robot proposed here has been applied to a simple game to avoid accident in the game. Advancement in the area of robotics is one of the major concerns of scientists since the very beginning of technological development [2]. When it comes to quantum robot, its importance grows much more because of various surprising and strange new phenomena operating in the quantum domain. Benioff’s [3] idea of quantum robot has been applied in our physical world to make a quantum robot and now the challenge is to extend its ability and versatility. Our goal of this project is to cultivate the ideas further to have a quantum emotional robot in near future. The construction of robot with quantum brain explains well how a quantum system is interacting with the surroundings and other quantum phenomena [3]. In future quantum technology, a quantum computer can be used for various purposes like robot action planning, problem solving and vision [5] to perform significantly faster than any modern robotics technology.