[en] Stimulated Raman adiabatic passage (STIRAP) is a well-studied pump-probe control scheme for manipulating the population of quantum states of atoms or molecules. By encoding the digits to be operated on as "on" or "off" laser input signals we show how STIRAP can be used to implement a finite-state logic machine. The physical conditions required for an effective STIRAP operation are related to the physical conditions expected for a logic machine. In particular, a condition is derived on the mean number of photons that represent an on pulse. A finite-state machine computes Boolean expressions that depend both on the input and on the present state of the machine. With two input signals we show how to implement a full adder where the carry-in digit is stored in the state of the machine. Furthermore, we show that it is possible to store the carry-out digit as the next state and thereby return the machine to a state ready for the next full addition. Such a machine operates as a cyclical full adder. We further show how this full adder can equally well be operated as a full subtractor. To the best of our knowledge this is the first example of a nanosized system that implements a full subtraction.