Core
AxialDriver
Axial driver class.
CVector
CVector class. Represents a 3D vector.
__init__(x, y, z)
Initialises a 3D vector.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
float
|
x component of the vector |
required |
y |
float
|
y component of the vector |
required |
z |
float
|
z component of the vector |
required |
length()
Returns the length of the vector.
normalize()
Normalizes the vector.
tolist()
Converts the vector to a list.
Junction
clearLog()
Reset current simulation state.
getLayerMagnetisation(layerId)
Get the magnetisation of a layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
layerId |
str
|
the layer id |
required |
getLog()
Retrieve the simulation log [data].
runSimulation(totalTime, timeStep=Ellipsis, writeFrequency=Ellipsis, persist=Ellipsis, log=Ellipsis, calculateEnergies=Ellipsis)
Main run simulation function. Use it to run the simulation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
totalTime |
float
|
total time of a simulation, give it in seconds. Typical length is in ~couple ns. |
required |
timeStep |
float
|
the integration step of the RK45 method. Default is 1e-13 |
Ellipsis
|
writeFrequency |
float
|
how often is the log saved to? Must be no smaller than |
Ellipsis
|
persist |
bool
|
whether to save to the filename specified in the Junction constructor. Default is true |
Ellipsis
|
log |
bool
|
if you want some verbosity like timing the simulation. Default is false |
Ellipsis
|
calculateEnergies |
bool
|
[WORK IN PROGRESS] log energy values to the log. Default is false. |
Ellipsis
|
setIECDriver(bottomLayer, topLayer, driver)
Set IEC interaction between two layers. The names of the params are only for convention. The IEC will be set between bottomLyaer or topLayer, order is irrelevant.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bottomLayer |
str
|
the first layer id |
required |
topLayer |
str
|
the second layer id |
required |
setLayerAnisotropyDriver(layerId, driver)
Set anisotropy driver for a layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
layerId |
str
|
the id of the layer. |
required |
driver |
ScalarDriver
|
the anisotropy driver to be set. |
required |
setLayerCurrentDriver(layerId, driver)
Set a current driver for a layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
layerId |
str
|
the layer id |
required |
driver |
ScalarDriver
|
the driver |
required |
setLayerDampingLikeTorqueDriver(layerId, driver)
Set the damping like torque driver for a layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
layerId |
str
|
the layer id |
required |
driver |
ScalarDriver
|
the driver |
required |
setLayerExternalFieldDriver(layerId, driver)
Set an external field driver for a layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
layerId |
str
|
the id of the layer. |
required |
driver |
AxialDriver
|
the field driver to be set. |
required |
setLayerFieldLikeTorqueDriver(layerId, driver)
Set the field like torque driver for a layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
layerId |
str
|
the layer id |
required |
driver |
ScalarDriver
|
the driver |
required |
setLayerMagnetisation(layerId, mag)
Set the magnetisation of a layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
layerId |
str
|
the layer id |
required |
mag |
CVector
|
the magnetisation |
required |
setLayerOneFNoise(layerId, sources, bias, scale)
Set 1/f noise for a layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
layerId |
str
|
the layer id |
required |
sources |
int
|
the number of generation sources (the more the slower, but more acc.) |
required |
bias |
float
|
the bias of the noise (p in the Multinomial distribution) |
required |
scale |
float
|
the scale of the noise, additional scaling factor |
required |
setLayerTemperatureDriver(layerId, driver)
Set a temperature driver for a layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
layerId |
str
|
the id of the layer. |
required |
driver |
ScalarDriver
|
the temperature driver to be set. |
required |
setQuadIECDriver(bottomLayer, topLayer, driver)
Set secondary (biquadratic term) IEC interaction between two layers. The names of the params are only for convention. The IEC will be set between bottomLyaer or topLayer, order is irrelevant.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bottomLayer |
str
|
the first layer id |
required |
topLayer |
str
|
the second layer id |
required |
Layer
__init__(id, mag, anis, Ms, thickness, cellSurface, demagTensor, temperature=Ellipsis, damping=Ellipsis)
The basic structure is a magnetic layer.
Its parameters are defined by the constructor and may be altered
by the drivers during the simulation time.
If you want STT, remember to set the reference vector for the polarisation of the layer.
Use setReferenceLayer
function to do that.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
str
|
identifiable name for a layer -- e.g. "bottom" or "free". |
required |
mag |
CVector
|
initial magnetisation. Must be normalised (norm of 1). Used for quicker convergence. |
required |
anis |
CVector
|
anisotropy of the layer. A normalised vector |
required |
Ms |
float
|
magnetisation saturation. Unit: Tesla [T]. |
required |
thickness |
float
|
thickness of the layer. Unit: meter [m]. |
required |
cellSurface |
float
|
surface of the layer, for volume calculation. Unit: meter^2 [m^2]. |
required |
damping |
float
|
often marked as alpha in the LLG equation. Damping of the layer. Default 0.011. Dimensionless |
Ellipsis
|
createSOTLayer(id, mag, anis, Ms, thickness, cellSurface, demagTensor, damping=0.11, fieldLikeTorque=0, dampingLikeTorque=0)
staticmethod
Create SOT layer -- including damping and field-like torques that are calculated based on the effective Spin Hall angles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
str
|
identifiable name for a layer -- e.g. "bottom" or "free". |
required |
mag |
CVector
|
initial magnetisation. Must be normalised (norm of 1). Used for quicker convergence. |
required |
anis |
CVector
|
anisotropy of the layer. A normalised vector |
required |
Ms |
float
|
magnetisation saturation. Unit: Tesla [T]. |
required |
thickness |
float
|
thickness of the layer. Unit: meter [m]. |
required |
cellSurface |
float
|
surface of the layer, for volume calculation. Unit: meter^2 [m^2]. |
required |
damping |
float
|
often marked as alpha in the LLG equation. Damping of the layer. Default 0.011. Dimensionless. |
0.11
|
createSTTLayer(id, mag, anis, Ms, thickness, cellSurface, demagTensor, damping=0.011, SlonczewskiSpacerLayerParameter=1.0, beta=0.0, spinPolarisation=0.0)
staticmethod
Create STT layer -- with the standard Slomczewski formulation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
str
|
identifiable name for a layer -- e.g. "bottom" or "free". |
required |
mag |
CVector
|
initial magnetisation. Must be normalised (norm of 1). Used for quicker convergence. |
required |
anis |
CVector
|
anisotropy of the layer. A normalised vector |
required |
Ms |
float
|
magnetisation saturation. Unit: Tesla [T]. |
required |
thickness |
float
|
thickness of the layer. Unit: meter [m]. |
required |
cellSurface |
float
|
surface of the layer, for volume calculation. Unit: meter^2 [m^2]. |
required |
damping |
float
|
often marked as alpha in the LLG equation. Damping of the layer. Default 0.011. Dimensionless. |
0.011
|
SlonczewskiSpacerLayerParameter |
float
|
Slomczewski parameter. Often marked as lambda. |
1.0
|
beta |
float
|
beta parameter that scales FL/DL ratio. |
0.0
|
spinPolarisation |
float
|
the spin effectiveness. |
0.0
|
getId()
Get Id of the layer
setAlternativeSTT(setAlternative)
Switch to an alternative STT forumulation (Taniguchi et al.) https://iopscience.iop.org/article/10.7567/APEX.11.013005
Parameters:
Name | Type | Description | Default |
---|---|---|---|
setAlternative |
bool
|
whether to set the alternative STT formulation |
required |
setAnisotropyDriver(driver)
Set anisotropy driver for the layer. It's scalar. The axis is determined in the layer constructor
setBottomDipoleTensor(tensor)
Set a dipole tensor from the bottom layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tensor |
List[CVector]
|
the dipole tensor to be set. |
required |
setDampingLikeTorqueDriver(driver)
Set a driver for the damping like torque of the layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
driver |
ScalarDriver
|
the driver to be set. |
required |
setFieldLikeTorqueDriver(driver)
Set a driver for the field like torque of the layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
driver |
ScalarDriver
|
the driver to be set. |
required |
setKappa(kappa)
Set the kappa parameter for the layer -- determines SOT mixing Hdl * kappa + Hfl Allows you to turn off Hdl. Turning Hfl is via beta parameter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kappa |
float
|
the kappa parameter |
required |
setMagnetisation(mag)
Set the magnetisation of the layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mag |
CVector
|
the magnetisation to be set. |
required |
setOerstedFieldDriver(driver)
Set an Oersted field driver for the layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
driver |
AxialDriver
|
the field driver to be set. |
required |
setReferenceLayer(ref)
Set a reference layer for the STT.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ref |
CVector
|
the reference layer vector. |
required |
setTemperatureDriver(driver)
Set a driver for the temperature of the layer. Automatically changes the solver to Euler-Heun.
setTopDipoleTensor(tensor)
Set a dipole tensor from the top layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tensor |
List[CVector]
|
the dipole tensor to be set. |
required |
NullDriver
Bases: ScalarDriver
__init__()
An empty driver that does nothing. Use in Axial Driver when the axis is to be id.
Reference
Reference layer indicator.
ScalarDriver
getConstantDriver(constantValue)
staticmethod
Constant driver produces a constant signal of a fixed amplitude.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constantValue |
float
|
constant value of the driver (constant offset/amplitude) |
required |
getCurrentScalarValue(time)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
time |
float
|
time in seconds |
required |
Returns:
Type | Description |
---|---|
float
|
the scalar value of the driver at time. |
getGaussianImpulseDriver(constantValue, amplitude, t0, sigma)
staticmethod
Gaussian impulse driver. It has amplitude starts at t0 and falls off with sigma.
Formula: A * exp(-((t - t0) 2) / (2 * sigma 2))
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constantValue |
float
|
offset of the pulse (vertical) |
required |
amplitude |
float
|
amplitude that is added on top of the constantValue |
required |
t0 |
float
|
start of the pulse |
required |
sigma |
float
|
fall-off of the Gaussian pulse |
required |
getGaussianStepDriver(constantValue, amplitude, t0, sigma)
staticmethod
Gaussian step driver (erf function). It has amplitude starts at t0 and falls off with sigma.
Formula: f(t) = constantValue + amplitude * (1 + erf((t - t0) / (sigma * sqrt(2))))
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constantValue |
float
|
offset of the pulse (vertical) |
required |
amplitude |
float
|
amplitude that is added on top of the constantValue |
required |
t0 |
float
|
start of the pulse |
required |
sigma |
float
|
fall-off of the Gaussian pulse |
required |
getPosSineDriver(constantValue, amplitude, frequency, phase)
staticmethod
Produces a positive sinusoidal signal with some offset (constantValue), amplitude frequency and phase offset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constantValue |
float
|
vertical offset. The sine will oscillate around this value. |
required |
amplitude |
float
|
amplitude of the sine wave |
required |
frequency |
float
|
frequency of the sine |
required |
phase |
float
|
phase of the sine in radians. |
required |
getPulseDriver(constantValue, amplitude, period, cycle)
staticmethod
Produces a square pulse of certain period and cycle
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constantValue |
float
|
offset (vertical) of the pulse. The pulse amplitude will be added to this. |
required |
amplitude |
float
|
amplitude of the pulse signal |
required |
period |
float
|
period of the signal in seconds |
required |
cycle |
float
|
duty cycle of the signal -- a fraction between [0 and 1]. |
required |
getSineDriver(constantValue, amplitude, frequency, phase)
staticmethod
Produces a sinusoidal signal with some offset (constantValue), amplitude frequency and phase offset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constantValue |
float
|
vertical offset. The sine will oscillate around this value. |
required |
amplitude |
ScalarDriver
|
amplitude of the sine wave |
required |
frequency |
float
|
frequency of the sine |
required |
phase |
float
|
phase of the sine in radians. |
required |
getStepDriver(constantValue, amplitude, timeStart, timeStop)
staticmethod
Get a step driver. It has amplitude between timeStart and timeStop and 0 elsewhere
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constantValue |
float
|
offset of the pulse (vertical) |
required |
amplitude |
float
|
amplitude that is added on top of the constantValue |
required |
timeStart |
float
|
start of the pulse |
required |
timeStop |
float
|
when the pulse ends |
required |
getTrapezoidDriver(constantValue, amplitude, timeStart, edgeTime, steadyTime)
staticmethod
Create Trapezoid driver. Has a rising and a falling edge.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constantValue |
float
|
offset of the pulse (vertical) |
required |
amplitude |
float
|
amplitude that is added on top of the constantValue |
required |
timeStart |
start of the pulse |
required | |
edgeTime |
float
|
time it takes to reach the maximum amplitude |
required |
steadyTime |
float
|
time it spends in a steady state |
required |
SolverMode
SolverMode Indicator
c_dot(arg0, arg1)
Compute dot (scalar) product of two CVectors.
constantDriver(constant)
Constant driver produces a constant signal of a fixed amplitude.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constant |
float
|
constant value of the driver (constant offset/amplitude) |
required |
gaussianImpulseDriver(constantValue, amplitude, t0, sigma)
Gaussian impulse driver. It starts with an max amplitude at t0 and falls off with sigma.
Formula:
\(A * \exp(-(t - t_0)^2 / (2\sigma^2))\)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constantValue |
float
|
offset of the pulse (vertical) |
required |
amplitude |
float
|
amplitude that is added on top of the constantValue |
required |
t0 |
float
|
start of the pulse |
required |
sigma |
float
|
fall-off of the Gaussian pulse |
required |
gaussianStepDriver(constantValue, amplitude, t0, sigma)
Gaussian step driver (erf function). It starts at t0 and falls off with sigma.
Formula:
\(f(t) = c + A + A\mathrm{erf}((t - t_0) / (\sigma \sqrt(2)))\)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constantValue |
float
|
offset of the pulse (vertical) |
required |
amplitude |
float
|
amplitude that is added on top of the constantValue |
required |
t0 |
float
|
start of the pulse |
required |
sigma |
float
|
fall-off of the Gaussian pulse |
required |
posSineDriver(constantValue, amplitude, frequency, phase)
Produces a positive sinusoidal signal with some offset (constantValue), amplitude frequency and phase offset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constantValue |
float
|
vertical offset. The sine will oscillate around this value. |
required |
amplitude |
float
|
amplitude of the sine wave |
required |
frequency |
float
|
frequency of the sine |
required |
phase |
float
|
phase of the sine in radians. |
required |
pulseDriver(constantValue, amplitude, period, cycle)
Produces a square pulse of certain period and cycle
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constantValue |
float
|
offset (vertical) of the pulse. The pulse amplitude will be added to this. |
required |
amplitude |
float
|
amplitude of the pulse signal |
required |
period |
float
|
period of the signal in seconds |
required |
cycle |
float
|
duty cycle of the signal -- a fraction between [0 and 1]. |
required |
sineDriver(constantValue, amplitude, frequency, phase)
Produces a sinusoidal signal with some offset (constantValue), amplitude frequency and phase offset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constantValue |
float
|
vertical offset. The sine will oscillate around this value. |
required |
amplitude |
float
|
amplitude of the sine wave |
required |
frequency |
float
|
frequency of the sine |
required |
phase |
float
|
phase of the sine in radians. |
required |
stepDriver(constantValue, amplitude, timeStart, timeStop)
Get a step driver. It has amplitude between timeStart and timeStop and 0 elsewhere
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constantValue |
float
|
offset of the pulse (vertical) |
required |
amplitude |
float
|
amplitude that is added on top of the constantValue |
required |
timeStart |
float
|
start of the pulse |
required |
timeStop |
float
|
when the pulse ends |
required |
trapezoidDriver(constantValue, amplitude, timeStart, edgeTime, steadyTime)
Create Trapezoid driver. Has a rising and a falling edge.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constantValue |
float
|
offset of the pulse (vertical) |
required |
amplitude |
float
|
amplitude that is added on top of the constantValue |
required |
timeStart |
start of the pulse |
required | |
edgeTime |
float
|
time it takes to reach the maximum amplitude |
required |
steadyTime |
float
|
time it spends in a steady state |
required |