Taking advantage of defects in a material to extend the functionality of a device. Oxygen gaps in the oxide barrier of a magnetic tunnel junction (MTJ) induce states within this dielectric. This changes the transport of spin-polarized electrons. In order to shape the device, these states can be dynamically electrically charged/discharged, just as the neuron shapes the electrical transmission of a synapse, but also optically. We have explored how to temporally modify the state of a TMJ using electrical/optical pulses.