1. A logic element comprising a first transistor element with a first source electrode, a first drain electrode and a first coupling layer in contact with the first source electrode and the first drain electrode, the logic element further comprising a second transistor element with a second source electrode, a second drain electrode and a second coupling layer in contact with the second source electrode and the second drain electrode, wherein the first and second transistor elements comprise a common gate, and wherein: the first and second coupling layers each comprises a resistance switching material; the first and the second coupling layers are arranged so as to be able to accept ions from an ion conductor layer and to release ions into the ion conductor layer wherein the ion conductor layer comprises a metallic, oxygen ion conducting part of a gate electrode material of the common gate; the first and second coupling layer are, referring to a substrate surface plane, at different horizontal positions; the first coupling layer is of a first resistance switching material; the second coupling layer is of a second resistance switching material different from the first resistance switching material; the first resistance switching material is such that an insulator-to-metal transition is induceable by an increase of a concentration of a specific ion type; the second resistance switching material is such that a metal-to-insulator transition is induceable by an increase of a concentration of said ion type; and the application of an electrical signal to the gate causes an ion concentration in the first and the second coupling layer to be altered, wherein application of an electrical signal of a given polarity to the gate enhances the electrical conductivity of the first coupling layer and diminishes the electrical conductivity of the second coupling layer, and causes the polarity at the output lead to be inverted.