Open Access Article
Gerliz M. Gutiérrez-Finol
a,
Kirill Zinovjev
b,
Alejandro Gaita-Ariño
*a and
Salvador Cardona-Serra
*b
aInstituto de Ciencia Molecular (ICMol), Universitat de València, Paterna, Spain. E-mail: alejandro.gaita@uv.es
bDepartamento de Química Física, Facultad de Química, Universitat de València, Burjassot, Spain. E-mail: salvador.cardona@uv.es
First published on 25th February 2026
Polymer assisted ion transport plays a central role in both energy storage technologies and emerging neuromorphic computing devices. Accurately modeling how ions move is crucial for understanding the behavior of batteries and memristors, yet it remains difficult due to the combined effects of drift, diffusion, and electrostatic interactions, along with the limits of continuum models and molecular dynamics. These issues are especially important in the context of the climate and energy crisis, where high performance, low carbon technologies rely on well optimized ion conducting materials and devices. In this work, we present a scalable and flexible stochastic simulation platform based on Markov chain Monte Carlo methods to model ion migration in solid state systems. The platform uses a vectorized, rail based description of device geometry, which allows fast simulations of lateral ion transport and space charge effects while keeping the inherently random nature of ion hopping. It supports a wide range of material systems and can incorporate experimental parameters without requiring changes to the code. We also introduce an implementation optimized for highly energy efficient GPUs, which boosts performance while lowering the carbon footprint of the simulations. Validation with polymer based memristive devices shows that the simulator captures key behaviors such as relaxation decay, current voltage hysteresis, and learning and forgetting dynamics. By combining computational efficiency with relevant mesoscale physics, this platform offers a practical and versatile tool for exploring ion driven processes in energy storage and neuromorphic devices, supporting exploratory and applied research.
Neuromorphic computing aims to replicate the brain's energy efficient way of processing information by using synthetic materials that emulate neuron like behavior. In recent years, proposals from chemistry, physics, electronics, and materials science have advanced the design of artificial neurons and neural networks.
From the perspective of materials design, ion migration plays a central role in both neuromorphic computing and energy technologies. In batteries and supercapacitors, this phenomenon governs charging rates, cycle life, and processing performance.4,5 In information technologies, ion migration has become one of the most effective ways to achieve memristive behavior and neuromorphic devices, since controlled ion movement allows for non volatile memory and synaptic plasticity.6–8 Unlike the relatively free movement of ions in liquids, transport in solid materials occurs through hopping between vacancies, interstitial sites, or disordered paths within crystalline or amorphous structures. Gaining insight into these processes is therefore key to enhancing the performance of both energy storage systems and neuromorphic devices.9–11
Ion migration in solid state materials results from the combined effects of drift, diffusion, and electrostatic interactions. When an external bias is applied, drift becomes the dominant process, with mobile ions responding to the electric field. Cations move toward the negative electrode, while anions are pushed toward the positive one. As ions accumulate at interfaces, repulsion between like charges increases and creates an internal electric field that counteracts the applied bias. This internal field can weaken the overall driving force for drift, encourage the buildup of space charge, and eventually shift transport toward a diffusion dominated regime.
When the bias is removed, transport is governed mainly by diffusion as ions relax from the high density interfacial regions toward a more uniform distribution. However, Coulombic effects persist: densely packed ions still resist further compaction, slowing the return to equilibrium.12 These dynamics, marked by a rapid accumulation driven by drift and followed by a slower relaxation shaped by electrostatic repulsion, are commonly observed in memristive devices, perovskite films, and other ionic conductors.9–11 They have a strong influence on macroscopic properties such as hysteresis in current voltage curves, charge retention times, and the overall efficiency of ion transport.13,14
However, simulating ion transport remains challenging: Continuum methods, such as drift and diffusion models, are difficult to use routinely because they rely on a large number of parameters that are often hard to determine.15 In addition, several ion related processes remain poorly understood and are therefore rarely included, especially those involving interactions with transport layers and ion penetration effects.15 Molecular dynamics can describe atomic scale behavior in detail, but it quickly becomes impractical for large systems or long time windows. In most cases, simulations are limited to a few nanoseconds, while the transport is often governed by rare, long range hopping events that can extend into the microsecond regime.16
Alternatively, modeling tools like Molecular Dynamics are employed to study ion movement in nanoscale fluid systems, such as investigating ion drift in nanochannel water flows under external electric fields for desalination.17 By contrast, when it comes to simulating kinetic processes in solid state materials, advanced tools such as kMCpy, a Python package for kinetic Monte Carlo simulations (KMC), have been developed to study ionic transport in crystalline systems. Unlike molecular dynamics, KMC methods are well suited for reaching much longer timescales, up to microseconds or even milliseconds, as well as larger length scales on the order of micrometers. This makes them particularly useful for capturing ion transport behavior in crystalline materials.16
Building on these ideas, the simulator presented here is fully vectorized to improve efficiency and introduces a rail based abstraction of device geometry based on a dimensionality reduction. In this framework, ions move stochastically along predefined one dimensional paths, referred to as rails, with each rail containing a fixed number of mobile ions. Ion migration, which in real materials can follow curved paths or depend strongly on local morphology, is projected onto these independent one-dimensional rails. This simplification reformulates the previous drift–diffusion approaches but using a stochastic hopping formalism that preserves mesoscale transport statistics while reducing computational complexity. Motion between rails or in the vertical direction is intentionally excluded, which reduces the dimensionality of the problem in a controlled way. This approach preserves device level transport statistics while allowing simulations to scale efficiently. Increasing the number of rails enhances statistical sampling without changing the underlying stochastic rules.
Experimental data can be imported directly through external files, available in both MATLAB and Python. Thanks to flexible rate definitions and a modular structure, it can be adapted to a wide range of materials and transport mechanisms. Validation using memristive device case studies shows that the model captures key experimental trends and offers microscopic insight into resistive switching and ion migration. By striking a balance between efficiency, scalability, and reproducibility, this tool supports the study of ion driven processes in energy storage, non volatile memory, and neuromorphic computing. It also contributes to ongoing efforts toward frugal modeling in molecular electronics.18
Modeling ionic motion in solid state and membrane systems has traditionally relied on coupled differential equations, most notably the drift-diffusion or Nernst–Planck formulations, sometimes combined with Poisson's equation to account for electrostatic effects. These continuum approaches are computationally efficient, but solving the equations often faces challenges with numerical stability and convergence. They also struggle to capture correlated or collective migration events that play a critical role in device performance,16,25 since they rely on macroscopic parameters and largely ignore the stochastic nature of ionic random walks.25 These methods become particularly limited when the migration path is curved, such as the route that anion vacancies follow in the perovskite structure,20 or when ion transport shows non linear mobility under very high electric field strengths (e.g., MV cm−1).20 In these cases, the standard linear assumptions of the models no longer hold, because the effect of the applied electric field changes along the curved trajectory of the migrating anion.20
A key aspect of modeling LECs is the distinction between electronic charge transport and ion migration. The interaction between these two phenomena has historically been challenging to describe, leading to the development of two principal models: the electrodynamic (ED) model and the electrochemical doping (ECD) model.
The ED model, introduced by de Mello and colleagues,26,27 attributes enhanced charge injection to the formation of electric double layers at the electrodes, which screen the active layer from the external field. In this framework, steady state currents are dominated by electronic diffusion, with negligible drift, and no internal p–n junction is predicted within the bulk material. In contrast, the ECD model, developed by Pei and co-workers,28–30 proposes that injected charges trigger bulk doping of the conjugated polymer via ion migration. This leads to the formation of expanding p- and n-type regions that eventually meet to create a dynamic p–n junction, where light emission occurs. Evidence supporting this model comes from spatially resolved photoluminescence quenching, scanning Kelvin probe microscopy (SKPM) potential profiling, and transient conductivity measurements.
To connect these perspectives, unified drift-diffusion-Poisson models31 have been introduced, which describe electrons, holes, and ions simultaneously through coupled non-linear partial differential equations. While conceptually powerful, these models require careful numerical treatment to maintain stability and convergence, and their complexity grows rapidly when including realistic physical factors such as injection barriers, disorder, recombination, and morphology dependent mobilities are included. As a result, they can become computationally expensive and are less suited for rapid parameter sweeps or adaptation to new experimental conditions.
Implementing KMC requires a discrete set of ion positions representing energetically distinct sites in the host material, and the migration barriers that separate them. These barriers, typically obtained from first-principles methods (e.g., density functional theory) or the nudged elastic band technique, determine how easily ions can move. The transition rate for each event is calculated using an Arrhenius-type expression:
![]() | (1) |
At each KMC step, all possible migration events, such as hopping, trapping, or detrapping, are listed with their rates. After calculating the total rate, one event is randomly selected according to its probability, and the simulation time is incremented by a stochastic interval drawn from an exponential distribution. By repeating this process over millions of steps, KMC produces statistically robust transport properties, including diffusivity and conductivity, even under conditions far from equilibrium.16,34 Unlike classical Monte Carlo, which samples equilibrium states, KMC captures time-dependent dynamics directly, making it especially effective for studying ion migration on experimentally relevant timescales.34,35
Despite these advantages, most existing KMC implementations are specialized and difficult to generalize, which limits reproducibility and broader applicability. Many lack modularity, making it challenging to adapt them to different materials, such as amorphous systems, composites, or defect rich structures.16 As materials science increasingly relies on high throughput and multiscale modeling, there is a growing need for frameworks that can interface seamlessly with first principles calculations while remaining computationally efficient. Rising computational demands also emphasize the importance of sustainable algorithms: efficient, low overhead simulations not only reduce environmental impact but also make advanced modeling capabilities more widely accessible.
To address these challenges, we introduce a scalable stochastic simulation platform for modeling ion migration in solid state systems. Building on KMC and Markov chain concepts and inspired by our previous work on lanthanide molecular nanomagnets,36 the framework uses a probabilistic, event based methodology adapted to a different class of materials. It integrates systematic event generation, efficient rate calculation, and modular event handling to capture stochastic ion dynamics across a wide range of systems. While it does not reproduce exact atomic trajectories, the approach balances physical realism with computational efficiency, avoids the overhead of coupled PDE solvers, and reveals clear qualitative trends.
![]() | (2) |
Forward and backward probabilities are normalized to maintain detailed balance in the absence of bias. This allows both drift and diffusion to appear naturally from the same rules, while space charge effects arise from the changes in local fields. When implemented in a vectorized and parallelized way, the simulator can efficiently reproduce the combined effects of drift, diffusion, and Coulomb interactions without the need to explicitly solve Poisson's equation.
Considering the previous ideas, the simulator represents the device as a two-dimensional lattice of size Ny × Lx. The positions of the ions are stored in a matrix
, where each element Xij gives the column position of ion j along rail i. Each row represents a single horizontal path, which prevents ions from moving between rows and allows thousands of ions to be tracked efficiently. Ion motion is determined by an energy difference that depends on the local electric field:
| ΔE = tdevqionΔVnetdhop | (3) |
Moves are proposed for all ions at the same time at each KMC step, but they are accepted only if the target site is empty. A move is valid only if the target position is not already occupied (Δij > 1), preventing over occupation and reproducing physical space charge limitations. This rule, together with the local electric field that includes Coulomb repulsion, ensures that drift and diffusion emerge naturally while reducing ion mobility in dense regions, without requiring a Poisson solver. To connect the motion of individual ions with measurable properties, the fraction of ions in the first and last sections of the lattice, corresponding to the regions near the electrodes that dominate transport, is tracked. Normalizing these numbers against the total ion count and applying the time vector produces trajectories that can be directly related to device conductance and current under positive or negative bias (see SI, Section S2).
Fig. 1 illustrates the physical abstraction underlying the kinetic Monte Carlo framework used in this work. The polymeric layer is discretized into a set of energetically equivalent trapping sites arranged along independent one-dimensional rails, with ion motion restricted to site-to-site hopping along each rail. Under an applied bias, mobile cations experience a net drift toward the negatively biased electrode, while diffusive relaxation is incorporated by the stochastic nature of the hopping process. As ions accumulate near the interfaces, Coulombic repulsion progressively screens the applied field, lowering the probability of further hops into densely occupied areas.
As indicated above, to benchmark the platform, we focused on memristive materials, particularly polymer-based organic devices where resistive switching involves a complex interplay of ionic and electronic processes. In these systems, ion migration couples with charge trapping, interfacial barrier modulation, filament formation, and redox reactions, all of which shape switching kinetics and stability.37–41 Their behavior, involving multiple mechanisms, makes them an ideal test case for validating the simulator against experimental results, ensuring that it reproduces both qualitative trends and quantitative transport properties.
The rail-based abstraction introduces several simplifying assumptions that define the scope of applicability of the model. First, ion migration is confined to one dimensional motion along independent rails. Lateral diffusion and correlations between neighboring rails are not explicitly included. As a result, morphological inhomogeneities are taken into account only indirectly, through the zone based effective field correction. Electrostatic interactions are also treated in an approximate manner. Instead of solving Poisson's equation self consistently, the model uses an effective density based correction term. This approach captures space charge screening at the mesoscale, but it does not resolve local potential fluctuations at nanometer length scales. In addition, transport paths that may be curved in crystalline or perovskite systems are represented as linear effective trajectories, meaning that variations in field direction along curved paths are not explicitly described. These approximations make it possible to perform large scale stochastic simulations with very low computational cost. At the same time, they can reduce predictive accuracy in systems where lateral correlations, anisotropic migration pathways, or strongly morphology dependent transport processes play a dominant role.
To further improve computational and energy efficiency, we implemented an alternative version of the simulation using the JAX framework.42 Modern GPUs, with their massively parallel architectures, are naturally more energy efficient than CPUs for highly parallel numerical tasks. This efficiency comes from the high throughput per watt achieved by streaming multiple processing units optimized for vectorized operations, which is especially helpful for heavy linear algebra workloads. The JAX implementation closely follows the original NumPy code but takes advantage of GPU acceleration. All array operations were replaced with their JAX equivalents, enabling execution on both CPU and GPU without major structural changes. To further enhance performance, we applied just-in-time (JIT) compilation, which converts computational kernels into optimized machine code and significantly reduces Python overhead during repeated evaluations. This approach provides substantial performance gains while being consistent with the reference NumPy implementation. The quantitative comparison of CPU and GPU performance and energy metrics is provided in Tables S2 and S3 of the SI, showing that GPU execution consistently outperforms the CPU, achieving up to a 17-fold speedup and more than seven-fold energy savings for large scale simulations.
In the relaxation decay protocol, the model begins with rapid ion migration toward the electrode interfaces under an applied bias, followed by a slower redistribution modulated by repulsion once the bias is removed. Tracking individual ion positions over time reveals the evolving spatial density gradients, providing a direct view of how local electric fields weaken as space charge regions develop. Fig. 2 shows the relaxation dynamics after the initial bias is removed.
The simulations start from a uniform ionic distribution in which approximately one-third of the available sites are initially occupied, with ions randomly positioned across the device. During the polarization stage, a constant voltage is applied for a prescribed duration, and the curves in the figure reflect these two experimental controls: solid lines correspond to different applied voltages (2.5–10 V) at a fixed polarization time, while dotted lines correspond to different polarization durations (2–8 s) at a fixed voltage. Once this charging period ends, the voltage is removed and the system evolves freely, allowing the ionic distribution to relax toward equilibrium. Under these conditions, the fraction of ions accumulated near the electrode interface decreases exponentially with time, which indicates a relaxation process controlled by diffusion once field drift is no longer dominant. Regardless of the applied voltage or polarization time, all curves converge to a similar asymptotic value, demonstrating the system's return to a homogeneous distribution.
It is important to note that, at short enough times, the system can present short-time memory (STM), corresponding to noticeable values of current at times <10 s and applied fields lower than 5 V. Increasing the voltage or the duration of the applied field can turn this effect into long-time memory (LTM), which persists up to 45 s. Regarding the relaxation dynamics, a single polarization phase of a few volts and a few seconds still corresponds to the linear response regime. This is especially true for the time, where we see a noticeable proportionality between the number of ions accumulated in the first decile and time. At moderate voltages (<5 V), the ionic population scales linearly with initial pulse duration, confirming operation within the quasi-linear response regime. Deviations appearing at higher voltages (>7.5 V) reveal the onset of field-induced saturation and Coulombic crowding, which limit further ionic drift and enhance the consequent Coulombic effects. In this context, in the absence of strong interactions between ions, no significant deviations are expected at lower voltages or shorter polarization times. In the present model, however, both exclusion of occupied sites and a locally reduced effective electric field are explicitly included, which progressively suppress ionic drift as the ion density increases. These results show that the model accurately captures the transition from transport dominated by drift to transport controlled by diffusion, a key feature of ion-conducting polymers.
Monitoring the spatial and temporal dynamics of ionic charge carriers is central to the hysteresis simulations, where the program captures how the history of ionic accumulation shapes the width and asymmetry of the I–V loop under different sweep speeds and bias polarities.
The current–voltage characteristics depicted in Fig. 3 further validate the model's ability to capture the interplay between ionic motion and electrical response. The simulated I–V loops exhibit pronounced hysteresis, which is a well-known characteristic of memristive devices. In this case we also observe that the width and asymmetry present a strong dependence on the voltage sweep rate. At slow sweeps (<0.4 V s−1), ions have sufficient time to migrate and accumulate at the interfaces, leading to strong polarization effects and broad hysteresis loops as expected. As the sweep rate increases, the ionic subsystem proves to be unable to follow the rapidly varying alternate electric field, resulting in progressively narrower and more symmetric loops. This rate dependent effect is a physical representation of the competition between electronic conduction and ionic drift over time. Again, a demonstration of the power of the simulator to reproduce memory effects, with the voltage history dependence arising intrinsically from ion redistribution.
Beyond continuous voltage application, the simulator is also able to capture the fine dynamic conductance modulation to resemble synaptic plasticity in typical neuromorphic materials. Fig. 4 shows the potentiation–depression behavior obtained under alternative packages of voltage pulses for two representative relaxation times. The conductance increases during positive stimulation (potentiation phase) and decreases when the bias is reversed (depression phase), forming an asymmetric cycle typical of a memristive learning process. The degree of asymmetry and memory retention specially depends on the relaxation constant: short relaxation times (τ < 1 × 10−3 s) produce fast conductance changes with labile persistence of the memory effect, whereas increasing relaxation times (τ > 5 × 10−3 s) result in slower, more persistent responses. This tunability highlights how ionic relaxation governs the balance between short- and long-term memory analogs.
Energy storage (supercapacitors): for this application, the model is mostly adequate as it is. The most significant change here would be the metric we use to quantify the phenomenon: for supercapacitors one would like to quantify the energy storage, which could be estimated simply by the (electric) potential energy due to the charge separation.
Optoelectronics: for this application, one would need to add a new different physical process, namely carrier recombination where this specific quantum effect accounts for the light emission of the device. This modification would involve the explicit inclusion of electrons/holes in the MC simulation and the recombination probability/quantum yield.
Interaction between spin and chirality (CISS/Electric Magneto Chiral Anisotropy): for this field one would need to consider the spin of the charge carriers, which would be electrons, and also the effect on the resistance of the combination of spin state, transport direction and chirality of the device. Indeed, some of us already present this in an upcoming manuscript.43
Whereas the current version of the model does not reproduce filament formation, recovering this phenomenon would just require a small modification of the code and a moderate increase in the calculation time. The position of each charge carrier is currently registered, so it would be possible to change the behavior for each individual rail that satisfies the condition of a continuous line of charge carriers starting from the electrode. In those cases, all charge carriers except the last one should be considered as part of the electrode, meaning that the total voltage would act on a shorter device and thus produce a more intense electric potential. In turn, this would naturally generate a faster movement of the charge carriers and naturally result in the lengthening of these rails with a continuous line of charge carriers starting from the electrode, i.e. filaments.
In particular, to consider the systems where non-linear ion mobility is found (such as the perovskytes presented in ref. 20), the simulator should add an additional term on the relative energies of the successive sites which would account for the field dependence. To consider ionic transport along particular crystallographic directions we have projected all the trajectories in a single rail which accounts for a simplified version of the real system. Another simple improvement would be allowing more than one class of rails, with different proportions and hopping parameters: this would allow complex phenomena such as different characteristic times, frequencies or temperatures coexisting in the same device. Furthermore, the modeling could also be made more realistic by allowing motion between rails, although this would significantly increase computation time and affect performance.
These results show that the KMC framework provides a physically grounded yet computationally efficient description of ionic migration in polymeric memristive materials. By relying on fitting parameters that can be obtained experimentally, the model reproduces essential observables such as relaxation decay, hysteresis modulation, and asymmetric potentiation and depression cycles through a single stochastic mechanism. The agreement between the simulated trends and reported experimental behavior confirms that the model captures the correct hierarchy of time scales governing drift, diffusion, and electrostatic screening. This makes the simulator a valuable exploratory tool for linking device architecture, operating conditions, and material properties to emergent resistive switching behavior, and for supporting the rational design of future neuromorphic components.
Within this context, the model presented in this work a significant improvement. By adopting a probabilistic description of the relevant physical events, we eliminate the need for globally convergent differential equation solvers and enable the direct use of realistic experimental descriptors within the simulations. This approach supports efficient modeling while adding flexibility for incorporating new physical mechanisms without compromising numerical stability. For example, charge trapping effects associated with sparse defects can be introduced by modifying the transition probabilities at a small number of selected sites. Using this MC model, we are able to simulate the spatiotemporal evolution of ionic migration in polymer devices under realistic operating conditions, with a level of robustness and explanatory power that was not accessible in earlier modeling approaches.
All simulation code used in this study is openly available in the CupFlow repository at https://github.com/gerlizg/CupFlow. The repository contains the full kinetic Monte Carlo framework, example scripts, and all configuration files required to reproduce the results presented in this work.
Supplementary information is available. See DOI: https://doi.org/10.1039/d5qm00811e.
| This journal is © the Partner Organisations 2026 |